# Question
Title: ee253 and assets205 upload and thumbnail view
I have an assets custom field but I cant upload or view actual thumbnails in my S3 bucket. I update indexes but just see default jpg placeholder icons in the directory. Any ideas what the issue could be? When I upload an image via my entry the progress bar completes suggesting a compete upload but the image never uploads. Tried jpg and png? Thanks

# Answer
> 1 votes
I think I just responded to your email: the most common reason we see this is when system/expressionengine/cache is not set to 777 permissions - as well as its subfolders specific to assets. Can you re-set those and try again after re-setting the permissions?

That should hopefully fix this up for you.

\__

Edit to Add: If this is the same person I emailed, they resolved it by upgrading EE from 2.5.3 to 2.5.5.

---
Tags: assets
---


# Question
Title: Freeform Pro AJAX Validation with AJAX Submit using jQuery Form plugin
I'm using the jQuery Form plugin (http://malsup.com/jquery/form/) to return an AJAX message on successful submission of a contact form. However, I also need to do AJAX validation.

My current form and script looks like this;

```
<div id="send1">
{exp:freeform:form
    form_name="callback"
    form:id="callback"
    return="ajax/success_callback"
    required="full_name|message"
}
    <label>Full Name</label>
    {if freeform:error:full_name}
    {freeform:field:full_name}

    <label>Message</label>
    {if freeform:error:message}
    {freeform:field:message}

    <input class="more_info" type="submit">
{/exp:freeform:form}
</div>

<div id="send2"></div>

<script src="/assets/js/jquery.min.js"></script>
<script src="/assets/js/jquery.form.min.js"></script>
<script>
// prepare the form when the DOM is ready
$(document).ready(function() {
    // bind form using ajaxForm
    $('#callback').ajaxForm({
        // target identifies the element(s) to update with the server response
        target: '#send2',

        // success identifies the function to invoke when the server response
        // has been received; here we apply a fade-in effect to the new content
        success: function() {
            $('#send1').hide();
            $('#send2').fadeIn('slow');
        }
    });
});
</script>

```

As you can see, on success I am hiding the 'send1' div and simply loading a success template into the 'send2' div.

I was wondering if anyone might be able to help on how to construct the error messaging using AJAX that will work using or alongside the jQuery Form plugin?

Thank you.

# Answer
> 1 votes
doubleplusgood, I think you're answer's right there in the jQuery Form documentation, plus a little research to do outside.

* the outside part is that good practice for your EE-side ajax response is to be simple -- no HTTP error codes should be used, even on error. Just return the `div` contents from EE that you want to show, whether you indicate success or give error messages.
* the initial examples in jQuery Form doc are too simplistic - they shouldn't be demonstrating by popping an alert. That would be a troubleshooting temporary, in real life.
* rather, you indicate where returned output goes by using the 'target' in the options object you initialize with. Its value is simply the id (`#name`) of the `div` whose contents you want to have replaced by your response html.
* then without needing any alerts, when the ajax response comes back from your EE call, it will go directly into `<div #name>`. Thus either your indication of success, or your error instructions will show there.

This is almost too simple, which is why the instructions may have seemed obscure. Have a look at their first demo under menu item Examples -- the ajaxForm page. It is live -- you can trigger the buttons and see the above happen, after examining the html behind the page. They *also* show alerts -- this could be useful for debugging, but probably not necessary, so again please don't confuse that with the real intended action.

Have a particular look at the source for `<div #output1>`, at the bottom of the example page, before you trigger it; and at the bottom of the browser page itself, before and after. Then you'll see the principle of the thing, in the way you've asked.

There are other variations under Examples, should you run into other needs.

jQuery Form is a nice tool, seems. Good fortune on your app.

---
Tags: ajax, jquery, solspace-freeform, validation
---


# Question
Title: Freeform returning "Disallowed Key Characters" and "Unauthorized Action" Messages
I would like to create a second form on my ExpressionEngine 2.5.2 site using Freeform. We have been using the Freeform module for about a year and a half, but I have recently been experiencing 2 different problems. I'm not sure if the issues are related or not:

**Problem 1 - Disallowed Characters**

When I go in to my ExpressionEngine control panel and try to add information to a blank field of an entry, when submitting the change, I always receive a message that says "Disallowed Key Characters." Nothing is wrong with the fields I am entering the data into, and there are no unusual characters in the data that I'm entering.

I am able to enter data into a form when pulling up an old form page on our site in my browser \[not in my ExpressionEngine control panel\].

**Problem 2 - Unauthorized Action on New Forms**

I created a simple new form where I am only entering a first name and a last name, then clicking submit. On the webpage in a browser, when I fill those two fields then click submit, I get taken to a new page that says "You are not authorized to perform this action". This doesn't make any sense to me and I'm out of troubleshooting ideas.

Here is the very simple form I am using in my html page, and I have created each of the fields in the Freeform module within EE that are listed in my code -

```
<form class="application-form" action="#">
    {exp:freeform:form collection="Entry Form" return="home/index"}
    <fieldset>
        <div class="heading">
            <h2>APPLY TO COMPETE</h2>
        </div>
        <div class="row">
            <div class="col">
                <label for="first_name">First Name</label>
                <input type="text" dir="ltr" id="first_name" name="first_name" value="" />
            </div>
            <div class="col">
                <label for="last_name">Last Name</label>
                <input type="text" dir="ltr" id="last_name" name="last_name" value="" />
            </div>
        </div>
        <div class="row">
            <input type="submit" value="submit" />
        </div>
    </fieldset>
    {/exp:freeform:form}
</form>

```

# Answer
> 3 votes
1. is usually disallowed character in the url. e.g. in a get parameter, or in a form input name.
2. i don't think you should add the `<form>` tag yourself, it will be set by freeform, no?

---
Tags: error, solspace-freeform
---


# Question
Title: Problems getting Wygwam's has_excerpt feature working with Low Variables
I'm using Low Variables (2.3.3) with a Wygwam (2.7) variable type.

Is it possible to get the has\_excerpt functionality working in this setup?

I've tried the following code but it ignores it and just outputs the tag:

```
{lv_my_variable:has_excerpt}

```

Wondering if I'm doing something wrong, or whether it's just not supported? Thanks.

# Answer
The variable syntax, `{lv_my_variable}`, doesn't support any additions or variations like that. It's like a Snippet or Global Variable: just as is. For extra processing, you'd need to use the tag syntax: `{exp:low_variables:single var="lv_my_variable"}`.

However, getting to additional options like the `:has_excerpt` function is up to the fieldtype author to implement. Something like `{exp:low_variables:single var="lv_my_variable" method="has_excerpt"}` would be nice in this case. But, again, that's up to Pixel & Tonic to add support for.
> 2 votes

---
Tags: wygwam, low-variables
---


# Question
Title: Looking for a way to get Simple Registration add-on to send details to Campaign Monitor list subscription
I'm working on a site that uses Simple Registration to handle user registrations (we needed the facility to assign people to a particular group on sign up).

I also need this process to involve adding the user to a mailing list on Campaign Monitor.

I've tried using the excellent Campaigner, but this doesn't seem to work with Simple Registration. I'm not sure why at the moment but it seems the 2 add-ons don't play nicely.

Has anyone got experience of this or have a solution?

# Answer
Try swithing to Freemember of Stand-Alone Member Register for registration. Both have option to assign people to certain group.
> 1 votes

---
Tags: members, campaignmonitor, signup
---


# Question
Title: Using Backstretch to generate a slideshow
I have a site where the client wants to add images as a fullscreen slideshow behind the site container. I've used backstretch.js for this and can get it to show up a single image by using straight channel entries but this is no good. I've created a channel just for the images where each entry is a single image file.

```
 {exp:channel:entries channel="background_images" dynamic="no" orderby="date" sort="desc" status="open"}

  <script>
        $("#stretch").backstretch([
        "{background_images}",
         ], {duration: 5000, fade: 750});
  </script>

{/exp:channel:entries}

```

I then tried to set up an embed, where I used this code on my embed page:

```
{exp:channel:entries channel="background_images" dynamic="no" orderby="date" sort="desc" status="open" backspace="1"}"{background_images}",{/exp:channel:entries}

```

and called in into my template like so:

```
<script>
$("#stretch").backstretch([
    {embed="en/background_imgs"}
 ], {duration: 5000, fade: 500});
</script>

```

But using this method, I get a console error:

```
Type Issue: 'undefined' is not a function (evaluating '$("#stretch").backstretch')

```

Am I going about this the wrong way? Has anyone implemented this successfully in the past that could give me a little help.

# Answer
A couple of things here. The best way to see what's actually happening is to look at the source code of your page - that way you can see exactly what the final output of your code is and spot the errors.

Second, when adding inline javascript to an EE template, you need to break serialized arrays (arguments inside curly braces) up over newlines, lest EE try to interpret them as EE variables (which use the same syntax).

Third, your code will leave a trailing comma in the images array, which can trigger JS errors. The `backspace` parameter can help with that.

I'd use this code:

```
<script>
    $("#stretch").backstretch(
        [{exp:channel:entries channel="background_images" dynamic="no" status="open" backspace="1" disable="member_data|pagination|categories"}"{background_images}",{/exp:channel:entries}],
        {
            duration: 5000,
            fade: 750
        }
    );
</script>

```
> 3 votes

---
Tags: channel-entries
---


# Question
Title: Error when submitting new entry via the Channel Entries API
If member publish entry I want publish some info to another channel I wrote extension, but it doesn't work and always I see 'An Error Occurred Creating the Entry' I need help

This is my code

```
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Calladder_ext {

    public $name           = 'Call adder';
    public $version        = '1.0';
    public $description    = 'Add call when publish to channel';
    public $settings_exist = 'n';
    public $docs_url       = '';

    private $settings = array();

    /**
     * Constructor
     *
     */
    public function __construct($settings='')
    {
        $this->EE =& get_instance();
        $this->EE->lang->loadfile('calladder');
    }

    public function add_call($entry_id, $meta, $data)
    {
        if( in_array( $data['channel_id'], array(4,5,6) ) )
        {
            //prepare data
            // some code...

            $datap = array(
                    'title'         => $title,
                    'channel_id'    => 7,
                    'field_id_48'   => $phone,
                    'field_id_47'   => $name,
                    'field_id_50'   => $email,
                    'field_id_49'   => $comment,
                    'field_id_88'   => $entry_id
            );

            $this->insert_entry(7, $datap);

        }

    }

    private function insert_entry($channel_id, $data)
    {
        $this->EE->load->library('api');
        $this->EE->api->instantiate('channel_entries');
        $this->EE->api->instantiate('channel_fields');

        $this->EE->api_channel_fields->setup_entry_settings($channel_id, $data);

        if ($this->EE->api_channel_entries->submit_new_entry($channel_id, $data) === FALSE)
        {
                show_error('An Error Occurred Creating the Entry');
        }
    }

    public function activate_extension()
    {

        $data = array(
            'class'     => __CLASS__,
            'method'    => 'add_call',
            'hook'      => 'entry_submission_end',
            'settings'  => serialize($this->settings),
            'priority'  => 2,
            'version'   => $this->version,
            'enabled'   => 'y'
        );

        $this->EE->db->insert('extensions', $data);

    }

    public function disable_extension()
    {
        $this->EE->db->where('class', __CLASS__);
        $this->EE->db->delete('extensions');
    }
}
?>

```

# Answer
Chances are you're missing a required field in that channel, or submitting some incorrect data. To find out why your entry is not being submitted, add this within your "if submit\_new\_entry is false" conditional:

```
print($this->EE->api_channel_entries->errors); exit();

```
> 4 votes

---
Tags: channel
---


# Question
Title: Safecracker and GWCODE Categories Checkboxes not staying checked
Here is what I am trying to do.

I am using Safecracker to do the add/edit posting, but when the user click on a checkbox, then go to edit the posting, the check box is not there.

I am using Gwcode Categories Plugin, outputting my categories as checkboxes because it has more feature and flexibility then the built in safecracker categories tag

GWCode Categories

```
        <ul>
        {exp:gwcode_categories group_id="9"}
        <li>
    <input type="checkbox"  id="categories" name="category[]" value="{cat_id}" {checked} />
 <span>{cat_name}</span>
 </li>
 {/exp:gwcode_categories}
</ul>

```

but when I use Safecracker

```
<ul>
     {categories}
      <li><input type="checkbox" name="category[]" id="categories" value="{category_id}" {checked} />
<span>{category_name}</span> </li>
{/categories}
</ul>

```

the checkbox is there. why I cant just used the {checked} in the Gwcode Categories and why does it have to be in {categories}{/categories}

here is the code that I have right now and trying to do with safecracker

```
{exp:gwcode_categories group_id="9"}
    {if has_children && parent_id == '0' }
        <!-- parent with children -->
        <li class="checkbox checkbox_parent">
            <span><b>{cat_name}</b></span>
        </li>
    {if:elseif depth == 2}
        <!-- child at second level -->
        <li class="checkbox">
            <input type="checkbox" id="categories" name="category[]" value="{cat_id}" checked="{checked}" />
            <span>{cat_name}</span>
        </li>
    {if:elseif depth == 3}
        <!-- child at third level -->
        <li class="checkbox">
            <input type="checkbox"  id="categories" name="category[]" value="{cat_id}" checked="{checked}" />
            <span>{cat_name}</span>
        </li>
    {if:else}
        <!-- parent with no children -->
        <li class="checkbox_parent_nochild">
            <input type="checkbox"  id="categories" name="category[]" value="{cat_id}" checked="{checked}"  />
            <span>{cat_name}</span>
        </li>
    {/if}
{/exp:gwcode_categories}

```

# Answer
When within a SC form, GWcode Categories will not be aware of which categories are currently selected for the entry. You'll have to use Safecracker's `{categories}` loop.
> 1 votes

---
Tags: safecracker, gwcode-categories
---


title: Allow non member comments

text:
# Question
Title: Allow non member comments
I'd like to allow anyone to comment through my EE site, but it seems that the standard comment module only allows a logged in user to comment.

Is there a way to:

1. allow any one to comment
2. assume that any logged in user is a member of X member group
3. assign non-logged in visitors to the site a temporary membership - for example as part of the guest group?

Any pointers much appreciated!

----- EDIT in response to Jerome and Tidy's questions -------

My comments form code is below. If I am logged in to EE the form appears, if I am not logged in then the form does not appear at all.

I have double checked both that 'can post comments' is set to yes for the 'guest' account and that, on my channel, 'Require membership in order to post comments?' is set to 'no' plus 'Allow comments in this channel' is set to 'yes'.

```
{exp:comment:form channel="shop_products" entry_id="{entry_id}" rating:enabled="yes"}
        {if rating:already_rated} You have already rated this entry{/if}

        {if rating:not_rated}
            <label>Rating</label>
            <select name="rating[default]">
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
            </select><br />
        {/if}

        {if logged_out}
            <label for="name">Name:</label><br /><input type="text" name="name" value="{name}" size="50" /><br /><br />
            <label for="email">Email:</label><br /><input type="text" name="email" value="{email}" size="50" /><br /><br />
        {/if}

        <label for="comment">Review:</label><br />
        <textarea name="comment" cols="70" rows="10">{comment}</textarea><br /><br />

        <input type="submit" value="Submit Comment">

    {/exp:comment:form}

```

# Answer
> 1 votes
It wasn't the comments module that was hiding the form, it was the channel\_ratings add on i was using with it. Adding the parameter rating:allow\_guests="yes" to the code above sorted my issue. Code repeated below.

Many thanks to GDmac for helping me see the light!

```
{exp:comment:form channel="shop_products" entry_id="{entry_id}" rating:enabled="yes" rating:allow_guests="yes"}
    {if rating:already_rated} You have already rated this entry{/if}

    {if rating:not_rated}
        <label>Rating</label>
        <select name="rating[default]">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
        </select><br />
    {/if}

    {if logged_out}
        <label for="name">Name:</label><br /><input type="text" name="name" value="{name}" size="50" /><br /><br />
        <label for="email">Email:</label><br /><input type="text" name="email" value="{email}" size="50" /><br /><br />
    {/if}

    <label for="comment">Review:</label><br />
    <textarea name="comment" cols="70" rows="10">{comment}</textarea><br /><br />

    <input type="submit" value="Submit Comment">

{/exp:comment:form}

```

# Answer
> 3 votes
Any user is automatically a member of the default "guest" member group. To allow them to comment, just edit the "guest" member group preferences

* Control panel, members \> member groups
* look for comment posting privileges and set it to "yes".

Have you tried that and it does not work?

# Answer
> 1 votes
As well as checking the guest member group permissions as Jerome outlined, in the channel preferences, under comment posting preferences, check that 'Require membership in order to post comments?' is set to no.

---
Tags: members, comments, guest
---


# Question
Title: Super Search Doesn't Work on Live server
I’ve just launched a site using Super Search.

Everything works nicely on the dev server but on the live server the search produces no results:

Here is a search for 1 bedroom:

http://demo.alexmarks.com.php53-26.dfw1-2.websitetestlink.com/properties/search\_results/search&bedrooms-from=1&category=&channel=lettings/

which shows 15 results

Same search on the live server:

http://alexmarks.co.uk/properties/search\_results/search&bedrooms-from=1&category=&channel=lettings/

which shows 0 results

What could be causing this?

Niall

# Answer
> 2 votes
It was an issue with url paths that weren't changed in the migration. Rookie error but solved.

# Answer
> 1 votes
Suggested things to try:

1. Clear main **EE cache**
2. On the Super Search module page, click on Utilities tab and then Build Search Lexicon
3. Click on Preferences tab and then on Clear Cached Searches

---
Tags: supersearch
---


title: Memory error only when logged in

text:
# Question
Title: Memory error only when logged in
I'm getting:

> Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1321273 bytes) in /system/codeigniter/system/core/Loader.php on line 739

but only when logged in to the control panel as a super admin. Any ideas what might be causing that?

# Answer
I looked at line 739 in Loader.php. It's `$buffer = ob_get_contents();`. Here is the code right around it.

```
log_message('debug', 'File loaded: '.$_ci_path);

// Return the file data if requested
if ($_ci_return === TRUE)
{
    $buffer = ob_get_contents();
    @ob_end_clean();
    return $buffer;
}

```

Looks like a debug message is being logged right before this line which will help you track this backwards.

Here's details on **enabling logging in EE config.php**.

You could also add an additional debug message inside the conditional. Something like:

```
log_message('debug', 'Buffer data: '.$buffer);

```
> 2 votes

---
Tags: php-errors
---


# Question
Title: Automatically assign parent category to child category url's
I have multiple parent categories:

Kids Stuff Dining Out Things to Do

Each of those parents have multiple children:

Kids Stuff -\> Schools, Camps, Parties Dining Out -\> Restaurants, Catering Things to Do -\> Day Trips, Weekend Getaways, Activities

Entries can be in more than one Parent as well as more than one Child.

On the individual entry page, I need to show the categories the entry is assigned and the link to the (parent or child) category page.

PARENTS:

/kids-stuff/ /dining-out/ /things-to-do/

Parents work fine. It's the Children that are a problem.

I want the Child Category URL's to show the Parent name (each parent category has a different template), as well as the child name like so:

CHILDREN: /kids-stuff/schools/ /kids-stuff/camps/ /kids-stuff/parties/ /dining-out/restaurants/

and so on.

Instead EE is giving them the following URL's /schools/ /camps/ /parties/ /restaurants/

Thanks for any help or insight you can offer.

# Answer
> 4 votes
Yup, the solution here is to use the GWcode Categories plugin rather than the standard EE Channel Categories tag, and Low Seg2Cat instead of relying on EE's dynamic category methods.

So, to output your categories list (as a simple example):

```
{exp:gwcode_categories channel="my_channel"}
    <a href="/filter/{complete_path}">{cat_name}</a>
{exp:gwcode_categories}

```

This will output a nested list of categories, and each will link to a URL containing every `category_url_title` all the way up the category tree for that particular category.

Then, in your **filter/index** template (again, just an example):

```
{exp:channel:entries channel="my_channel" category="{segment_category_ids}"}
    ... list your stuff ...
{/exp:channel:entries}

```

This will show only entries assigned to *all* of the categories listed in the URL.

---
Tags: categories, child-categories
---


# Question
Title: Front-end URL for Assets file download that is above root, should this work?
I have a file upload directory above root in a folder called "secure\_files". I can successfully upload files to this directory from within my Assets field. The file upload directory is setup like below...

Server Path to Upload Directory: /Users/mlohrman/Sites/secure\_files/

URL of Upload Directory: ../

here's my template code..."file\_upload\_matrix" is my matrix field. "files" is the column with the Assets field in it. This successfully displays the files on the front end.

```
    {file_upload_matrix}
    {filename}
    {files}
    <a href="{url}">{title}</a>
    {/files}
    {/file_upload_matrix}

```

The URL on the front-end is "../file.pdf". So when I'm on this page "http://site.com/departments/marketing/files/" it's trying to find the file at "http://site.com/departments/file.pdf".

Now I've done something similar using DevDemon Channel Files and had the same file upload settings and that plugin has a built in obfuscated links feature. I'm not sure what's happening behind the scenes, but setting the file URL to obfuscated would allow a person on the front-end to download that file that was sitting in the folder above root. I know Assets doesn't have the obfuscated link feature, but I thought I could try Link Vault plugin to do that for me. But I'm not positive the URL is correct now to pass to Link Vault. Any thoughts?

# Answer
You can definitely use Link Vault to serve files that are above web root. There are a few different ways to construct a download link with Link Vault. Link Vault expects the path supplied to be relative to the web root so any one of these would work :

```
{exp:link_vault:download_link directory='../../files/' file_name='file.zip' }
{exp:link_vault:download_link file_path='../../files/file.zip' }

```

If the file does happen to be below web root, you can even use :

```
{exp:link_vault:download_link file_path='http://example.com/images/cat.jpg' }

```

The link that is generated gets encrypted so your files are safe and hackers can't just modify the parameters to go searching through your files (abbreviated example) :

```
http://example.com?ACT=50&file=eomDdQoswRC%2FqjxKLXR2Te0hebW7dtx%2B

```

We're always available in the support forum if you need help.
> 2 votes

# Answer
This could work with Link Vault or any of the link-obsfucation plugins (CartThrob has one built-in, for example). Just pass the plugin the `{server_path}` Assets variable.
> 1 votes

---
Tags: assets, matrix, file-uploads
---


# Question
Title: Google Maps for EE, not showing all entries?
I have Google Maps for EE installed, and I am using it to display a full page map with all my entries on. (Currently at about 150 entries).

However at least the first 50 of these entries are not showing. Each entry has an individual marker that displays correctly on its own single page view, but its completely missing from the full map view view.

Heres my code that I am using to display the full map.

```
<div id="map-holder-main">

    {exp:gmap:init id="map2" scrollwheel="false" style="width:100%;height:100%"}

    {exp:channel:entries channel="walks" disable="member_data|pagination"}

        {exp:gmap:marker id="map2" latitude="{latitude}" longitude="{longitude}" geocode="false" clustering="false" show_one_window="true" maxWidth="200"}

            {lv_walkdetails_map}

        {/exp:gmap:marker}

    {/exp:channel:entries}

</div>

```

Any idea as to why these first 50 or so entries in the channel are not showing?

# Answer
The `exp:channel:entries` tag has a default of `limit="100"` so you need to override that with `limit="300"` or a number large enough to accomplish what you need to do.
> 1 votes

---
Tags: google-maps, google-maps-for-ee
---


# Question
Title: increase upload_max_filesize with php.ini
I'm trying to increase the upload file size for my EE installation to 120MB. I have verified that I can modify these settings with my hosting service by adding a php.ini file to my webspace and placing the following code in it:

```
upload_max_filesize=120M

```

I have done this, and when I go to utilities and view the setting for that parameter, it shows that its been changed to 120M, but I am not able to upload a file that is 14.7MB. I get an error in EE stating that the file size has exceeded the limits in my php configuration. Any ideas?

# Answer
> 3 votes
Try setting

```
post_max_size=120M

```

http://www.php.net/manual/en/ini.core.php#ini.post-max-size

# Answer
> 4 votes
There are multiple PHP settings you should change to allow for larger file uploads:

* upload\_max\_filesize
* max\_input\_time
* memory\_limit
* max\_execution\_time
* post\_max\_size

This **page gives details**.

---
Tags: file-uploads, php
---


title: Low yearly archives wrong return

text:
# Question
Title: Low yearly archives wrong return
I have 6 entries which should show up, but when i use the code below it gives as return just three results. I think the problem is the **category="not 3"**, does anybody has some experience with the category parameter?

```
{exp:low_yearly_archives
       channel="agenda"
       start_month="1"
       category="not 3"
       show_expired="yes"
       show_future_entries="yes"
       sort="asc" dynamic="off"}

<li><a href="/{year}" data-toggle="tab">{year}
    <span class="badge badge-warning pull-right">{entries_in_year}</span></a>
</li>
{/exp:low_yearly_archives}

```

# Answer
As per the documentation, the `category` parameter ~~isn't~~ is available in Low Yearly Archives, but isn't documented.

However, the behaviour is the same as the native channel:entries tag, so you could be running into this:

> When you use the category="3|4" parameter (not excluding), you are implicitly telling ExpressionEngine to only deal with entries that have been assigned one or more categories. If you have entries that haven’t been categorized then they will be ignored and not included in the results. However, if you are using exclusion (category="not 3|4"), then you will be shown all entries without those categories including those without any categories assigned.

See the docs on this.

So basically, defining `category="not 3"` will exclude entries that **only** have category 3. If an entry has category 3 **and** another category assigned, it won't be excluded.
> 2 votes

---
Tags: categories, low-yearly-archives
---


# Question
Title: {url_title} In URL, and Edit Form on Next Page
having a bit of trouble getting the url\_title from the filled out safecracker form to appear correctly, here is what i have:

```
{exp:safecracker
channel="personal_trainer_directory"
entry_id=""
safecracker_head="no"
use_live_url="no"
url_title=""
}
{exp:membrr:subscriptions}
<span id="ptmember">
    <a href="{site_url}member/update-personal-trainer-page/{subscription_id}/{url_title}/">Update Personal Trainer Page</a>
</span>
{/exp:membrr:subscriptions}
{/exp:safecracker}

```

im trying to get the name to appear in the segment and then on the next page will be the safecracker where i can put {segment\_4} for the url\_title so the form will be able to edit the entry.. but with the way it is now, nothing is showing up for {url\_title}.

# Answer
> 2 votes
Your safecracker tag should contain the complete `url_title="{segment_4}"` (if url\_title is empty, you get an empty form).

http://ellislab.com/expressionengine/user-guide/modules/safecracker/index.html#id3

---
Tags: safecracker, segments, membrr
---


# Question
Title: NSM Config Bootstrap is not overwriting the settings in database.php
This is starting to make me tear my hair out. I've worked with NSM config bootstrap (http://ee-garage.com/nsm-config-bootstrap) on several sites now. It enables you to set your database connection details in the bootstrap file, which should override database.php, and they change depending on which server environment you're looking at. The issue I'm having is that changing my connection settings in the bootstrap file isn't overwriting the settings in database.php, so I'm getting connection errors on either the local or the stage, depending on what I put in database.php. My file structure is:

```
system
    expressionengine
        config
            config.php
            database.php
            config_bootstrap.php

```

At the bottom of config.php and database.php I have this line:

```
require_once(realpath(dirname(__FILE__) . '/config_bootstrap.php'));

```

The relevant part of my bootstrap file looks like this:

```
// Define the environment settings

$env_config = array();
$env_db_config = array();
$env_global_vars = array();

// Set the environmental config and global vars
if (NSM_ENV == 'local') {
    $env_db_config = array(
        'hostname' => 'localhost',
        'database' => 'database',
        'username' => 'username',
        'password' => 'password',
    );
    $env_global_vars = array(
        'global:cm_subscriber_list_slug' => ''
    );
}
elseif(NSM_ENV == 'staging') {
    $env_db_config = array(
        'hostname' => 'localhost',
        'database' => 'database',
        'username' => 'username',
        'password' => 'password',
    );

    $env_global_vars = array(
        'global:cm_subscriber_list_slug' => ''
    );

    $env_config = array(
        'webmaster_email' => 'webmaster@' . NSM_SERVER_NAME,
        'webmaster_name' => 'Webmaster',
    );
}
else {
    $env_db_config = array(
        'hostname' => '',
        'database' => '',
        'username' => '',
        'password' => '',
    );
    $env_global_vars = array(
        'global:cm_subscriber_list_slug' => '',
        'global:google_analytics_key' => 'XX-XXXX'
    );
}

```

I know the bootstrap file is being included, as it's also setting things like my template directory and file upload paths etc correctly, it appears that it's just the database settings that it's not overriding. I thought it may be permissions, but database and config files are 666, so it should be ok.

Please let me know what other information I need to include if this isn't enough.

# Answer
> 0 votes
Ok, problem solved. I don't understand WHY this fixes it though so if anyone could comment on that, much appreciated.

My config.php and database.php files have this at the bottom of them:

```
require_once(realpath(dirname(__FILE__) . '/config_bootstrap.php'));

```

Change it to:

```
require(realpath(dirname(__FILE__) . '/config_bootstrap.php'));

```

And it all works as it should. It doesn't seem to matter if config.php is require or require\_once, but database.php has to be require.

---
Tags: database, bootstrap, config
---


# Question
Title: Why settings in my config.php aren't overriding settings in the CP
It's my understanding that settings in the config.php override any settings in the control panel.

Background: I have copied a site over so it runs from another domain (with the view of closing down the original site). I want both sites to use the same database so they display the same content but change the site's general configs and paths. If I changed paths (like theme path) in the control panel then that seems to affect the other site as I think these setting are stored in the DB.

Thanks

# Answer
It's working. I was partly confused by the site\_name which wasn't changing. Apparently, it's a known bug so I have downloaded this add-on to deal with that specific problem of site\_name: devot-ee.com/add-ons/override\_site\_name –
> 1 votes

---
Tags: database, config
---


title: Assets and relative file paths

text:
# Question
Title: Assets and relative file paths
I have an assets field type in a matrix cell. To place this on my page I am using

```
<img src="{cell_1}">

```

which gives the full url

```
<img src="http://www.mysite.com/images/image.jpeg">

```

That is great but is going to ping up as an insecure element on https pages. How would I get this on my page with a relative path to avoid that issue? I know I can use filename but hardcoding the path in the template isnt really an option.

# Answer
> 2 votes
Have you tried this:

```
{assets_cell}
<img src="/images/{filename}" />
{/assets_cell}

```

That'll need to be in the channel entries tag, in your Matrix tag. The full list of variables is under "Primary Tag Pair" in our Assets docs. So you can build your paths "a la carte" if needed. :)

# Answer
> 0 votes
not sure I know what you mean. Are you suggesting adding a new field in my matrix and writing that code in it?

oh I get it now. The problem is that I am not always going to know the path so wouldn't want to hard code it in the template.

Sorry scratch that, I didn't see the comment posted by Andris tucked away there :(

That was totally the problem, cheers Andris.

---
Tags: assets
---


# Question
Title: Publish layouts for channel entries, not just channel groups
I have a project that requires a lot of individual fields specific to a page. I am looking to use a single field group, and hide unwanted fields from a client so they can edit a section on the one page rather than editing individual channel entries. From what I can tell, there are a couple of addons to go about this:

* **Entry Layout** \- Which looks like it hasn't been updated in a long time, and on installation I'm getting this error (same as another):

```
Class Entrylayout_ext does not exist in (ext.entrylayout.php)
Filename: cp/addons_extensions.php
Line Number: 107

```
* **Content Elements** \- probably wouldn't work, with fieldtypes limited to their own (matrix is required)
* **Blueprints** \- probably best candidate, but it's unclear if you can set fields on an individual entry basis. I would also like to lock the fields once set so they don't go screwing things up.

Each method has it's ups and downs. Any thought's on my best approach? Entry Layout feels like it would be the easiest fit but unfortunately it looks like it's dead.

What to do, what to do!?

# Answer
This bug in Entry Layout has just been fixed, download the latest release :

https://github.com/dukt/addon.eecms.entry-layout/archive/master.zip
> 1 votes

# Answer
You might want to look at the **Entry Type addon**.

It allows you to set up a dropdown that shows/hides fields as needed.

Your dropdown can be your page name, when selected only the fields assigned to show with that dropdown selection will show.
> 1 votes

---
Tags: add-on, custom-fields, publish-layout
---


# Question
Title: ACT ids are getting indexed by search engines. How can I prevent that?
I am using a module (AdMan) that generates an ACTION ID url before routing to a new page. I am finding that Google is indexing these ACT urls and even promoting them above the actual page they link to.

How can I block search engines from indexing ACT urls?

# Answer
You could probably write a .htaccess rule which 301s any URL with a certain ACT ID to a corresponding URL without. Here's an example.
> 2 votes

---
Tags: action
---


# Question
Title: Getting specific code into the <head> section from within channel entries
I edit an old, large EE1 site with lots of weblog articles, some containing flash content. We want to change that content into HTML5/css/java but that requires specific code to get into the head section on a post by post basis and I can't figure out how to do it. Is it possible?

The basic template has an embedded 'head' section and a channel entry loop with some custom fields.

I see how to get the 'title' into the head by passing it through the 'embed' tag. I tried to add a second embed that referred to a custom field from the channel but the content doesn't get passed, only the name of the custom field.

```
{exp:weblog:entries weblog="modules" orderby="date" sort="desc" limit="1" disable="member_data|trackbacks|pagination|categories|custom_fields"} embed="site_embeds/html_head" my_page_title="{title}" special_head_code="{special_head}"}{/exp:weblog:entries}

```

Can anyone help me find a solution?

# Answer
You have to remove "custom\_fields" from your `disable="member_data|trackbacks|pagination|categories|custom_fields"` parameter. This is telling EE not to process custom fields which is why the custom field name is printing out and not the data you are expecting.

Once you remove this, your code will work as expected.
> 1 votes

# Answer
Ah, if you put javascript or html with quotes inside a parameter, the problem is nested quotes

```
// {var="oops "nested" quotes"}
   {var='this "works" ... '}

```

Try to surround the parameter with 'single quotes'. This always has been a bit problematic and fragile. If a user then enters single quotes in a field, then the nested quotes problem will show up again. A plugin (stash, or your own custom) is able to store tagdata, and probably is the only way to do this in a safe way.
> 0 votes

---
Tags: embeds
---


title: Add to cart without submit button?

text:
# Question
Title: Add to cart without submit button?
In Store is there a tag I can use to add a product (no product options) to the cart, simply by loading the product page? That is, there is no add to cart submit button that needs clicking.

This would be the Cartthrob equivalent http://cartthrob.com/docs/tags\_detail/add\_to\_cart/index.html

Best wishes Lee

# Answer
> 2 votes
The equivalent in Store would be to use AJAX to POST directly to our action URL. You can simply add the standard product tag/form to your page, then use javascript to call `$("#productform").submit()`.

There isn't any way to add an item directly to the cart using a GET request, since GET requests should never be used to change the state of a system (because they could be easily triggered by malicious sites using simple hidden image tags etc).

---
Tags: expresso-store
---


title: Required Product Modifier Field

text:
# Question
Title: Required Product Modifier Field
Can anyone give me a suggestion on how to make a Product Text Modifier required in Store. I know this option is available for the Checkout Tag with the "Required" parameter, but not for the Product Tag.

I have a number of text modifiers that need to be filled out before the customer can add the item to their cart. Is there a better way of doing this in Store instead of having to write Javascript code to test the fields.

EE 2.5.5 Store 1.6.2

thanks, Shannon

# Answer
> 3 votes
There isn't any server-side error handling on the add to cart form, so there isn't any way to make text modifiers required (aside from the fact that modifiers normally vary from product to product, which would make it hard to specify in the template).

The best and easiest way to do this is using Javascript, as you suggested. A simple form submit function would be enough, though if you want you could get really fancy with your form validation/error handling.

```
$("#submitbtn").click(function() {
    if ($("#textfield").val() === "") {
        alert("Please enter a value!");
        return false;
    }
});

```

---
Tags: expresso-store
---


# Question
Title: Can I use freemember to display member profile in normal site template
Can I use freemember to display member profile in normal site template? I just want to display the current logged in users details, shipping address etc, and on another page have them be able to edit.

How do I do this?

/// In response to Adrian/// UPDATE I tried that but its not parsing anything through the member fields (the email etc are ok) but they are global variables. what is not parsing is the custom fields. I have tried putting the billing address directly into the memebrs profile from the backend, but it is still not showing up on the members details page.

```
{exp:freemember:members member_id="CURRENT_USER"}

      <h5 class="title">My Account</h5>
      Name: <strong>{screen_name}</strong><br>
      Email: <a href="mailto:#">{email}</a><br>
      Member since: {join_date format="%d %M %Y"}
      <div>

      <p>{username}: {email}</p>
        {billing_address}
                    {billing_address_1}
   {billing_address_2}
      {/exp:freemember:members}

```

What am I doing wrong?

Also this is my update form which I can seem to get working either-

```
**{exp:freemember:update_profile return="/decorate/myaccount" form_id="update_profile" form_name="update_profile"}

<p>
    <label for="email">Email</label><br />
    {field:email}<br />
    {error:email}
</p>

<p>
    <label for="screen_name">Screen Name</label><br />
    {field:screen_name}<br />
    {error:screen_name}
</p>
<div class="control-group">
    <label class="control-label">Billing Address</label>
    <div class="controls">
        <input type="text" name="billing_address" value="{billing_address}" class="span11" />
        <span class="help-block">{error:billing_address}</span>
    </div>
</div>

<p>
    <label for="current_password">Current Password</label><br />
    {field:current_password}<br />
    {error:current_password}
</p>

<p>
    <input type="submit" value="Update Profile" />
    <a href="{path='account/register'}">Create Account</a>
</p>
{/exp:freemember:update_profile}**

```

It will update the uesrname and email, but not this billing address.

# Answer
It sounds like you're looking for the FreeMember members tag.

You can display the current user's profile like this:

```
{exp:freemember:members member_id="CURRENT_USER"}
    <!-- member fields -->
{/exp:freemember:members}

```

Then to update the current member's profile, use the update profile tag:

```
{exp:freemember:update_profile}
    <!-- member fields -->
{/exp:freemember:update_profile}

```
> 1 votes

---
Tags: freemember
---


# Question
Title: Using selected playa value as SafeCracker dynamic_title
i have a very advanced question. I'm building a website where multiple administrators need to edit content. Because of the relationships between these content items and the fact that i want the flexibility to add some tricks in the future i'm using safecracker as main means for adding content.

This way the editors have a good overview that the content they add is in te right place (relationship to other items).

I have one channel setup for adding VIDEOS and each video has a relationship with 1 event and 1 speaker (other channels).I want the title of each video to be "NAME EVENT - NAME SPEAKER".

# SOLUTION WHEN USING THE RELATIONSHIP FIELD

When i use the relationship field and give SafeCracker the folowing parameter

> dynamic\_title="\[name\_event\_field\] - \[name\_speaker\_field\]"

It stores the video entry with the entry\_ids as title. And example title would be "4 - 10" where 4 and 10 are the entry numbers of the selected event and speaker. I solved this by adding a hidden TITLE field and running the following JS.

> $("select\[name=video\_sui\_editie\]").change(function () {
> var str = $("select\[name=video\_sui\_editie\] option:selected").text() + " - " + $("select\[name=video\_spreker\] option:selected").text();
> $("#title").val(str);
> })

Dirty but works like a charm.

# PROBLEM

The relationship field isn't as handy to use as playa and since I would really like to use PLAYA while building the site i'm kinda stuck. The JS interface playa creates is pretty complex and i can't seem to find a point i can hook onto like the piece of JS i used before.

When I give SafeCracker the following parameter

> dynamic\_title="\[name\_of\_playa\_event\_field\] - \[name\_of\_playa\_speaker\_field\]"

The title of the stored entry gets is "\[name\_of\_playa\_event\_field\] - \[name\_of\_playa\_speaker\_field\]". So playa and the dynamic\_title parameter of SafeCracker are not compatible.

# Question

Does anyone have a way to use the value of the selected playa field as title when adding an entry to ExpressionEngine via SafeCracker?

# Answer
> 0 votes
The USE of TITLE MASTER (http://devot-ee.com/add-ons/title-master) solved this problem. I really like this add-on, it makes using safecracker while maintaining nice and consistant title's and url's a breeze.

# Answer
> 0 votes
Your easiest route here will be to use Title Master. It can automatically populate the title field with Playa fields, and has the bonus of working with both Safecracker and in the control panel.

Just configure the module for your Videos channel and you're done. (You may have to pass a dummy title to Safecracker via a hidden input so it\[asses initial validation.)

---
Tags: safecracker, playa, relationships
---


# Question
Title: Running ExpressionEngine on Apache behind nginx?
I have a Debian 6 32-bit Linode where I’m trying to run EE2.5.5 in Apache2 on port 8080 behind nginx0.7. The idea is to serve PHP code from Apache, and everything else from nginx. (Based on http://hybridlogic.co.uk/2011/07/setting-up-nginx-in-front-of-apache2-on-ubuntu-server/)

The outputs below (sitename replaced by “website”) show more or less what has been configured. So far image uploading and editing works with the settings:

```
Server Path to Upload Directory: /srv/www/website/static_content/
URL of Upload Directory: http://www.website/

```

Any feedback on the security, viability and any hidden gotchas with this setup? I disabled the built-in Rich Text Editor because it tried to directly open static files that I had moved out of the PHP tree.

Thanks!

```
root@phoenix:/var/www/website# ls
logs php_content static_content
root@phoenix:/var/www/website# ls static_content/
images themes system
root@phoenix:/var/www/website# ls php_content/
admin.php index.php setperm.sh system themes
root@phoenix:/var/www/website# cat /etc/nginx/sites-available/website
server {
      listen 80;
      access_log /srv/www/website/logs/nginx.access.log;
      error_log /srv/www/website/logs/nginx.error.log;
      root /srv/www/website/static_content;
      index index.php index.html;
      server_name website;
      rewrite ^/$ http://www.website/index.php;
      location \ {
          try_files $uri $uri/ index.php/$uri;
      }
      location ~* ^.*\.php\b {
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $host;
          proxy_pass http://127.0.0.1:8080;
      }
      location ~ /\.(ht|git) {
          deny all;
      }
}
root@phoenix:/var/www/website# cat /etc/apache2/sites-available/website
<VirtualHost *:8080>
    ServerAdmin webmaster@website
    ServerName website
    ServerAlias http://www.website
    DocumentRoot /srv/www/website/php_content/
    ErrorLog /srv/www/website/logs/error.log
    CustomLog /srv/www/website/logs/access.log combined
</VirtualHost>
root@phoenix:/var/www/website#

```

# Answer
> 3 votes
We have run exactly this setup for the past 3 years without issue. You shouldn't have any particular problems, security or otherwise.

The only issue is the added complexity - we do it because we use nginx to terminate all inbound http connections (mainly SSL on a wildcard certificate) and then proxy them out to either Apache on the same server or multiple other servers running whatever, nginx also dabbles in a bit of caching. So I would argue we have a good reason for this setup.

I'd argue that serving static files from nginx and dynamic from Apache for performance reasons adds virtually nothing to the overall performance of the site; sure nginx is faster, but it's not that much faster. I'd suggest you either server the whole thing out of nginx using FastCGI or ditching nginx and as has been suggested use Varnish - see http://www.kevincupp.com/2011/05/22/marking-ee-sites-fly-with-varnish.html for an excellent guide.

# Answer
> 3 votes
I haven't tested any of these yet. I collected them, when preparing for a potential project on Nginx, but the project fell through. But here are the links:

Really, the only one that references security issues is the one Greg Aker pointed me to, which is the Nginx & PHP via FastCGI Important Security Issues on Clement Nedelcu's Journal. He mentions a few issues with the default set-up of Nginx, so the issues would be pretty much universal and effect EE on Nginx, as well. Since the security issues would be more directly related to Nginx or PHP, you may also want to look at: Top 20 Nginx WebServer Best Security Practices.

Sorry, that I can't offer any direct experience.

---
Tags: apache
---


# Question
Title: Problem with pagination links and conditional
I have a single template I'm using to display a list of audio files. When the user clicks on the audio they want to listen to, it uses a conditional statement to display the single entry in the same template. I'm using:

```
{if segment_2 == ""} then show list of files, and paginate
{if segment_2 != ""} then show single entry

```

The problem occurs when you click the pagination link to go to the next page in the list and EE adds a segment 2 to the url (i.e. P2, P3, etc.). Because of that, the conditional is met, and rather than displaying the next page in the list, it displays the next single entry. I'm looking for a way around this.

# Answer
I know you asked for a non third party solution but, currently, native solutions are problematic from a performance point of view, mainly due to the way native complex conditionals work in EE and because you have to deal with pagination.

My favourite solution involves using Switchee (free):

```
{exp:switchee variable = "{segment_2}" parse="inward"}
  {case value="#^P(\d+)$#|''|category"}
    ... list page ...
  {/case}

  {case default="yes"}
    ... detail page ...
  {/case}
{/exp:switchee}

```

There is an article dedicated to the "issue" on EEInsider
> 1 votes

# Answer
Create a new template in the same group called "view". Its another template for sure but if you don't want to add an extension your choices are limited. Breaking your "one template does all" but the cost is negligible assuming your using snippets or globals to make up your html head/footer content.
> 0 votes

# Answer
Is segment 2 the url title of the single entry? If so, could the reverse of your conditional work?

```
{if segment_2 == url_title}
    display just single item (likely with url title param in the entries loop)
{if:else}
    display list
{/if}

```

I'm not certain if this would work, but I thought I'd mention it as a different way you could try expressing your conditional. This adds complexity to the conditional, however, and so introduces more performance weight than @jerome-coupe's suggestion, which is probably how I would handle it unless native is absolutely necessary to your situation. Switchee is a terrific way to parse the conditional more simply with case logic and it has the benefit of being able to detect pagination with regex as he mentioned.
> 0 votes

---
Tags: conditionals, pagination
---


# Question
Title: Adding custom errors inside safecracker_submit_entry_end hook
I'm doing some post-processing after a Safecracker form has been submitted. During my post-processing if I want to encounter an error, I'd like to set one and have it show up as an error when the page reloads. I would assume you can do this somehow using the $safecracker object you have use of inside the hook, I'm just not sure how.

Any help or insight would be appreciated

Thanks!

# Answer
> 2 votes
Sure. First, you probably want to use `safecracker_submit_entry_start`. If you use `safecracker_submit_entry_end`, the entry will already be in the database, which presumably you want to avoid if your custom error conditions are met.

Setup your extension to use the `safecracker_submit_entry_start` hook (you can use pkg.io for a quick start), and have it call a method of the same name in your extension.

Then, pass the Safecracker object by reference so you can modify it in the parent context rather than locally.

```
function safecracker_submit_entry_start(&$safecracker)
{
    // do some stuff
    $safecracker['errors'][] = 'You didn't pass my special tests.';
}

```

That should be it.

---
Tags: safecracker
---


# Question
Title: Assets modal window in publish form is blank when I click Add Files
Doing some testing on a local version of a website, trying to implement an Assets upload field in a Matrix column. When in the publish form and I click the "Add Files" button the modal pops up but it is blank. I do get a console error in Chrome dev tools...

=========================================

XMLHttpRequest cannot load http://condley-intranet.dev/. Origin http://condley-banking.dev is not allowed by Access-Control-Allow-Origin.

Uncaught TypeError: Cannot set property 'innerHTML' of undefined assets.min.js:8

qq.FileUploader assets.min.js:8

Assets.FileManager.Garnish.Base.extend.init assets.min.js:8

Garnish.Base.a.extend.constructor garnish-0.1.min.js:18

h.constructor garnish-0.1.min.js:14

h.constructor garnish-0.1.min.js:14

(anonymous function) assets.min.js:8

d jquery.js:39

b.extend.each jquery.js:37

b.fn.b.each jquery.js:30

c.ajax.complete jquery.js:161

p jquery.js:43

l.fireWith jquery.js:44

d jquery.js:167

b jquery.js:178

=========================================

I'm using the Assets/Matrix combo on a MSM site. The "main" site is "condley-banking.dev". The MSM site is "condley-intranet.dev". I'm logged in to the CP through the "condley-banking.dev" site and then selected the MSM site from the CP dropdown. I thought this info might help after reading the error, but it's al lover my head. Thanks for any information!

# Answer
I had not "Updated Indexes" in the plugin CP. Afte that things worked fine.
> 2 votes

# Answer
Your JS forms look like they're attempting a cross-domain communication:

> HTMLHttpRequest cannot load http://condley-intranet.dev/. Origin http://condley-banking.dev is not allowed by Access-Control-Allow-Origin.

Are you able to locate where you're crossing domains and make them consistent? I'd start with your General Config and/or /system/expressionengine/config/
> 3 votes

---
Tags: assets, matrix, modal
---


# Question
Title: Entry date field not showing up correctly
```
<h7>{entry_date format="%F %m %Y"}</h7>

```

This is the code I have for my entries, I want to display the date as to when content was posted. I have 2 videos up right now, their actual dates are Feb 17th and Feb 25th. However with the above code, they both show up on my website as Feb 2nd. So its not a Daylight Savings Time (DST) issue.

I even tried to change entry in the code above to edit and I had the same results. Anyone have an idea of something I can try to get it to display the correct date of entry? Thanks in advance, I appreciate it!

# Answer
Your first 2 tokens are both month tokens. Essentially you're outputting "February February 2013".

Try `%F %j %Y` or `%F %d %Y` instead. (See PHP date formatting tokens.)
> 4 votes

---
Tags: ee2, date, tags, entries
---


title: Securing the control panel with SSL

text:
# Question
Title: Securing the control panel with SSL
I'm in the process of securing my control panel with SSL using the following rewrite rules

```
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond $1 ^(member|system) [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

```

I'd prefer not to secure the frontend of my website as well, however if an admin visits the frontend of the website over unsecured http while logged in, will this open them up to session sidejacking? If so is there a way around this? Should I be worried?

# Answer
> 2 votes
Really good question. I suppose it could open you up to session sidejacking.

There's a couple of potential solutions I can think of without doing any research or prototyping.

1. If the website is managed by a business, you could make your HTACCESS file only allow access to the control panel for certain IP addresses (yours and their offices). Alongside this, you could make it so that if they are on a (let's call it..) trusted IP all of their browsing is done via HTTPS.
2. You could potentially make it so that if a user is logged in it automatically redirects them to a https version of the page. However, this may be too late and you do risk there being 2 versions of the same page (http and https). Not so great.
3. Perhaps you can move the control panel to a subdomain; such as admin.sitename.com - that way the sessions should be different anyway. I think this is my preferred method.

Let me know how you get in.

---
Tags: control-panel, security, sessions, ssl
---


title: Why is the Server Path not Valid?

text:
# Question
Title: Why is the Server Path not Valid?
I am hosting a client site on HostGator running Plesk. I got the server path from their documentation and confirmed it with tech support, however, when I enter the server path in the necessary locations (Captcha, Templates, etc.) I get the following error:

> The following path you submitted is not valid

The path I have entered is:

> /var/www/vhosts/web.clientname.com/domain/themes/

Is there anyone with experience on HostGator Plesk that can provide insight into why I get the error? And more importantly, how to resolve it?

Thanks.

# Answer
> 5 votes
Upload a file called `test.php` in their respective folders with the following code:-

```
<?php
   echo $_SERVER['DOCUMENT_ROOT'];
?>

```

Then open those files in your browser and see what the echo'd path is. That should be the thing you set.

# Answer
> 1 votes
I have no experience with HostGator, but perhaps it's `/var/www/vhosts/web.clientname.com/domain/public_html/themes/` or `/var/www/vhosts/web.clientname.com/domain/htdocs/themes/`

---
Tags: server, path, captcha
---


# Question
Title: Login problem with Safari on single machine
I'm having the strangest problem.

I have ExpressionEngine 2.5.2 site using Zoo Visitor to manage my members. I have multiple accounts setup so i can test the site from different member ship groups.

From my machine Mac 10.8.2 with Safari 6.0.2 everything works fine. I can login/logout on both frontend and control panel in both Safari, FF and Chrome. My client with the exact same software versions however can't.

His machine refuses to login while using safari, firefox shows none of these problems. On the frontend i'm able to login when a select the auto\_login function. But without selecting that, no dice.

On the backend I have the same problem, until i switch the admin\_session\_type to cookie only. And then i'm only able to login when i select the auto\_login function.

This however isn't a solution because i want to be running the backend using admin\_session\_type Session ID + Cookies.

# This i've already tried

* Removing securit:ee
* Security and Session Preferences -\> Require IP Address and User Agent for Login?
* Security and Session Preferences -\> Allow multiple log-ins from a single account?
* Checking apache/php logs and error logs

Does any of you have a clue in what direction i should be looking?

# Answer
> 1 votes
The problem was found by the client when he tried to login to mailchimp. Their system warned him that his SYSTEM CLOCK was set into the future. After adjusting this all problems disappeared.

So not to self: in case of strange login behavior check the system clock and date.

# Answer
> 0 votes
I have had this issue too. it looks as if it starts to happen when you are auto logged out when your session expires. http://ellislab.com/forums/viewthread/102628/

http://ellislab.com/forums/viewthread/233088/

http://ellislab.com/forums/viewthread/219020/#1038039

---
Tags: control-panel, login
---


title: Multi-page Safecracker forms

text:
# Question
Title: Multi-page Safecracker forms
I'm working on a project where new members will create a channel entry using Safecracker. I have something in place but have decided I'd like to break the form up into multiple pages to better walk them through things.

I've seen this post at Ellislab forums, http://ellislab.com/forums/viewthread/166104/, and it looks to be workable.

What I'd like to do is create pages with 4-5 fields each, and have the form saved when moving to the next page, where they'd just edit the next set of fields, through to the last page where the form is saved again.

In theory, this means that I can link back to a page if they need to redo something and they would just be re-editing those fields.

Am I off-base on this? I haven't set up Safecracker this way before.

# Answer
According to the docs the `ENTRY_ID` constant still exists and is what Rob is referring to in his reply:

http://ellislab.com/expressionengine/user-guide/modules/safecracker/index.html#return

Not positive though, one thing you may need to watch out for is required custom fields on the EE (and Safecraker) side of things. You could implement something on the frontend ala html5 and one of the jQuery form plugins instead.

With that said, my answer would be to just try it :)
> 4 votes

# Answer
As an alternative, you might want to try something like what I set up on **this form**.

It's a multi-step form process without having to split the form over multiple pages. Sections are shown or hidden with jQuery.
> 1 votes

---
Tags: safecracker, forms
---


# Question
Title: Safecracker File Fields only uploads the first one
I'm trying to use multiple Safecracker File fields in a Safecracker form.

I tried to use one matrix field with one column - the SC File field. On submission, no rows or files were added.

I thought it would be easier to take Matrix out of the equation so I changed it to 3 separate SC File fields. Now only the first field gets uploaded. I don't see any errors (tried logged in as Super Admin and Non-Super Admin)

My template code is very simple.

```
{exp:safecracker ...}
  {custom_fields}
    {if safecracker_file}
      {display_field}
    {/if}
  {/custom_fields}
{/exp:safecracker}

```

The fields are output correctly, each have unique names.
The following is what is output for each field:

```
<div class="safecracker_file_set">
  <div class="safecracker_file_hidden">
    <input type="hidden" name="CUSTOM_FIELD_NAME_3_hidden" value="">
  </div>
  <div class="safecracker_file_placeholder_input">
    <input type="hidden" name="CUSTOM_FIELD_NAME" value="NULL">
  </div>
  <div class="safecracker_file_input">
    <input type="file" name="CUSTOM_FIELD_NAME" value="">
  </div>
</div>

```

Running 2.5.3, but I don't see anything in the changelog that directly mentions something like this. I'd *realllllly* like to avoid upgrading.

# Answer
> 1 votes
My custom fields were named as `_x` with underscores:

`{attachment}`, `{attachment_2}`, `{attachment_3}`

Removing the underscores fixed the problem:

`{attachment}`, `{attachment2}`, `{attachment3}`.

This was verified by EllisLab as a bug and a bug report has been filed.

# Answer
> 0 votes
FWIW, I have a similar setup that is working correctly, but it's on a 2.5.2 install. Code is identical to yours - is it possible there's a js conflict?

---
Tags: safecracker, file-uploads, safecracker-file
---


# Question
Title: {comment_total} Counts Remain After Deleting Comments
I just updated a site from EE1 to EE2 that had pretty much nothing but spam comments. I deleted all the comments with a query:

```
DELETE FROM exp_comments WHERE status = 'o';

```

But on the blog listing page, the `{comment_total}` tag is still showing that comments exist. For example:

```
<a href="{path='blog/post'}">{comment_total} Comment(s) »</a>

```

Returns

> 4 Comments »

Even though there are no comments in the database for that entry.

I also went into the `exp_channels` table and set the `total_comments` column to 0 for the blog channel.

When I upgraded from EE1 to 2, I opted to convert trackbacks to comments, could that be what's causing the phantom comments? There's no `exp_trackbacks` table anymore, so I'm not sure where they might be hiding.

I guess ultimately what I need to know is where does EE get its `comment_total` count from?

# Answer
Have you tried CP \> Tools \> Data \> Recount Statistics?
> 4 votes

# Answer
Total comments are actually stored in the `exp_channel_titles` data table, so you would either need to use the `Recount Statistics` Tool, as @Ryan Masuga suggested or set the `comment_total` field in `exp_channel_titles` equal to zero, using a MySQL query. The **Recount Statistics** tool is the easiest method, unless you don't want all comment numbers to be reset.
> 2 votes

# Answer
It's possible the page is cached so it's worth **clearing the cache** to eliminate that as the issue.

**CP Location:** Tools ‣ Data ‣ Clear Caching
> 1 votes

---
Tags: upgrade, comments
---


title: display an excerpt of a channel field

text:
# Question
Title: display an excerpt of a channel field
I have a channel field that is a description of an audio file. I want to list that entire field on the actual page for the selected audio. On the main listing of all the audio files, I'd like to have only an excerpt of that field, giving the user some idea of what the audio is about, but not the entire field. I would like the excerpt to end with elipses, indicating that there is more to be read by clicking the link.

I know I can accomplish this by having multiple channel fields, but I am sure there's a way to do it with just the one field, I'm just unaware of what it is, and I can't seem to locate anything in the user guide.

I'd appreciate any help you can provide. thanks!

(by the way, I love this community! One day I hope to be knowledgeable enough to contribute, and not just consume.)

# Answer
> 4 votes
An add-on I've used for this purpose is David Dexter's Snippet. Does just what you're looking for. Keep in mind however that if your full description is a RTE field, you may have to use an HTML stripper before using the shortening tool.

# Answer
> 6 votes
Hacksaw is also a great plugin for that. It has a few more options than Snippet, like the ability to omit HTML tags and more refined cutoff parameters.

# Answer
> 2 votes
You can also just use the 'Word Limiter' plugin by Rick Ellis of Ellis Labs. I believe it comes with the basic install.

```
{exp:word_limit total="50"}{audio_summary}{/exp:word_limit} …

```

I frequently use with a 'strip HTML tags' plugin, to do this. Personally, I like when people write an actually summary, but there's plenty of time when the first 25, 50, or 100 words is just fine as a teaser.

---
Tags: channel-entries, fields
---


# Question
Title: Front end login error - "not authorised to perform this action"
**The Problem:** When trying to login via the front-end as a member, the error "you are not authorised to perform this action" appears. The url for the error page is that of another MSM site. If I go to original site, I am logged in as that user.

**My Setup:** \- EE version 5.5.2 \- Multisite Manager

* Require IP Address : NO
* User Agent for Login : NO
* Secure Forms: NO
* Deny Duplicate Data: NO
* Sessions are using cookies only

Blacklist module: not installed Securitee - Installed but with minimal settings active.

**I have tried the following to no avail:**

1. Logging in via default EE member templates and via template created with Freemember.
2. Removed "Freemember" and "User"
3. Tried from different device and different IP Address
4. Tried disabling all extensions using config.php
5. Tried removing my htaccess
6. Clearing site cache, and browser cache
7. Creating new members,
8. Signing onto front end as superadmin

I noticed in my config.php I have a token for $config\['XID'\] = Should this be there? I have read that this can cause such issues.

Please help - Im not sure what to try next.

I went onto Site3 Front end and I created a user in the Members group. When I login from the front end of either Site1 or Site2, it all works okay, (even thought I signed up as a member to Site3.) But it wont let me login nicely to Site3! The url is redirecting to Site1 first saying im not authorised.

# Answer
You can sift through the database and check the member group permissions.

\*exp\_member\_groups\* will store general access settings per site. \*exp\_channel\_member\_groups\* stores a relationship to each channel and member group.

My guess is you'll find something goofed up in the member\_groups table.
> 1 votes

---
Tags: members, multi-site-manager, login
---


# Question
Title: Is this complex category filtering possible in Low Search?
I have a collection/channel of products, where each product belongs to multiple categories. I have two category groups: `product` and `collection`. Example `product` categories include 'shirts' and 'hats'. Example `collection` categories include 'blue' and 'on sale'. `collection` categories can be thought of as children of `product` categories, though in the EE backend, their category groups are siblings.

I have a form that lets you input a keyword to search by, and then a tree of the `product` and `collection` categories.

I have a pseudo-query of what I need to accomplish:

```
SELECT
  products
WHERE
  keyword = 'foo'
AND
(
  ( product_cat = 'shirt' AND ( collection_cat = 'blue' OR collection_cat = 'on sale' ) )
  OR
  ( product_cat = 'hat' AND ( collection_cat = 'blue' ) )
)

```

I know you can search through multiple categories by sending an array of category IDs, but in this case I need to have a parent-child category relationship.

Is this possible?

# Answer
That specific example isn't possible, but you can get pretty close, despite not being able to account for the quasi-relationship between category groups you've defined.

With Low Search, you can do the equivalent of this:

```
SELECT * FROM entries
WHERE keyword = 'foo'
AND (product_cat = 'shirt' OR product_cat = 'hat')
AND (collection_cat = 'blue' OR collection_cat = 'on sale')

```

..which is the same as:

```
SELECT * FROM entries
WHERE keyword = 'foo'
AND product_cat IN ('shirt', 'hat')
AND collection_cat IN ('blue', 'on sale')

```

...thus also searching for hats on sale.
> 1 votes

---
Tags: low-search
---


# Question
Title: CP access: admin.php or system/index.php
A site that I built last autumn had the CP url set as system/index.php (I think I was following Ryan Irelan’s advice in that regard). It works fine. However, last night I did a quick install of EE Core and the bit of the installation wizard specifying ‘URL to your control panel access file’ pre-filled itself with admin.php. Either method seems to work (provided I appropriately specify the $config\['cp\_url'\] parameter in my config.php file) but I am left wondering which is the ‘correct’ way? mydomain.com/system/index.php or my domain.com/admin.php? And is one way more secure than the other?

# Answer
It's not that using `admin.php` is a security benefit in itself, it's that it allows you to move your entire `/system` folder outside of the web root. If you don't take that step then you will see no benefits whatsoever. In fact, if you leave both `admin.php` and `/system` in your `public_html` folder (or equivalent) that's arguably detrimental to security, as you've got two separate CP logins for people to stumble across rather than one.

**Why move your system folder out of the web root?**

It's a bit like living in an underground bunker rather than a normal house. Instead of having a ton of doors and windows for someone to throw a rock through you've just got the one. If there's an XSS exploit for `system/expressionengine/third_party/dodgy_addon/mcp.dodgy_addon.php` you aren't vulnerable to it as that file isn't publicly accessible. Any successful hack has to be routed through `admin.php`\*.

**Should I always move the system folder out of the web root?**

Ideally yes, but you won't always have a choice over server environments or deployment practices, and sometimes it might not be feasible. So long as `/system` has been renamed it probably isn't worth losing sleep over, but if you have the option it's always worth doing.

<sub>* Short of server-level exploits which are really a separate issue.</sub>
> 11 votes

# Answer
I believe the main and immediate advantage to using admin.php, wether you move the system folder above root or not, is that it hides the name of the system directory from http request logs. So if you have renamed your system folder (for security reasons), your browser is only making requests to admin.php, not **secret\_system\_folder**/index.php.

It's the same reason why when you click the name of your site in the upper right corner of the control panel, you're taken to http://example.com/index.php?URL=http://example.com. I believe this is to mask the referrer URL in server logs from recording your system folder.
> 5 votes

# Answer
You need to use admin.php when using MSM (Multi Site Manager). The system folder is only present in one of the sites so if you want to access the Control Panel from one of the other sites you have to use admin.php.

First site in MSM looks like:

```
/
index.php
admin.php
-System
-Templates
etc

```

Each subsequent site just has:

```
/
index.php
admin.php
-Templates
etc

```

You can access the Control Panel for any site in the MSM from the master (for want of a better term) site via /system/index.php, in which case you don't need admin.php, but if you limit user's access to just one, or rather not all, sites then you will need to provide admin.php as the entry point to the control panel for each site.

EE Security is what you make it - /system/index.php can be secured simply by dropping in an .htaccess file and restricting by IP or something similar. We tend to have our control panels only accessible from within our network and we can achieve this using either file. We also remove everything but the front controller (index.php/admin.php) and static assets from the public web root - but that's the answer to another question :)
> 3 votes

# Answer
I personally never use admin.php. I delete it from installs altogether if I do not move system folder above web root. I do not use it with MSM installs either. The only ones I have got only allow for access via the "main" domain.

One less thing to worry about ;o)

**EDIT:**

That being said, here is a great ebook on securing ExpressionEngine by Mark Huot. Well worth the money/read. If possible, moving your system folder above web root is more secure, as others have indicated.
> 1 votes

# Answer
It depends on your needs. First, when changing the name of your system folder, also change the name of the `admin.php` file, if you plan to use. If not, delete the `admin.php` file.

Our go to set-up for ExpressionEngine installs are to move the system folder **out of** the 'public\_html' folder (aka: html, www, public, etc.) So if your set-up is more like

```
/system
/public_html
   - admin.php

```

Then you want the `admin.php` file.

We do have old set-ups where `/system` is in the `public_html` folder. In those cases we:

1. **Remove 'admin.php' if all control panel users are client's staff**. If everyone with control panel access is also considered a trusted source (staff), then we delete the 'admin.php' file, but…
2. **Establish Multiple Levels of Trust with 'admin.php'.** In these cases, we may provide only sysadmins or designated staff access to the full `system folder` and provided everyone else access via the `admin.php` file. Users of the `admin.php` file, generally wouldn't have ssh or ftp access either, so they NEVER know the name of the system folder.

Our biggest use though is for using `admin.php` when the `system folder` no longer has public access. A good security measure, if you can do it.
> 1 votes

# Answer
I like to have as little in the webroot as is humanly possible.

So i always have the system folder above webroot, and i always rename the admin.php file to something random that obviously the client will have to know as it is their only route in to the admin area.

Of course, those things aside, it is equally as important to make sure that you only use third party add-ons from trusted developers as a poorly written add-on will make all your hard work for nothing if someone can just attack you via the front controller anyway by exploiting a bad add-on.

As well as that, make sure your file permissions are locked down, your php version is kept up to date (i don't mean use php 5.5 or whatever, but just the latest php 5.3.x at the moment) and your server is locked down with a firewall if possible. These things will offer greater protection from nefarious types than just moving and renaming your system folder.
> 0 votes

---
Tags: control-panel, config
---


# Question
Title: Stash set_list not working as expected when used with playa, not outputting data
I'm trying to extract from a list of products in the cart the (playa) related entries (i want the entry\_id's), put them into stash and then i need to use those id's somewhere else to build a "related products" type thing. But as the products in the cart could have the same related entries, i need to make the list it spits out unique. Oh, and there are two playa fields i need to get data from that both have related products but from two different product channels!

So, first we have the setting of the data:

```
{!-- Get the current items in the basket --}
{exp:cartthrob:cart_items_info}
{!-- Check the products we're getting the info from are in the channel that actually has the related product fields --}
{if channel_id == 7}
    {!-- Channel entry loop to get the product data out from the id's the cart_items_info has given us --}
    {exp:channel:entries channel="events" entry_id="{entry_id}" dynamic="off"}
    {!-- First playa related products field--}
        {product_sub_product}
    {!-- Stash using unique name the list of entry_id's from playa --}
            {exp:stash:set_list name="sub_prods" parse_tags="yes"}
    {!-- Stash set name as item_id --}
                {stash:item_id}
                    {entry_id}
                {/stash:item_id}
            {/exp:stash:set_list}
        {/product_sub_product}
    {!-- Second playa related products field--}
    {product_related_races}
    {!-- Stash using unique name the list of entry_id's from playa --}
        {exp:stash:set_list name="rel_races" parse_tags="yes"}
    {!-- Stash set name as item_id --}
            {stash:item_id}
                {entry_id}
            {/stash:item_id}
        {/exp:stash:set_list}
    {/product_related_races}
{/exp:channel:entries}
{/if}
{/exp:cartthrob:cart_items_info}
{!-- End of current items in the basket --}

```

And then we have the getting of the data:

```
{!-- Get the data out from both sets --}
{exp:stash:get_list name="sub_prods" unique="yes"}
    prods - {item_id}<br />
{/exp:stash:get_list}

{exp:stash:get_list name="rel_races" unique="yes"}
    races - {item_id}<br />
{/exp:stash:get_list}

```

What's odd, is that i can see the data in the database so it is all working as expected. But stash get\_list is not outputting the data.

# Answer
Grab the related entry ids in one go like this:

```
{!-- Get the current items in the basket --}
{exp:cartthrob:cart_items_info}
{!-- Check the products we're getting the info from are in the channel that actually has the related product fields --}
{if channel_id == 7}
    {!-- Channel entry loop to get the product data out from the id's the cart_items_info has given us --}
    {exp:channel:entries channel="events" entry_id="{entry_id}" dynamic="off"}

        {!-- Capture a list of entry_ids from the various playa fields --}
        {exp:stash:set_list name="related_prods" parse_tags="yes"}

            {!-- First playa related products field--}
            {product_sub_product}
                {stash:item_id}{entry_id}{/stash:item_id}
                {stash:item_type}sub{/stash:item_type}
            {/product_sub_product}

            {!-- Second playa related products field--}
            {product_related_races}
                {stash:item_id}{entry_id}{/stash:item_id}
                {stash:item_type}related{/stash:item_type}
            {/product_related_races}

        {/exp:stash:set_list}

    {/exp:channel:entries}
{/if}
{/exp:cartthrob:cart_items_info}
{!-- End of current items in the basket --}

```

Use like this to get only unique entries:

```
{exp:stash:get_list name="related_prods" unique="yes"}
    {item_id}<br />
{/exp:stash:get_list}

```

Or just the 'sub' type of entry ids:

```
{exp:stash:get_list name="related_prods" match="#^sub$#" against="item_type"}
    {item_id}<br />
{/exp:stash:get_list}

```
> 1 votes

---
Tags: cartthrob, playa, stash
---


# Question
Title: dynamic multi select options in safecracker form
I am going to be using a safecracker form with zoo-visitor to create membership profiles.

I want to have a field where you choose 1,2,or 3 and if you choose 1 the next field gives you options in a multi select list for 1a if you choose 2, you choose from a list 2a and so on.

Is there anything built in I could use or does it require some custom ajax or is a multi page form the best option?

# Answer
There isn't anything built in, but not too long ago John Henry Donovan did a little write-up on implementing something similar with jquery plugins that might help you.

http://johnhenry.ie/articles/chained-selects-for-expressionengine
> 3 votes

---
Tags: members, zoo-visitor, safecracker-registration
---


# Question
Title: I need help with some strange EE1 behavior
I have an EE1 site I created a few years ago that was chugging along happily until just recently. I had upgraded it to 1.7.3 about a year ago but beyond that there has been very little that was done to the site after it was set free into the wild.

For the most part the site is still working but one embed isn't working as it should. The site is has four groups that users are assigned to, via member groups, and when you login you are sent to the page for your group. Each group is identical in terms of the look and feel as well as what type of content is displayed for each with the exception of one group that has an extra nav item that links them to a discussion forum (EE Forum Module). The site is built with four template groups, one for each group, and an embeds template group (there are a couple other groups but they are irrelevant to this problem) that has all the common code shared amongst them. Each group has an events page that shows past events organized by years and hidden behind tabs (2009, 2010, 2011, etc.). Beneath this is a list of upcoming events for each group (don't ask, I tried to set it up the other way). Both of these past and upcoming event lists are embeds pulled from the embed template group and passed the groups category id.

Here's where things get strange. Three of the four groups show past events while one has suddenly stopped displaying the embed. Period. It's not even parsing it at all from the groups events template. Any idea why this might be happening? Other groups are working fine. Until a few days ago the site was parsing the embed without any problems.

On a semi-related note, I was going to update the site to EE2 and see if I could improve the way the site handled things like the events page but I ran into trouble with that as well. I started an EESE question for this problem but since I'm having trouble there as well I need to tackle this from both sides and see if I can get the site working properly first then worry about upgrading later.

**UPDATE** Template code for the group events page and the previous events list embed (be kind this was one of my first EE sites ever):

ebs/events

```
{if not_logged_in}
    {redirect="/"}
{/if}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    {embed="_embeds/_head"}
    <body id="{segment_1}">
        <div id="page_wrapper">
            {embed="_embeds/_main_nav"}
            {embed="_embeds/_user_nav"}
            <div id="content">
                <!-- Previous Events -->
                {embed="_embeds/_previous_events" cat_id="4"}

                <!-- Upcoming Events -->
                {if segment_3 >= "{current_time format='%Y'}"}
                    {embed="_embeds/_upcoming_events" cat_id="4"}
                {/if}
            </div>
        </div>
        {embed="_embeds/_footer"}
    </body>
</html>

```

\_embeds/\_previous\_events

```
<div class="section">
    <div class="left_column">
        <h2 style="padding-top: 0.5em;">Previous Events:</h2>
    </div>
    <div class="right_column">

        <!-- tabs -->
        <ul class="tabs">
        {exp:weblog:entries weblog="events" orderby="event_start_date" show_expired="yes" category="{embed:cat_id}" show_future_entries="no" status="open" sort="asc" dynamic="off"}
        {if {expiration_date} < {current_time}}
            {date_heading display="yearly"}
                <li><a{if {segment_3} == {year}} class="current"{/if} href="{site_url}{segment_1}/{segment_2}/{year}">{year}</a></li>
            {/date_heading}
        {/if}
        {/exp:weblog:entries}
        </ul>

        <!-- tab panels -->
        <div class="panels">
        {exp:weblog:entries weblog="events" orderby="event_start_date" show_expired="yes" category="{embed:cat_id}" show_future_entries="no" status="open" sort="asc" dynamic="off"}
            {if {expiration_date format="%Y"} == {segment_3} && {expiration_date} < {current_time}}
            <div class="events">
                <div class="event_entry">
                    <h3 class="event_title"><a href="{url_title_path='{segment_1}/event_details'}">{event_topic}</a></h3>
                    <h4 class="event_date">
                        <span class="event_days">{event_start_date format="%F"} {event_start_date format="%j"}{if {event_start_date format="%j"} != {event_end_date format="%j"}}–{event_end_date format="%j"}{/if},</span>
                        <span class="event_year">{event_start_date format="%Y"}</span>
                        <span class="entry_divider">|</span>
                        <em>{event_location}</em>
                    </h4>
                    {event_description}
                </div>
            </div>
            {/if}
            {if no_results}
            <div class="event_entry">
                <p>There have been no events for your group yet. There may be upcoming events listed below.</p>
            </div>
            {/if}
        {/exp:weblog:entries}
        </div>

    </div>
</div>

```

# Answer
I'd suggest further reduction of the previous\_events code. Remove all fields from inside the tag... does it still work? Add a couple lines of code back in at a time until it breaks. Then narrow down to exact the field that is breaking. Most likely it's something in a specific entry. I've seen this before.
> 1 votes

---
Tags: ee1, embeds
---


# Question
Title: Why can I only see "Super Admins" in the Communicate interface?
I am working on a site with several (20+) member groups. The administrator would like to send an email via Tools \> Communicate to one of the member groups. However, only the “Super Admins” under “Member Groups” in the email interface. Why would all the other member groups not be displayed?

# Answer
> 1 votes
I think you want to enable this preference on the Edit Member Group page:

> Allow Members in Site's Mailing Lists and Related Abilities? (i.e. Group Available in Communicate section)

---
Tags: email, groups
---


title: Sorting a table in the front-end

text:
# Question
Title: Sorting a table in the front-end
I'm using the Table class to render a table in my module and I want the user to be able to sort by clicking on column headers. I'm following the docs here, but when I use `set_columns` and `set_data` I get an error from `libraries/EE_Table.php` stating that `EE::$cp` is not defined.

Is it not possible to do sortable tables in the front-end? From the error, I guess it is only possible in the control panel.

# Answer
> 3 votes
EE uses the codeigniter table library .. http://ellislab.com/expressionengine/user-guide/development/cp\_styles/index.html#table-based-layout

The issue you're probably running into is that it's trying to use one of the default CP styles. The library itself should be usable without being in the control panel, though jquery tablesorter may still be a better choice.

---
Tags: add-on-development, table
---


title: Question Mark (?) symbol in URLs

text:
# Question
Title: Question Mark (?) symbol in URLs
Recently I have noticed a question mark symbol in my sites slugs.

```
http://www.url.co.uk/?/contact/

```

Does any one no what this means and why it has suddenly appeared?

# Answer
> 5 votes
This comes from having Admin \> Output and Debugging \> Force Query strings to 'yes'.

You may need that for it to work, and you can add it after 'index.php' in your .htaccess file and turn off the EE option to force it into the URL.

---
Tags: url
---


# Question
Title: Expresso Store: "Card details must be submitted over a secure connection" error
I am trying to checkout with the Dummy Payment Gateway in Store. It will not let me do this. The error message says "Card details must be submitted over a secure connection."

I have Expression Engine (2.5.5) installed on my local server WAMPserver(2.2) and am using Expresso Store(1.6.2).

I'm not sure of what direction to go with fixing this. I want to simply checkout with the dummy information and get a successful payment page for testing purposes. I want all this to be done locally. I've read some very technical tutorials on enabling SSL in WAMPserver, that is if that is the answer to making this work. I'm hoping there is an easier solution than that. I am very open to the best way to solve this. When live, I will be using PayPal to process payments. I guess my last option would be to create a Paypal Sandbox account for testing purposes. In this scenario, I'm assuming the order would leave my site and wouldn't have to be encrypted since the billing information will only be processed on Paypal.

Any suggestions, help, or ideas are greatly appreciated.

Shannon

# Answer
> 3 votes
This is a hard coded requirement in Store. We do not allow credit card details to be submitted over an unsecure (HTTP) connection, period. If we had a setting to disable this, it would be far too easy to forget to re-enable it when you move to production (or every time you push to production if you're using multiple environments). Then aside from breaking the Payment Card Industry requirements, you run the risk of your customers' credit card details being stolen by the person sitting next to them in a cafe, or worse.

If you are going to be using SSL in production, you should set up your development environment with SSL as well. This means your development environment is as close to production as possible, and it also means you can test things like your htaccess redirects between HTTP and HTTPS pages.

If you are going to be using PayPal Express (or another off-site payment gateway) when you go live, then you will not be submitting credit card details directly to your site, so there is no need to test with the Dummy gateway. You should take a look at the Manual payment gateway which will simply authorize every transaction without requiring card details (it's normally used for check/bank transfer payments, but it's also good for testing your checkout process sans payment).

# Answer
> 3 votes
I'm having the same issue, even though I've set PayFlow Pro to Test mode. I'm surprised any non PHP experienced developer can figure this out. I only did after digging through the code and dumping the responses at several points in the checkout process. It also does not let you use a test CC number. For example 411111111111 is a common test number that all CC companies recognize, but Store says its invalid.

I recommend reconsidering this "feature" - If the payment gateway is in test mode, then it should be submitting to a test server, so it does not matter what the CC # is or if its a secure request. Its actually more of a security risk to require me to comment out code to test locally (even our dev server doesn't have SSL certs on it) then hope I remember to uncomment it out before going to production. Magento uses test modes in a similar fashion, why can't Store?

I would also recommend more robust logging... as it stands right now the only way for a non-PHP developer to figure out what is going on is to var\_dump all over the code base. Even an experienced PHP developer should be able to view a log of what is happening. I actually have an easier time debugging Magento errors than I do Store :(

# Answer
> 2 votes
Let me start off by saying I fully support not allowing even test transactions with an on-site gateway (even the dummy gateway) to be processed over HTTP as it is a security risk to you and your customers if you forgot to enable HTTPS/SSL before the site goes live.

If you are on a local environment and you can not enable HTTPS for various reasons there is an option that you can do but it requires a core hack to Store and should never be done on a live site.

If you open up store/ci-merchant/libraries/merchant.php you can scroll down to about line 624 where you should see the following code block:

```
/**
 * Returns TRUE if the current request was made using HTTPS
 */
protected function secure_request()
{
    if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) AND $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
    {
        return TRUE;
    }
    if (empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) == 'off')
    {
        return FALSE;
    }

    return TRUE;
}

```

The conditional on line 633:

`if (empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) == 'off')`

is returning FALSE causing the error to be shown if you modify the code block to the following you should be able to checkout over HTTP:

```
/**
 * Returns TRUE if the current request was made using HTTPS
 */
protected function secure_request()
{
    if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) AND $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
    {
        return TRUE;
    }
    if (empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) == 'off')
    {
     // return FALSE;
        return TRUE;
    }

    return TRUE;
}

```

Again I can not express how important it is that you do not do this on a production site and that if you do it on your local machine that you revert back to the original before you upload it to a public server.

---
Tags: add-on, expresso-store, ssl
---