# Question
Title: Cartthrob ct_pay_by_check causes 502 Bad Gateway | nginx
**Specs:** EE 2.8.1 | CT 2.5 | PHP 5.3.5

I'm running into an issue where using the ct\_pay\_by\_check gateway during checkout is giving me a "502 Bad Gateway | nginx" error on returning to the confirmation page, in which the order entry is set as status 'Offsite Processing'. The order is processed correctly in the backend, but does not return the confirmation page to the frontend user. I am also using PayPal Express & PayPal Pro gateways without issue on the same site, although those have only been tested on successful authorization.

I have tested this issue in both Chrome and Firefox and both give the same result. Additionally, I tested checkouts by both regular logged-in members and as superadmin both return "502 Bad Gateway | nginx".

Testing on my local system running WAMP had no issues, so I'm assuming there is something about the live server configuration that might be causing this. However, I'm at a bit of a loss as to what might need tweaking.

# Answer
> 0 votes
I did a search for '502 bad gateway nginx' and it is a fairly common issue, and seems to be more server configuration related than it is a software issue. I was able to resolve my instance of the error by inserting the following values within the http {} tags in the nginx configuration file located on my server at /etc/nginx/nginx.conf :

```
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;

```

Then restart the nginx service via SSH with the command 'service nginx restart'

This information is referenced from the following sources:
Source 1
Source 2

---
Tags: cartthrob, payment-gateway, checkout, nginx, error-502
---


title: CartThrob - 502 Bad Gateway

text:
# Question
Title: CartThrob - 502 Bad Gateway
I keep getting random "502 Bad Gateway - nginx" errors cropping up on a clients website when using Cart Throb.

For example I tried to install the example templates & chanmels inside Cart Throb, but it through the 502 error, when it got to this URL:

**https://website.co.uk/admin.php?S=3299b90f3382da657f76b0fb2746336bdb26ebd9&D=cp&C=addons\_modules&M=show\_module\_cp&module=cartthrob&method=install\_templates**

It also does it *sometimes* when a customer pays for something, using the SagePay gateway.

What could be causing this? I've tried turning off secure forms in the settings and its still doing it.

# Answer
> 1 votes
You may have already resolved this, but in case you haven't or for anyone else running into this issue, I resolved it by adding the following to my nginx.conf file within the http {} tags located at /etc/nginx/nginx.conf on your server:

```
proxy_buffer_size   128k;
proxy_buffers   4 256k;
proxy_busy_buffers_size   256k;

```

Then restart your nginx service via SSH with the following command:

```
'service nginx restart'

```

This worked for me, but for some others the fastcgi\_buffer also needed to be updated. If the above does not work, then you may want to reference this answer:

Upstream too big - nginx + codeigniter

---
Tags: cartthrob, server, error-500, error-502
---


# Question
Title: JSON: export file from template with a JSON extension
I'm using JSON from Rob Sanchez, it's working fine.

The template create a file, but what is the solution for the template save the file with a json extension instead of .html or .js ??

# Answer
I'm not completely understand your issue (for template route ext. is not really matter - you can made it as you want), but possible is that you have *text/html* header instead of *application/json*?

If yes, try to add **terminate="yes"** parameter to JSON plugin:

```
{exp:json:entries channel="news" terminate="yes"}

```
> 2 votes

---
Tags: json
---


title: Postmaster - Custom Field Notification

text:
# Question
Title: Postmaster - Custom Field Notification
Can't seem to pull a custom email variable from Cartthrob orders into the Postmaster. I can see postmaster is sending the message on authorisation but the variable is not showing the email address from the order field and shows the variable {order\_custom\_email}. What am I doing wrong? Can not I not use this custom variable in the order channel?

# Answer
Okay, got it to work.. changing the field to the supported variable shipping\_region in the order channel fields and then updating the Postmaster Hook "To" field from {order\_custom\_email} to {hooks:shipping\_region} sends the mail perfectly.
> 0 votes

---
Tags: cartthrob, postmaster
---


# Question
Title: Linking a category in one channel to an entry ID in another
I've got a music site where I am displaying a list of recordings in a "recordings" channel on one page with some info about each one; I'm not using a single-entry page for these. For each recording, I'm using `<a name="{entry_id}"></a>` so I can link to the entry.

I have a separate "press clips" channel, with a separate category for each recording, so that it's easy to display all the reviews for a specific recording on a page.

What I want to do is link the category image from the "press clips" channel to the recordings page listing for that particular recording, so I'm looking for a link like `<a href="{site_url}music/recordings#{entry_id}`. But I can't figure the way to get the `{entry_id}` automatically.

Should I be using a relationship field (something I'm not so familiar with using) to link the recording with the press clips? Or is there some simple way to do this?

# Answer
> 2 votes
Are you on EE 2.8.1?

It would probably be easiest to use a relationship field in the "press clips" channel instead of creating a separate category for each recording. You can then easily get the entry\_id of the related recording by doing something like the following:

```
{exp:channel:entries channel="press clips"}

{related_recording}
     <a href="{site_url}music/recordings#{related_recording:entry_id}>{title}</a>
{/related_recording}

{/exp:channel:entries}

```

One thing to be careful of is the status of the related entry. If the status of the related entry is anything other than "open", you need to specify it in the tag pair. Also, the status in the related entry tag pair parameter is case sensitive, which is different behavior than the regular channel:entries tag pair.

So for example, if the related\_recording has a status of "NEW Album" you would need to have your code look like this:

```
{exp:channel:entries channel="press clips"}

{related_recording status="NEW Album"}
     <a href="{site_url}music/recordings#{related_recording:entry_id}>{title}</a>
{/related_recording}

{/exp:channel:entries}

```

---
Tags: categories, entrylinks
---


# Question
Title: Posting to a page containing custom module from external site gives '403 Forbidden'
I have a template containing a tag from a custom module that processes POST'd data from an external site, but when the page is called it responds with a 403 error (so the logs from the external site tell me anyway).

If I remove the tag, the page will display, but with the tag in it I get an empty page.

Changing the request to a GET is not an option.

EE : v2.5.2

# Answer
Well, is really not too much info you provide to us (what EE version, what module etc.). But I can suggest that it is results of Cross-site Request Forgery protection. Possible you do not provide csrf\_token/xid with your POST.

Just for test - try to disable it in config.php

```
$config['secure_forms'] = 'n'; // for EE <2.8
$config['disable_csrf_protection'] = 'y'; // for EE >=2.8

```

It is also good to know what exactly was on the page, not just header data. Because it can be EE 403 error because of protection, but it can be server info also. For example - do you have mod\_security on server? What status of SecFilterEngine?
> 0 votes

---
Tags: ee2, module
---


title: Search template pages

text:
# Question
Title: Search template pages
I created an ExpressionEngine site. The site has various channels with entry data (ie. news, blog posts). I added exp:search:simple\_form and it works great for the channel entries.

However, I also have a number of template pages with static content. The content is so different on each page, that I don't believe it makes sense to create a single "About Us" template and create an About Us channel with entries for annual report, history, leadership, and the index. I need to be able to search "static" content on my template pages as well as the regular channel entries.

https://www.dropbox.com/s/jvyqbgy5lf4ux4g/Template\_Manager.png

Does anyone know of a "good" way to search all template pages within an ExpressionEngine site? Should I consider some other "non-EE" method of site search?

# Answer
If you aren't going to manage the content with EE, you won't be able to search the content with EE.

Either move your content to channels as suggested (I've had sites with channels with two fields - title and page content, the latter holding whatever HTML is necessary), or implement a Google Custom Search that will search your rendered pages.

Low has a nice add-on to help with EE-templating the Google results:

http://gotolow.com/addons/low-googlesearch
> 3 votes

---
Tags: ee2, templates, search
---


title: Using list data in a Stash Embed

text:
# Question
Title: Using list data in a Stash Embed
I have a couple of formats that a news story can display on the site. I have each of these as a different Stash embed.

They're named in this format: `story-block`, `story-focal`, `story-standard`.

The site is in a magazine format and so uses many different styles on one page, often mix and matching them.

For example, on the homepage it loads in 16 blog posts, the first 4 are in `story-block` format, the next 6 are in `story-standard` format and the final is in `story-block` format.

The following code doesn't work, but demonstrates the concept I'm trying to achieve.

```
  <div class="two-by">
    {exp:stash:get_list name="news" limit="4"}
      {exp:stash:embed:modules:story-block process="start"}
    {/exp:stash:get_list}
  </div>

  {exp:stash:get_list name="news" limit="6" offset="4"}
    {exp:stash:embed:modules:story-standard}
  {/exp:stash:get_list}

  {exp:stash:get_list name="news" limit="1" offset="10"}
    {exp:stash:embed:modules:story-block}
  {/exp:stash:get_list}

```

`story-block` has the following markup:-

```
<article class="story story--block">
  <a href="{url}">
    <img src="{photo}">
    <div class="story__details">
      <h2 class="main-title">{title}</h2>
      {excerpt}
      <div class="mini-meta">
        <span>{type}</span>
        <span>{date}</span>
      </div>
    </div>
  </a>
</article>

```

But when rendered it doesn't load in the data, it will still show `{title}`.

My inkling is that embedding with `process="start"` should do the trick as it would then work as an EE snippet would, but this doesn't make a difference.

If I don't embed and instead copy the code directly into the template it works fine - but this is going to lead to massive code duplication around the site.

Is this possible, or is there a workaround?

# Answer
Change the stash embed from `{exp:stash:embed:....` to `{stash:embed:...` (remove the "exp").
> 1 votes

---
Tags: stash
---


title: Expresso Store: customer registration

text:
# Question
Title: Expresso Store: customer registration
I'm looking for any suggestions what to use (addons) to have ability to:

* create customer account during checkout process (as an option)
* capture customer data (billing and shipping address)
* store all completed orders

and if account exists:

* let clustomer to log in
* use stored data (billing and shipping address) during checkout process
* view all completed orders

Thanks for any suggestions

# Answer
> 6 votes
The simplest and free approach would be to use Freemember, also created by Expresso. It offers member registration tags within templates and integrates nicely with Store, allowing you to map custom member fields to Store customer/order fields.

If you need your member profiles to be a bit more complicated, you can use something like Zoo Visitor, which provides similar functionality, with the addition of connecting member profiles to channel entries so any channel fieldtype can be used.

In either case, you can align your user's flow through the site to register and then direct over to templates with your cart and checkout using the return="" parameters on the registration tags.

# Answer
> 2 votes
To create a user account during checkout you can use the register\_member='yes' parameter on the exp:store:checkout tag or submit a register\_member field:

https://exp-resso.com/docs/checkout\_tag.html#register\_member\_yes

---
Tags: expresso-store
---


# Question
Title: Which version of JQuery UI does EE 2.8.x ship with?
I checked the EE 2.x Changelog (http://ellislab.com/expressionengine/user-guide/about/changelog.html) and system reqs (http://ellislab.com/expressionengine/user-guide/installation/requirements.html), and couldn't find anything. Then I added the `include_jquery="yes"` parameter to a `{exp:channel:form}` tag, checked browser source and found:

```
jQuery JavaScript Library v1.7.2

```

However, when I look at JQuery UI, I get:

```
/*!
* jQuery UI @VERSION

```

What does `@VERSION` refer to? How can I find the version of JQuery?

# Answer
> 1 votes
That should be right - but you can check the source within the themes folder:

/themes/javascript/compressed/jquery

---
Tags: jquery, 2.8
---


# Question
Title: Removing index.php causes internal server error
Just installed EE 2.8.1, haven't renamed the system folder yet and am trying to set up the htaccess file to remove index.php from URLs. When I use the htaccess code recommended in the installation instructions, I get an internal server error. The error log gives an alert:

.htaccess: RewriteRule: cannot compile regular expression '(.*?)index\\.php/*(.\*)'\n

Here's the .htacess contents

```
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

```

Anyone run into this and know how to fix it?

It's on an Apache 1.3.4 server; fresh install, no addons.

# Answer
> 1 votes
The htaccess setting depends of the characteristics of the server. I encountered the same problem too on a Apache server, the htaccess model from the doc was not working properly. You could try this one:

```
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

RewriteCond %{QUERY_STRING} !^(ACT=.*)$ [NC]
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} ^/() [NC,OR]
RewriteCond %{REQUEST_URI} ^/(member|P[0-9]{2,8}) [NC]
RewriteRule (.*) /index.php/$1 [L]

</IfModule>

```

Else if it's not working try to contact the administrator of the server.

# Answer
> 0 votes
After playing around with this, finally landed on the code that works...and oh so simple in the end. In the first Rewrite rule, just remove the question mark in the (.\*?). So here's the full code, in case it'll save someone else some time. Straight from the EE docs, with the slight modification. Just remember to replace "syst

```
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
   RewriteRule (.*)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
 </IfModule>

```

---
Tags: ee2, htaccess
---


title: Importing formatted body copy into EE

text:
# Question
Title: Importing formatted body copy into EE
Does anyone have any thoughts on how best to handle the import of large chunks of body copy that are already formatted with basic html (p tags and br's mostly)?

Datagrab can obviously do the heavy lifting of the actual import, but I'm then left with textareas full of compacted, marked up copy that's hard to read.

Should I look to replace all the p tags with newline/carriage returns prior to import and then import them to a field with 'xhtml' formatting (or an RTE field), or is there some other way?

# Answer
> 3 votes
It really all depends on what field you're ultimately going to import into. If you're importing into an XML-formatted textarea or a Rich Text Editor field, then you'll need to totally remove *both* the `<p>` and `<br>` tags, because EE adds those tags dynamically when inserting the content into the template, and, as you said, replace them with carriage returns so EE knows where to place the tags. That can be accomplished with a simple Find/Replace query.

If you're importing into a 3rd-party WYSIWYG field like Wygwam or Wyvern, you don't need to make any changes at all. Leave all the tags as-is and they will be parsed the same.

# Answer
> 1 votes
One option you could try is to convert the HTML to Markdown format and import that into a MarkItUp or Markdown formatted text field.

Brett Terpstra's online Markdownifier tool (http://heckyesmarkdown.com) can be scripted and Brett has a Ruby script (https://gist.github.com/ttscoff/2960951) that you can use to call it.

I've successfully used this before by writing a shell script to call Brett's Ruby script to convert a folder full of over 500 HTML files into Markdown and extract the text from them.

---
Tags: datagrab, import, rte
---


# Question
Title: Any way to create Expresso Store price modifier templates
We're using Expresso Store on a new project and the client has asked as to whether price modifier templates can be created to avoid having staff add modifiers in different ways for different products which share a common modifier type.

Is this even possible? If not I think it would make for a great addition to Store. :)

# Answer
There is nothing currently in Store that allows you to do something like this. There is currently Global Product Variations feature request that would cover exactly what you are looking for.

Having said that if your product modifiers are not adjusting the price, do not require stock levels, or needing separate SKUs (I think those are the only limits) you can create the variations at the template level using text modifiers in your templates.

> The input parameter allows you to use custom product modifiers defined in your template, rather than setting them up on a per-product basis. This is useful if you are selling a large number of similar products.
>
> For example, to allow a Small, Medium and Large size option for every product in your store, add the following parameter to the product tag:
>
> ```
> input:size="Size"
>
> ```
>
> Then, further down the form, you can use standard HTML to submit the modifier along with the rest of the form:
>
> ```
> <select name="size">
>   <option value="Small">Small</option>
>   <option value="Medium">Medium</option>
>   <option value="Large">Large</option>
> </select>
>
> ```
>
> These modifiers will behave like any other text modifiers, and display on the checkout and order details pages.

Complete Documentation
> 1 votes

---
Tags: expresso-store, modifiers, price-modifier
---


title: Adding Category in URL link

text:
# Question
Title: Adding Category in URL link
How do I include the category name in the URL and have that link work? I have a blog channel with a category called 'news'. I need the url to be - www.mysite/news/blog-post-heading. I currently am just shoving the category name in there and I need to know how to build up the link, because if you click on the link it goes to a error page because its trying to use the a template group name and I have no template group called news.

```
 {exp:channel:entries
      channel="blog"
      orderby="date"
      sort="desc"
      category_group="3"
      limit="1"}

<h1><a href="/{categories}{category_name}{/categories}/{url_title}/">{title}</a></h1>

```

Do I make use of segments?

# Answer
Just checking I've understood your question correctly. Are you waiting to create a link to your blog page which includes the category AND the url title? So your final url would be www.mysite.com/blog/news/blog-post-heading as opposed to what you've stated above www.mysite.com/news/blog-post-heading.

As you've rightly pointed out, what you currently have won't work because EE is looking a news template.

If you could clarify what you're trying to achieve, please.

As a quick help, maybe Zoo Triggers (http://ee-zoo.com/add-ons/triggers/) or Low Search (http://gotolow.com/addons/low-search) could help you out?
> 0 votes

# Answer
Okay so perhaps I was being silly about how I do this and so I'm opting to make a news channel and just adding those posts there. @foamcow is right in sayin categories aren't for navigation.
> 0 votes

---
Tags: categories, segments, url-title
---


title: PHP Query EE database

text:
# Question
Title: PHP Query EE database
I have a ajax template and would like to query the channel to select certain entries for a drop down select. How should I modify the code below to get all the results needed.

Trying to modify the JSON feed for the following: `$productSelect = new SelectBox('What would you like to purchase?','Choose a product category');
$productSelect->addItem('Phones','phoneSelect')
 ->addItem('Notebooks','notebookSelect')
 ->addItem('Tablets','tabletSelect');`

Each addItem needs to be a channel entry. Right now the EE template is not accepting the channel entry call using the modified script below...

`$productSelect = new SelectBox('3. Select a Product','---');
{exp:channel:entries channel="product" category="2" dynamic="off" disable="member_data|pagination"}
$productSelect->addItem('{title}');
{/exp:channel:entries}`

# Answer
It sounds like you have PHP Parsing on the template set to input stage instead of output stage, which would cause the PHP to be parsed before the Channel Entries tag, leaving a literal unparsed `{title}`, but I agree with the commenters on your question, you shouldn't need PHP for this.
> 1 votes

---
Tags: php
---


# Question
Title: Social Networking Add-on for ExpressionEngine
I searched for some Expressioneinge social networking add-on that would allow me to have some "friends" functionality for ExpressEngine at devot:ee.

So far, I only found one plugin, Friends that allows me to do so.

I am just curious. Are there no other Expresssion Engine plugin that has this type of functionality?

# Answer
If you need some simple function, you can look to Buddies

> This module enables users to have buddies/friends/followers just like in many popular social networks and blogging systems.
>
> The users are able to add/remove others as their buddies. The lists of buddies added by user and also who added him can be displayed. You can also display the total numbers and make various checks.
> 3 votes

# Answer
You may also consider Messaging, which incorporates funtional from Buddies module. These two use EE built-in buddies/blocked database table (yes, this functional already exists in EE, but it does not natively provide tools to manage user relations on front-end)

Another (more expensive) alternative is Friends from Solspace
> 2 votes

---
Tags: social
---


title: Transfer EE site to GoDaddy

text:
# Question
Title: Transfer EE site to GoDaddy
First off, I need to start with the fact that I cannot STAND GoDaddy... However, I had an old hosted account from 2002 on there and decided to use it as a dev playground to try some stuff out. I had a local site already function running on WAMP on a Windows machine. When I went to transfer the site to GoDaddy, I have yet, (3 days deep), been able to get it running. Here is what I have done:

1. Created the Sub Domain (dev)
2. Created the Database in MySQL
3. Exported the database from my local MySQL
4. Imported the previously exported database into the newly created database
5. Placed the system folder in the webroot (due to GD being persnickity)
6. Placed the rest of the site in the dev folder for the Sub Domain dev.domain.com
7. Modified my index.php and admin.php files to reflect the new locations
8. Updated the database file to reflect the new information:

```
$db['expressionengine']['hostname'] = 'dbname.db.acct-number.hostedresource.com';
$db['expressionengine']['username'] = 'username';
$db['expressionengine']['password'] = 'password';
$db['expressionengine']['database'] = 'database';

```

However, I keep getting the following on admin and site:

```
An Error Was Encountered
Site Error: Unable to Load Site Preferences; No Preferences Found

```

So to verify I had the connection strings correct, I copied the dbtest.php file to the dev folder and ran it after changing the following fields:

```
$hostname   = "dbname.db.acct-number.hostedresource.com";
$username   = "username";
$password   = "password";
$db_name    = "database";

```

When I hit this page, I am given the following:

```
A connection was established to your database server
Your database was selected.

```

I am running out of ideas and GoDaddy support has yet to respond to a ticket from 3 days ago. I guess I am lost as to why dbtest hits fine, but the admin and site say a connection could not be established. (This is the message I receive when I turn on the debug to 1.

# Answer
@BrianMallett was able to resolve this by re-importing his database as it did not properly import to GoDaddy the first time.
> 2 votes

---
Tags: ee2, database, godaddy
---


title: MX Google Maps 2.8.1 compatibility

text:
# Question
Title: MX Google Maps 2.8.1 compatibility
I'm getting the following error when upgrading from MX Google Maps 1.4 -\> 1.5.3 in EE 2.8.1

Fatal error: Call to undefined method Cp::set\_variable() in /system/expressionengine/third\_party/mx\_google\_map/mcp.mx\_google\_map.php on line 191

Anyone know if there's a fix for this?

# Answer
> 4 votes
I made quick update - v. 1.5.3.140526 wait for you

*update: first push was with mistake. download it now*

---
Tags: mx-google-map
---


# Question
Title: Assets 2.2.2 / 2.3.2 chequerboard / empty thumbnails
I have the chequerboard / empty thumbnails showing up in Assets, for all images. Everything is working fine on the live site. So far I've tried:

* Checking / applying 777 to all images and the cache/assets directories
* Emptying the cache/assets/thumbs directory and clearing the browser cache
* Updating any old dev server paths I could find in the db to the new
path
* Updating from Assets 2.2.2 to the latest, 2.3.2, clicked 'update modules' and cleared cache
* Checking the network tool for the thumbs, I get 200 OK but 'Failed to load the given URL' under Firebug. This is most likely because the files aren't there, I know because I have uploaded a thumb from the dev site cache and that worked.
* Don't think it's .htaccess, have not changed that recently, but it is set to remove index.php but not www. The index.php?ACT query seems to be working fine as the thumbnail test above shows.
* Checked User session is set to cookies only
* Cleared EE data caches

The images were uploaded via Assets at dev, http://prometheus.glue.co.nz (ignore it, it's broken now), then went live at http://www.prometheus.co.nz two months ago. Guess the problem started then and went unnoticed. Same host so server paths not all that different. Oh, running PHP 5.3.10 and EE 2.7.2.

Please help? Hoping P&T crew would like to log in.

# Answer
I switched EE's resizing preferences (Admin \> System Administration \> Image Resizing Preferences) from ImageMagick to GD 2, deleted the contents of the cache/assets/thumbs directory, and on revisiting Assets module, the thumbnails all regenerated as hoped.

In places I'm using Assets in a Matrix field, and processing them with CE Image in the templates, so while it's early days, it seems like a robust solution.

I'd have loved to find out why but I've lost too many hours to this already. If you have to press on with ImageMagick for any reason the most likely culprit would be the path setting, required only for ImageMagick, which may not have been correct, or maybe ImgeMagick was not even installed by my host on the live account space...
> 1 votes

# Answer
I had that same issue this morning as it happens. Turns out that when the files were uploaded there was a permissions problem with the cache directory.

So, check the perms for your system/cache directory and all sub directories are set to 777

I then had to re-upload the files to get the thumbnails to generate. Simply clicking the refresh button didn't work. The nice thing is that you can still view each file and download it then re-upload it with the same name so it overwrites the original.

I only had a few images to deal with and they were only used within 1 matrix field so I could delete and re-upload them directly so the change in asset ID wasn't a problem.
> 0 votes

# Answer
Ran into the issue with Assets 2.3.2 and EE 2.8.1. After giving the cache directory proper permissions and making sure the proper domain name was being requested, the issue remained. I finally solved it by removing a line of code from the Assets module:

**File:** mpc.assets.php
**Line:** 179

```
    #header_remove('Pragma');
    readfile($thumbnail_location);
    die();

```

Not sure why header\_remove() was causing an issue, but I have thumbnails now.
> 0 votes

---
Tags: assets, pixelandtonic, image, thumbnails
---


# Question
Title: Random = characters in freeform html notifications
A client has just recently seen this happening on Freeform (Free) notifications. We've set the notification settings to HTML and Word Wrap, and added just basic HTML (ie. we've not included html, head, body tags etc.) but just started with \< p \> tags.

The output looks like this:

```
Thank you for choosing our company.

---------= ------------------------------------

Your 60-day application evalu= ation and agreement was successfully sent and a member of our team will be = in contact with you shortly.

```

Anyone else seen this, or know why its happening?

FreeForm 4.1.3 + EE 2.7.2

# Answer
After some more bug hunting, I think I've tracked this down - and the scenario would apply both sites we've seen this behaviour on.

I figured Freeform would be using a wordwrap value from an existing CI or EE class, and sure enough in codeigniter/system/libraries/email.php, there is the following code.

```
    // Set the character limit
    // Don't allow over 76, as that will make servers and MUAs barf
    // all over quoted-printable data
    if ($charlim == '' OR $charlim > '76')
    {
        $charlim = '76';
    }

```

Guess what, the random characters were popping in at this cut off.

While in this file, a few lines further down I came across the following:

```
        // Loop through each character in the line to add soft-wrap
        // characters at the end of a line " =\r\n" and add the newly
        // processed line(s) to the output (see comment on $crlf class property)

```

Then came the light bulb moment! We were using SMTP in the EE mail configuration, and to get this working, we'd had to add the following to the config.php file.

```
$config['email_newline'] = "\r\n";
$config['email_crlf'] = "\r\n";

```

So that seems to explain the '=' characters appearing. Obviously the quick fix is to the change the SMTP server, or use a different email config option in EE :-)
> 1 votes

---
Tags: solspace-freeform, notification
---


# Question
Title: Solspace User 3.4.6 Registration error on dev server - EE 2.7.3
I am using Solspace User for new member registration. I've installed the demo templates and attempting to register a new user. Submission of the registration form throws the following errors:

Message: Undefined property: stdClass::$csrf\_hidden\_name Filename: user/mod.user.php Line Number: 5955

This is followed by a series of "headers already sent" errors.

Oddly, the new user is successfully saved to the members table, and can subsequently login successfully.

Using EE 2.7.3 and Solspace User 3.4.6

Update: I then regressed back to User 3.4.5, and it works successfully w/ EE 2.7.3

# Answer
> 1 votes
Seems like a possible bug. Try this:

In mod.user.php, on line 5955 (User 3.4.6), change

```
$good = ee()->input->get_post($this->sc->csrf_hidden_name);

```

to

```
$good = ee()->input->get_post($this->sc->csrf_name);

```

---
Tags: solspace, solspace-user, registration
---


# Question
Title: Multiple Content-Elements with Assets-elements breaking on what seems to be a specific number of images
**Background**
So i keep getting an error when adding more images to the second Content-Elements field on one of my pages.

I have one for the maincontent and this one seems to work with an "infinite" amount of images. The second one, who is also parsed last gives me this error:

> **Error**
>
> Unable to load the requested class: assets\_lib

The first field currently has 3 Assets-elements with at total of 28 images.

When i try to add more than 4 images to the same kind of Element in the second field i get the error above?

I am not sure where to go next, is there a way to get more info out of EE's error manager. A file and row # would be a nice start. :P

Is this a problem with Content-Elements or with Assets?

Is there anything i can add to help out?

**Versions**
\- EE: 2.8.1
\- Assets: 2.3.1
\- Content-Elements: 1.6.9 \- Stash: 2.5.1

**Template code**
I keep the Elements-part in a Stash embed, the part that handles assets is:

```
{assets}

<div class="row-fluid">
  {files}
  <div class="span3">
    <a href="{url}" class="gallery" rel="{element_name}_{element_id}">
      <img src="{url:150x150}" alt="{alt_text}" title="{title}">
  </a>
</div>
{switch="|||</div><br /><div class='row-fluid'>"}

{/files}
</div>
<br>
{/assets}

```

the part of the page template that embeds them looks like this:

```
{exp:stash:content parse="inwards"}

<div class="row-fluid">
  <div class="span7">

    <h1>{title}</h1>
    {page-content}
    {stash:embed:components:content_elements_parser process="start"}
    {/page-content}

  </div>
  <div class="span4 offset1 subtopmargin">

    {page-content-2}
    {stash:embed:components:content_elements_parser process="start"}
    {/page-content-2}

    {page-modules-right}
    ...
    {/page-modules-right}
  </div>

  {stash:embed:components:social_share}
</div>
</div>

{if page-modules-bottom}
<div class="row-fluid content">
  <div class="span12">
    ...
  </div>
  {/if}
  {/exp:stash:content}

```

# Answer
Open up ft.assets.php file (located at third\_party/assets/ft.assets.php), find the method "replace\_element\_tag" and add this as the first line in that method:

```
$this->EE->load->add_package_path(PATH_THIRD.'assets/');

```

Sometimes EE would lose that package path and I'm not entirely sure why.
> 2 votes

---
Tags: ee2, assets, stash, error, content-elements
---


title: Upload file form in CP - create module

text:
# Question
Title: Upload file form in CP - create module
I need put in my CP a upload image field. I would like know if have a possibility that integration of use in my module the default upload file of EE or if I have that do the upload file manually.

# Answer
You can use the api to add a single upload field to your module or fieldtype. http://ellislab.com/expressionengine/user-guide/development/usage/file\_field.html . if you want to include multiple image uploads in the same field, then you will need to do something else.
> 2 votes

---
Tags: control-panel, file-uploads, module, image
---


title: WYGWAM Field Won't Initialize

text:
# Question
Title: WYGWAM Field Won't Initialize
I'm getting an error when I try to add a wygwam element to my content elements field - but it only happens in my local dev environment. It works fine on our live site. Also, a stand-alone WYGWAM field will not initialize either, so I don't think the issue is with CE.

PHP 5.3.2 EE 2.8.1 Wygwam 3.2.2 Content Elements 1.6.6

```
Uncaught TypeError: Cannot read property 'init' of undefined
/themes/third_party/content_elements/elements/wysiwyg/ckeditor/ckeditor.js:24

```

Anybody seen this before? Thank you in advance!

# Answer
> 2 votes
If I recall correctly, then it was not possible to have CE RTE and Wygwam on the same page due to conflicting CKEditor instances.. If you switch out all your CE RTE fields for CE Wygwam fields, it should work again.

# Answer
> 1 votes
First, try deleting and re-adding the entire Wygwam folders as there may be a corrupt or missing file.

Second, update to the latest Wygwam (3.3.1 now).

---
Tags: wygwam, content-elements
---


# Question
Title: Can retrieve stash variables inside entry tags, but not outside
I am trying to set a group of stash variables per an entry and use them in the rest of the site build but I can't 'get' the stash variables from outside the initial channel entries tag.

So something like below in which if I place the tags inside the closing channel entry tag they will appear, but as they are will not.

```
{!-- STASH SET --}
{exp:channel:entries
    channel="site_settings"
    limit="1"
    disable="categories|member_data|pagination"
}
    {exp:stash:logo}{company_logo}{/exp:stash:logo}
    {exp:stash:style}{site_appearance_style}{/exp:stash:style}
    {exp:stash:color}{site_color_theme}{/exp:stash:color}
    {exp:stash:phone}{contact_phone_number}{/exp:stash:phone}
    {!-- GRID FIELDS --}
    {contact_e_mail_options}
        {exp:stash:text}{contact_e_mail_options:display_text}{/exp:stash:text}
        {exp:stash:email}{contact_e_mail_options:e_mail_address}{/exp:stash:email}
        {exp:stash:subject}{contact_e_mail_options:e_mail_subject}{/exp:stash:subject}
    {/contact_e_mail_options}
    {social_media_accounts}
        {exp:stash:facebook}{social_media_accounts:facebook}{/exp:stash:facebook}
        {exp:stash:twitter}{social_media_accounts:twitter}{/exp:stash:twitter}
        {exp:stash:linkedin}{social_media_accounts:linkedin}{/exp:stash:linkedin}
    {/social_media_accounts}
    {physical_address}
        {exp:stash:street}{physical_address:street}{/exp:stash:street}
        {exp:stash:city}{physical_address:city}{/exp:stash:city}
        {exp:stash:state}{physical_address:state}{/exp:stash:state}
        {exp:stash:country}{physical_address:country}{/exp:stash:country}
        {exp:stash:zip}{physical_address:postal_code}{/exp:stash:zip}
    {/physical_address}
{/exp:channel:entries}
{!-- /STASH SET --}

<h1>{exp:stash:logo}</h1>
<h1>{exp:stash:style}</h1>
<h1>{exp:stash:color}</h1>
<h1>{exp:stash:phone}</h1>
<h1>{exp:stash:text}</h1>
<h1>{exp:stash:email}</h1>
<h1>{exp:stash:subject}</h1>
<h1>{exp:stash:facebook}</h1>
<h1>{exp:stash:twitter}</h1>
<h1>{exp:stash:linkedin}</h1>
<h1>{exp:stash:street}</h1>
<h1>{exp:stash:city}</h1>
<h1>{exp:stash:state}</h1>
<h1>{exp:stash:country}</h1>
<h1>{exp:stash:zip}</h1>

```

# Answer
> 3 votes
The :set tags are not wrong, per se, as you are using the shorthand syntax. However, due to parse order, your 'get' tags are parsing before your 'set' tags since the sets are within the channel entries module tag.

Stephen's answer does fix things, because it moves the channel loop within the set module tags. (However, that is not always convenient.) You could also have fixed your issue by adding process="end" to the get tag, e.g.:

```
<h1>{exp:stash:logo process="end"}<h1>

```

to force it to parse after the channel loop, or you could wrap all the get tags in a `{exp:stash:parse process="end"}`.

# Answer
> 1 votes
Your `:set` tags are wrong. See docs here.

```
{!-- STASH SET --}
{exp:stash:set parse_tags="yes"}
  {exp:channel:entries
    channel="site_settings"
    limit="1"
    disable="categories|member_data|pagination"
  }
    {stash:logo}{company_logo}{/stash:logo}
    {stash:style}{site_appearance_style}{/stash:style}
    {stash:color}{site_color_theme}{/stash:color}
    ...continue that format...
  {/exp:channel:entries}
{/exp:stash:set}
{!-- /STASH SET --}

```

Then you get the values like this:

```
{stash:logo}
{stash:style}
{stash:color}

```

---
Tags: ee2, stash, parse-order
---


# Question
Title: ExpressionEngine 404 Not found - /index.php/products was not found
I have just begun working with ExpressionEngine. The production site is working just fine and I wanted to create a local version for dev purposes.

I am receiving 404 not found errors on my localhost pages such as localhost:8888/example.com/products or localhost:8888/example.com/aboutus, but the index or home page comes up just fine - localhost:8888/example.com/

I have followed the steps for migration from this link - http://ellislab.com/expressionengine/user-guide/operations/moving.html

1) Downloaded flat files via ftp 2) Used a backup .sql to load the local mysql 3) Able to login to system - localhost:8888/dev.example.com/system - all usernames & passwords work 4) Setup all the URLs within Admin\> General Configuration - so on and so forth

I was able to fix my template synch issue by going into the Design\> Templates\> Global Preferences and change the path to the templates' path on my computer - they were still set to the template’s path in production.

/Applications/MAMP/htdocs/dev.example.com/templates

Both the localhost:8888/example.com/system and the initial index page - localhost:8888/example.com/ - function exactly as they would be expected to do.

I have created an htaccess file and placed it within /Applications/MAMP/htdocs/dev.example.com/:

```
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

```

But I am still receiving a 404 not found error whenever I try to go to localhost:8888/example.com/products then it thinks that /index.php/products was not found, why does it not say products/index.php?

BTW, is the path to the templates supposed to be this: /Applications/MAMP/htdocs/dev.genesistoday.com/templates

or this: /Applications/MAMP/htdocs/dev.genesistoday.com/templates/default\_site/

# Answer
If you are running from `localhost:8888`, then locally you are essentially running these sites from subdirectories. So the .htaccess you are using (`RewriteRule ^(.*)$ /index.php/$1 [L]`) is sending requests to `http://localhost:8888/index.php`.

Try the second exception from the user guide:

`RewriteRule ^(.*)$ index.php/$1 [L]`

Notice there is no `/` in front of the index.php. You will also want to remove the `RewriteBase /` otherwise it will prepend that to your rules, which you don't want in this case.
> 5 votes

---
Tags: htaccess, 404
---


# Question
Title: Objective HTML Postmaster – send by date, not add/edit entry
I've been working on solving this problem for a while, and hoping someone can help me come up with a solution.

Basically what I'm doing is creating an EE Grid field with a title, date, and description. The way I want Postmaster to trigger is based on the Grid date field.

When a date is 5 days in the future I want a reminder email to be sent. I can't seem to figure out how to do this? Currently I have the Grid field name "calendar", and for testing I put this in the "**Post date specific**" field of the Postmaster Parcel setting:

```
{calendar:date format="%m-%d-%Y"}

```

However, nothing happens if I add an row with today's date? If I change the trigger to "Edit" an email gets sent, but it also gets sent every time one of the rows is edited or a new row added to the calendar Grid field? Not what I want, I only want it to trigger 5 days prior to the date entered? How can I accomplish this?

I believe it should be possible with Postmaster, but can't seem to figure out how to do it??

# Answer
You'll need to create this as a Postmaster "Notification" rather than a "Parcel", which gives you a URL which you then ping with a scheduled cron job.

When creating the Notification, you should be able to fetch the date from the channel grid data inside the "Post Date Specific" field. (Even though Postmaster only gives you a tiny text input, you can put any EE template code inside these fields).
> 1 votes

---
Tags: postmaster, objective-html
---


title: exclusion of Sales tax

text:
# Question
Title: exclusion of Sales tax
I am new to EE.WE are using cartThrob .Now we have set up 13% sales tax globally. The twist comes now.When a person buys 6 or more items , there should be no tax charged for One region(Eg Ontario) . Is there any way to set this rule in EE backend? Does cartThrob provide this kind of functionality.

Thank you

# Answer
Yes, if CT's built-in tax plugins won't do this you can build your own very easily: http://cartthrob.com/docs/developers/tax\_plugins/index.html
> 0 votes

---
Tags: cartthrob, shopping-cart
---


# Question
Title: Wygwam inside of a grid -- has_excerpt conditional not working
I'm unable to test for the has\_excerpt condition, when trying to display excerpt and extended content in a grid. In this example, "booklist" is a grid field and book is a wygwam field within that grid:

```
{booklist:book:excerpt}
{booklist:book:has_excerpt}
{booklist:book:extended}

```

This all works... it will print the excerpt, then the "y" then the extended content. However, if I try to test for has\_excerpt, it breaks:

```
{if booklist:book:has_excerpt}
  {booklist:book:extended}
{/if}

```

This conditional doesn't work and in fact triggers a PHP error:

```
A PHP Error was encountered
Severity: User Warning
Message: Invalid EE Conditional Variable: {if "<p>This massive unfinished modernist novel examines many issues that cannot be categorized.":has_excerpt}
Filename: libraries/Functions.php
Line Number: 2762

```

I've tried {if booklist:book:has\_excerpt == "y"} and {if "{booklist:book:has\_excerpt} == "y"} as well, and neither works. Just to confirm that it works outside of a grid, I tried this (where "book" is a wygwam field not in a grid)...

```
  {if book:has_excerpt}
    <p>{book:extended}</p>
  {/if}

```

And it works fine. Any ideas how to make that conditional 1. work and 2. not trigger a PHP error? Thanks in advance.

j.

# Answer
```
{if "{booklist:book:has_excerpt}"}
  Yup
{if:else}
  Nope
{/if}

```

Should work. Note how we've made the has\_excerpt a string by using " ".

Your example of `{if "{booklist:book:has_excerpt} == "y"}` was almost right, but you didn't close the String after `has_excerpt`.
> 0 votes

---
Tags: conditionals
---


# Question
Title: subdirectory path opening root website why
there are two site on my server 1 on root and other one in a sub folder named /A

when i am inputting my sub folder's url its opening root website

there is no .htaccess file present .

root website is working correct.

# Answer
.htaccess is not only one place where rules can be located. First of all needs to understand what do you use on your site as webserver.

For example it can be Apache, Apache+NGINX, NGIX+php-fpm. The last one don't use .htaccess . All rules is nginx config files.

Apache can also keep rules in his config. .htaccess is only way to override default config (in case if apache config allow it *AllowOverride All*).
> 4 votes

---
Tags: ee2, .htaccess
---


# Question
Title: Use array values in expressionengine template
SUMMARY: I need to access an element in an array that is passed to a template from a module and test for it's existence.

I have a function in a module that looks like this:

```
function subscriptions(){
  $subscriptions = array('sub1'=>array(...unimportant data...),
                         'sub4'=>array(...unimportant data...)
                        );
  $data['subscriptions'] = $subscriptions;
  $output = $this->EE->TMPL->parse_variables_row($this->EE->TMPL->tagdata, $data);
  return $output;
}

```

and a template that looks like

{exp:my\_module:subscriptions} {if subscriptions:sub4}User is subscribed to sub4{/if} {/exp:my\_module:subscriptions}

but that doesn't seem to work. I want to display certain things based upon what subscriptions a user has. This is not just to iterate through and print out subscriptions.

I also tried

```
<?php if($subscriptions['sub4']){ echo 'User is subcribed to sub4' } ?>

```

and it says subscriptions isn't set.

# Answer
If you want your variables to be in the `subscriptions:sub4` format, you should try this:

```
foreach ($subscriptions as $key => $value) {
  $data['subscriptions:'.$key] = $value;
}
return $this->EE->TMPL->parse_variables_row($this->EE->TMPL->tagdata, $data);

```
> 2 votes

# Answer
Rob's got it \- but just to elaborate, the code you're using in your question would require you to use template code which looks like this:

```
{exp:my_module:subscriptions}
    {subscriptions}
        {if sub4}User is subscribed to sub4{/if}
    {/subscriptions}
{/exp:my_module:subscriptions}

```

The "colon" shortcut which EE uses in Grid and Relationship fields is not a default feature of the `parse_variables()` methods.
> 0 votes

---
Tags: templates, template-scripting
---


# Question
Title: Email From Template addons php tag not working
when We have add code like this in email form template then php code not working.

code like this.

```
{exp:email_from_template to="mailid" from="mailid"  echo="off" mailtype="html" }
     //php code $test= "hi";

    {exp:channel:entries channel="channel" dynamic="no" disable="pagination|member_data|categories" }

         //php code  echo $test;

    {/exp:channel:entries}

 {/exp:email_form_template}

```

above code echo test not display , We have already set allow php ="yes" parse order="output" for template.

let me know any idea for this.

Thanks, Piyush

# Answer
```
php ="yes" parse order="output"

```

it is mean that php code is will be executed **after** all tags. Include fact that it will executed **after** email will sent.

You need to change it to **input** if you want to see php code results in your email.

*as solution* \- put you code with php into embed template with parse order ="output"
> 2 votes

---
Tags: email
---


# Question
Title: What is the best place to post job listings for EE devs?
I just want to find some talented people to work with that are already familiar with the platform.

# Answer
I recommend posting on Director-EE, then tweeting about it using the #eecms hashtag. That'll get you the most exposure.

(Shameless plug: I'm available for EE work, get in touch)
> 1 votes

---
Tags: templates, javascript, css, html
---


title: CE Image - output only the src value

text:
# Question
Title: CE Image - output only the src value
`{exp:ce_img:single}` or the like outputs `<img>` tags.

Is there a way in CE to make it only output the @src value only?

# Answer
> 5 votes
There are a few different ways to go about this, but the most succinct is probably to use the url\_only= parameter:

```
{exp:ce_img:single src="{your_custom_field}" url_only="yes" width="200"}

```

You could also customize the output using the output= parameter:

```
{exp:ce_img:single src="{your_custom_field}" output="{made}" width="200"}

```

Or use the made variable in a pair tag (like Max pointed out):

```
{exp:ce_img:pair src="{your_custom_field}" width="200"}{made}{/exp:ce_img:pair}

```

# Answer
> 3 votes
Use :pair tag

```
{exp:ce_img:pair src="{your_custom_field}"}
<img src="{made}" alt="" width="{width}" height="{height}" />
{/exp:ce_img:pair}

```

---
Tags: ce-image
---


title: Multilanguage URL structure

text:
# Question
Title: Multilanguage URL structure
i ask for suggestions about running multilanguage on EE. fyi, i use transcribe. i need to know what type is the most suitable url structure for multilanguage site. for example my site will be available in english and french. there is 2 options, 1. http://mysite.com/en/about-us 2. http://mysite.com/en/a-propos-de-nous

Which one of these options i should use?

The easiest one is the first, but i think the second one is more accepted. But i don't know, what do you think?

The second option challenge is that i have to enter the page url more specific and it cost time. Then in the transcribe module, i have to match if the translation is about hyperlink. Also is it good if then maybe in search engine result there will be duplicate result but with different language?

What do you think?

Thanks, .mafaik

# Answer
Without this going into an opinion based answer, the major factors will be project budget and SEO performance.

The latter URL structure is far better for SEO purposes and also for your audience (seeing the URL in their native language). To clarify this is the better URL Structure for this:

* domain/en/about-us
* domain/fr/a-propos-de-nous

Note: There are even better ways for multi-language site URLs (for improved SEO), such as unique domain names, hosting within the relevant countries, removing language identifier from default, etc. But these are much more costly to implement! Also remember to set your header and meta as appropriate.

Regarding duplicate content, have a read of this Google article, which basically states that although they'd prefer the wording to be relevant to the target audience (nationality) rather than a direct translation, you wouldn't be penalised for it.

> While we strongly recommend that you provide unique content for each different group of users, we understand that this may not always be possible.

Other answers relating to this that may help:
> 1 votes

---
Tags: multi-language
---


# Question
Title: How can I extend the life of an XID hash in EE 2.8.1?
We are using Channel Form to allow guests to submit contest entries into an EE 2.8.1 site. The form has many fields including an essay field which means it could take some time for someone to complete the form and submit it. During my own tests, I received the EE expired form error message several times when the form had only been open for a few minutes.

How can I go about extending the life of an XID hash to a longer block of time?

# Answer
1.) Ensure your server time is set correctly and check your ExpressionEngine server timezone setting. Both the form hash ID and the session ID are time sensitive. If ExpressionEngine is calculating when to expire them based on an incorrect time, your hash ID may expire much sooner than it should.

2.) Quickest way to test whether it’s due to Secure Mode is to turn Secure Mode off (in the control panel under Admin ‣ Security and Privacy ‣ Security and Sessions). Leaving Secure Mode off is obviously not recommended. But this allows you to quickly determine if Secure Mode is indeed at issue.

3.) You can also use this command ee()-\>security-\>restore\_xid(); To restore an expired XID. So you could use a timed request on your end that would restore the xid after its expired, or on submit of the form restore the xid and then submit.
> 4 votes

# Answer
Just thought I'd throw this in there for others that might find this post.

EE 2.8.1 removed the secure form option in the admin section of the CP. The only way to disable now is to add this to your config: $config\['disable\_csrf\_protection'\] = 'y';

Just some FYI.
> 1 votes

---
Tags: forms, xid, secureforms
---


# Question
Title: hook_sessions_end causing major issues on EE 2.5.5 site
Please Please Help!

We have been running around in circles trying to resolve an issue with and old EE site, all of a sudden it just stopped working admin side, hitting memory limits (even at 1G) and hitting gateway issues.

We were on 2.5.3 and hoped the upgrade to 2.5.5 might help, we would love to get it upgraded to 2.8 + but it is just not an option due the the large amount of addons that we can't update because of all the issues!!

It's all points to Zoo Visitor, but the Zoo dev team have gone through everything and believe the issue lies within the EE core??

This old thread seems to be having the same issue:

http://ellislab.com/forums/viewthread/213888/#991232

Has anyone got any ideas thoughts on how this was fixed or could be fixed?

Has anyone experienced these issues or got ideas on how we might debug.

The issues are present on both local and live versions.

Any ideas would be greatly appreciated.

Sam

# Answer
> 4 votes
Wanted to share this here because I figured it would help others debug in the future.

The problem is with the Zoo Visitor extension- it's the session\_start() function right at the beginning of the file. The server chokes on it- it also chokes on the example from the PHP docs in a completely standalone form. So my suggestion was to take it to the server admin and get that squared away on their end.

The debugging was quirky because if you took out all the code from the zoo visitor function called by the hook and just returned- it was still timing out. That made it seem the problem couldn't be with that extension.

So- I disabled all other functions using that hook:

```
update exp_extensions set enabled = 'n' where hook = 'sessions_end' and class != 'Zoo_visitor_ext'

```

Then- found the hook in libraries/Sessions.php and did some debugging:

```
    exit('done 1');

    // -------------------------------------------
    // 'sessions_end' hook.
    //  - Modify the user's session/member data.
    //  - Additional Session or Login methods (ex: log in to other system)
    //
        ee()->extensions->universal_call('sessions_end', $this);
        if (ee()->extensions->end_script === TRUE) return;
    //
    // -------------------------------------------

    exit('done 2');

```

Likewise, the function in zoo visitor had an exit. 'done 1' was fast. Comment that out- we timed out before the exit in the extension.

So- went to the Extensions library- and by the process of elimination, found that where it slows down is where it includes the extension file:

```
    // Include File
    if ( ! class_exists($class_name))
    {
        require $extension_path;
    }

```

The path was fine, so I pulled all of the code out of ext.zoo\_visitor.php and just echoed out a 'hello'. That worked fine as far as timing out went. So then it was just going through the file and finding the issue- which was the session\_start().

Make sense? It was a weird one.

We can finish this one off in support, Sam. But I figured it was worth the time to lay out how to track this one down since it was so slippery!

---
Tags: session-end-hook
---


# Question
Title: Super Search and Stash and limiting results
I am going to try my best to explain what I am trying to accomplish so I will be breaking this up into various parts.

WHAT I AM TRYING TO ACCOMPLISH:

Create a filtered list of search results into various lists. For example I want my filtered results to end up in SECTION A, SECTION B, SECTION C and so on. I will probably have 5 sections once all said and done.

Within each section I only want 3 articles to appear. I will then have a view more button to take the user to see a larger selection of entries.

HOW I AM SEARCHING MY CONTENT:

I currently have used Solspace's Tag module and tagged my articles as needed.

I then have a Super Search form searching my tags using checkboxes.

Then on my search result page I am using Stash to help me organize my entries into SECTION A, SECTION B and so on.

This is working as expected!

WHAT I AM HAVING ISSUES WITH:

My main issue at this point in time is limiting my search results per SECTION A, SECTION B and so on. I can limit my results per Super Search but that limit effects all sections meaning that I can only have 3 entries displaying across all SECTIONS combined. What I need is a total of 3 entries to be shown in each SECTION. I hope this makes sense.

Below is my sample code for my checkbox in the search form:

```
<label> <input type="checkbox" name="our_tags[]" value="reg-link" {if super_search_our_tags_reg-link}checked="checked"{/if}> Regional/Community Links </label>

```

Then in my search results page I have the following:

```
{exp:stash:set name="service-results" parse_tags="yes"}
    {exp:super_search:results channel="test" search_in="priority_tags|our_tags" orderby="test+desc+priority_tags+desc" search="limit=3"}
        {exp:tag:tags entry_id="{entry_id}"}
            {if {tag_id} == "21"}
                <div style="background-color:#efefef">
                <h3>{title}</h3>
                <p>Our Tags - {our_tags}</p>
                <p>Priority Tags - {priority_tags}</p>
                <p><a href="{path='articles/by_tag'}/tag/{websafe_tag}">{tag}</a>, </p>
                <p><strong>{search_excerpt}</strong></p>     </div>
           {/if}
       {/exp:tag:tags}
    {/exp:super_search:results}
{/exp:stash:set}

```

I display my Stash output like so:

```
{exp:stash:get name="service-results"}

```

I have also attached a screen shot of my checkboxes and of the search result area. I hope these help explain a little more what I am trying to accomplish.

Any suggestions or help is greatly appreciated! If I need to provide additional information please let me know.

Thanks in advance,

John

# Answer
Ended up creating tags for each of the form areas. Then using a jquery plug-in to help load in my information via ajax.
> 1 votes

---
Tags: stash, supersearch, tags
---


# Question
Title: Limit related_categories_mode to last child category
I'm working on a site that sells maps, and I'm using related\_categories\_mode="yes" to display similar maps to the one you're viewing. Maps can be assigned categories such as:

* Europe
* + United Kingdom
* + - England
* + - Scotland
* + France
* + Germany
* United States
* + New York ... etc ...

My problem is: If a map is marked as "Europe \> United Kingdom \> Scotland", EE displays any maps from "Europe", rather than "Scotland". I need it to be more specific and find ones in the highest category that's been assigned.

Does anyone know of a way to do this? I'm on EE 2.5.2.

Thanks!

# Answer
> 1 votes
My suggestion to you is to disable the Auto-Assign Category Parents. I **guess**, by this way, the parent categories will not be shared between the entries assigned to their children.

---

If this isn't an option, let's try to use the Query module.

We need to find which categories related to the entry doesn't have children among each other.

Using the Channel module to get the values we need to:

```
{exp:channel:entries channel="maps" limit="1"}

    {categories backspace="1"}{category_id},{/categories}

{/exp:channel:entries}

```

Now, we create a query and set the `parse` parameter of the Channel Module to `inward`, so the Query module just parses after it.

```
{exp:channel:entries channel="maps" limit="1" parse="inward"}

{exp:query sql='SELECT c1.cat_id
        FROM exp_categories AS c1
        LEFT JOIN exp_categories AS c2
            ON c1.cat_id = c2.parent_id
            AND c2.cat_id IN ({categories backspace="1"}{category_id},{/categories})
        WHERE c2.cat_id IS NULL
            AND c1.cat_id IN ({categories backspace="1"}{category_id},{/categories})'
        backspace='1'}{cat_id}|{/exp:query}

{/exp:channel:entries}

```

Let's create a `embed` around all of this:

```
{exp:channel:entries channel="maps" limit="1" parse="inward"}

{embed="pages/.related_maps"
categories="{exp:query sql='SELECT c1.cat_id
        FROM exp_categories AS c1
        LEFT JOIN exp_categories AS c2
            ON c1.cat_id = c2.parent_id
            AND c2.cat_id IN ({categories backspace="1"}{category_id},{/categories})
        WHERE c2.cat_id IS NULL
            AND c1.cat_id IN ({categories backspace="1"}{category_id},{/categories})'
        backspace='1'}{cat_id}|{/exp:query}"}

{/exp:channel:entries}

```

Since you're using an old version of EECMS, we need to take care of white spaces.

On the embed, check for the `categories` variable and get the entries:

```
{if embed:categories}
    {exp:channel:entries channel="maps" category="{embed:categories}"}
        [...]
    {/exp:channel:entries}
{/if}

```

Fucking complex, right?

You can maybe have issues with the nested quotation marks. In this case, try using this heavier query:

```
{exp:channel:entries channel="maps" limit="1" parse="inward"}

{embed="pages/.related_maps"
categories="{exp:query sql='SELECT c1.cat_id
        FROM exp_categories AS c1
        LEFT JOIN exp_categories AS c2
            ON c1.cat_id = c2.parent_id
            AND c2.cat_id IN (
                    SELECT cat_id
                    FROM exp_category_posts
                    WHERE entry_id = {entry_id}
                )
        INNER JOIN exp_category_posts AS cp
            ON cp.cat_id = c1.cat_id
        WHERE c2.cat_id IS NULL
            AND cp.entry_id = {entry_id}'
        backspace='1'}{cat_id}|{/exp:query}"}

{/exp:channel:entries}

```

To prevent this parsing issues, I suggest you to update EECMS to a newer version.

---
Tags: ee2, channel-entries
---


title: Strange STASH and Playa Behaviour :///

text:
# Question
Title: Strange STASH and Playa Behaviour :///
**UPDATE**

Looks like it's only related to the particular product page. I can add PRODUCT A to another related page. Taking a look at that next :)

## #

I'm not sure what's happening here.

SCENARIO

I have Playa and Stash working together to give me the Categories that the related entries are located.

ISSUE

PRODUCT A is added and select a Category. NOTHING appears on that particular entry page

If I change the Category of an existing product then it changes the category that's displayed.

If I add a NEW category and link PRODUCT A to it nothing appears.

If I change an existing product to the NEW Category it shows up.

Does Stash do some weird caching or something?

Trying to get my head wrapped around this one!

Here's my code:

```
{exp:stash:set_list name="product_info" parse_tags="yes" parse_depth="2"}
    {exp:playa:parents channel="products_accessories" sort="asc" orderby="title" disable="members"}
        {stash:product_url}{url_title_path='/products/accessories/'}{/stash:product_url}
        {stash:product_title}{title}{/stash:product_title}
        {stash:product_part_number}{products_accessories_part_number}{/stash:product_part_number}
        {stash:product_image}{if products_accessories_images}<div class="accessories_image">{products_accessories_images limit="1"}<p><img src="{exp:ce_img:single src='{image}'{sn_image_product_detail_accessories}}" alt="{alt}" class="img-responsive text-center" />{/products_accessories_images}</p></div>{/if}

        {if products_accessories_images ==''}<div class="accessories_image">{products_accessories_images_old limit="1"}<p><img src="{exp:ce_img:single src='/images/uploads/products/{image}'{sn_image_product_detail_accessories}}" alt="{alt}" class="img-responsive text-center" />{/products_accessories_images_old}</p></div>{/if}

        {/stash:product_image}
        {stash:product_content}{if products_accessories_content}{exp:eehive_hacksaw}{products_accessories_content}{/exp:eehive_hacksaw}{/if}{/stash:product_content}

        {!-- create an index for this product to match against --}
        {stash:categories}{categories}@{category_id}@{/categories}{/stash:categories}

        {categories}
            {exp:stash:append_list name="cat_accessories"}
                {stash:cat_id}{category_id}{/stash:cat_id}
                {stash:cat_name}{category_name}{/stash:cat_name}
            {/exp:stash:append_list}
        {/categories}
    {/exp:playa:parents}
{/exp:stash:set_list}

<div class="panel-group" id="accordion">
    <div class="panel panel-default">
{!-- list unique categories only --}
{exp:stash:get_list name="cat_accessories" unique="cat_id" orderby="cat_name" sort="asc"}
        <div class="panel-heading">
            <h4 class="panel-title">
                <a data-toggle="collapse" data-parent="#accordion" href="#collapse{cat_id}">{cat_name}</a>
            </h4>
        </div>

{!-- list products that belong to this category --}
        <div id="collapse{cat_id}" class="panel-collapse collapse">
            <div class="panel-body">
{exp:stash:get_list:nested name="product_info" match="#@{cat_id}@#" against="categories" orderby="product_title" sort="asc"}
                <div class="col-md-6 accessories_listings">
                    {product_image}
                    <h5>{product_title}</h5>
                    <p class="product_content">{product_content}</p>
                    <p class="product_number">Product Number: <strong>{product_part_number}</strong></p>
                </div>
{/exp:stash:get_list:nested}
            </div><!-- end panel-body -->
        </div><!-- end panel-collapse -->
{/exp:stash:get_list}

```

# Answer
> 1 votes
Apparently it had to do with the Limit of entries in Playa. I changed the line to this and it works now :)

```
{exp:playa:parents limit="9999" channel="products_accessories" sort="asc" orderby="title" disable="members"}

```

---
Tags: playa, stash
---


title: Playa - var_prefix question

text:
# Question
Title: Playa - var_prefix question
I'm having trouble getting var\_prefix to work with the exp:playa:parents tag.

Here's my code:

```
                        {exp:channel:entries
                        channel="skills"
                        orderby="title"
                        sort="asc"
                        category="65"
                        parse="inward"
                        disable="member_data|pagination|category_fields"
                    }
                        <p>{title}</p>
                        {exp:playa:parents
                            channel="skills"
                            entry_id="{entry_id}"
                            var_prefix="pre"
                        }
                        {if pre:total_results > 1}
                            {if pre:count == 1}
                            <a data-toggle="modal" data-target="#content-{entry_id}"><span class="glyphicon glyphicon-info-sign"></span></a>
                            {/if}
                        {/if}
                        {/exp:playa:parents}

                    {/exp:channel:entries}

```

I'm trying to achieve two things:

1. I would like to get the total\_results and count variables for the results from the playa tag and not the parent exp:channel:entries tag.
2. I would like to get the exp:channel:entries {entry\_id} inserted in this line data-target="#content-{entry\_id}" rather than the {entry\_id} from the exp:playa:parent entry.

Any help would be appreciated.

# Answer
Try removing the `parse="inward"` parameter from your `{exp:channel:entries}` tag. It may be confusing things and you don't really need it anyway.
> 2 votes

---
Tags: playa
---


# Question
Title: List of Online Users and Their Current Page?
Is it possible to get a list of logged in members along with the page that they are currently on? If possible, I'd like to filter this by page (meaning, I pass the URL of the page and I get back a list of users currently on that page). I need to display this information in the frontend.

# Answer
Check out the Continuum add-on. Note that it is still in beta, though it's at version 0.9 at this point so I imagine it will go prime-time pretty soon.
> 2 votes

---
Tags: members
---


# Question
Title: Missing Structure fields after changing channel from listing type to page type
A client wanted to be able to drag/drop the ordering of some customers on their site, so I've changed the customers channel in Structure from being a listing to being a page based channel and was going to have one "page" per customer.

The problem I'm having now is all existing (and new) rows have a Structure tab, but are missing these fields.

* "Structure parent entry"
* "Hide from nav?"
* "Listing channel"

In the channel sidebar (where you can view fields) these fields appear but have no icon next to them (the eye) and can't be dragged onto the Structure tab.

Has anyone come across this before?

# Answer
> 2 votes
Sounds like some crossed wires with your publish layout. Reset the layout, refresh the page, and try again.

---
Tags: structure
---


# Question
Title: display incomplete orders in frontend template
I want to display a list of all orders that were incomplete in a frontend template for Expresso Store. I have template that shows all orders that have been processed something along the lines of :

```
{exp:store:orders limit="2000"}
    {order_id}
{/exp:store:orders}

```

In the backend I can see that I can filter by order status == Incomplete. However, when I try to do the same in the template I don't get any results. I tried

```
{exp:store:orders limit="2000" order_status="Incomplete"}
    {order_id}
{/exp:store:orders}

```

Any help appreciated.

EDIT:

I'm now using the query module, it spits out the order id, but not the rest of the info I need. The code looks like this:

```
{exp:query sql="SELECT order_id FROM exp_store_orders ORDER BY order_date DESC LIMIT 2000"}
                <tr>
                  <td>{order_id}</td>
                  <td>{order_date format="%j %M %Y"}</td>
                  <td>{billing_name}</td>
                  <td>{if is_order_paid}Yes{if:else}No{/if}</td>
                  <td>{order_total}</td>
                  <td>{shipping_address1}</td>
                  <td>{shipping_address2}</td>
                  <td>{shipping_address3}</td>
                  <td>{billing_phone}</td>
                  <td>{order_email}</td>
                  {items}
                      {if sku == "FAM-SM" OR sku == "FAM-4-S"}
                        {modifiers limit="1"}
                            <td>{modifier_value}</td>
                        {/modifiers}
                        <td>N/A</td>
                      {if:else}
                        {modifiers}
                            <td>{modifier_value}</td>
                         {/modifiers}
                      {/if}
                      {if sku == "FAM-4-S"}
                        <td>{order_custom3}</td>
                        <td>{order_custom4}</td>
                        <td>{order_custom5}</td>
                      {if:else}
                          <td>N/A</td>
                          <td>N/A</td>
                          <td>N/A</td>
                      {/if}
               {/items}

                </tr>
            {/exp:query}

```

# Answer
> 1 votes
I don't have store installed on my sandbox to text with right this second, but worst case you could always pull this information via the exp:query module

It'd go something like

```
{exp:query sql="SELECT order_id FROM exp_store_orders ORDER BY order_date DESC LIMIT 2000"}
    {order_id}
{/exp:query}

```

You can ORDER BY whatever works, probably by order\_id itself and have a list of the last 2000 orders

---
Tags: expresso-store
---


# Question
Title: Creating an Extension - Inform custom email address on submission
I've never created an Addon before I'm finding it a little daunting, any pointers would be much appreciated.

Here's what I am trying to achieve.

I have a Channel Form in the front end that site's users submit to request approval for passing a skill. In the form they choose the name of the instructor that helped them. When they submit the form I would like the instructor chosen to be notified by email (passed along in the form) that User X submitted an entry and provide the instructor with a link to review, approve or deny that entry.

By the looks of it I need to use the entry\_submission\_end hook. I don't need any extension settings or to store anything in a custom table.

# Answer
> 1 votes
The functionality you require can actually be handled by the Postmaster add-on ($65) or possibly the MX Notify Control add-on (free).

However, if you are still interested in pursuing add-on development, as a starting point you might want to try creating a simple 'hello world' plugin first to get a sense of how add-ons interact with EE, and then perhaps once you feel comfortable with that look at how to create extensions that make use of hooks.

pkg.io is a nice tool to use that will give you a basic template for use in making your first add-on, though you might also just want to go step-by-step through the process in the EE docs here: http://ellislab.com/expressionengine/user-guide/development/plugins.html

If it all seems daunting at first, just remember to do things as simply as possible at first, make a lot of stripped-down examples and tests, and keep on building from what you learn.

---
Tags: extension
---


# Question
Title: Can't update an entry using Channel API without including title
I'm trying to update a channel entry using the Channel API function save\_entry.

```
ee()->load->library('api');
ee()->api->instantiate('channel_entries');

// Create input array
$data = array('field_id_'.$this->helper->get_field_id('booking_user') => $member_relationship);

// Update booking entry
$booking = ee()->api_channel_entries->save_entry($data, $this->channel, $booking_id);

```

This is my code and it's giving back this error

```
[29-May-2014 14:53:51 UTC] array(2) {
  ["title"]=>
  string(13) "missing_title"
  ["url_title"]=>
  string(26) "unable_to_create_url_title"
}

```

I don't want to update the title because it doesn't need to be changed.

My question is **how can I update a channel entry without including a title?**

# Answer
As per your comments, you've already figured out the rather large annoyance of needing to pass all pre-existing fields with the save\_entry function or else having them wiped out. I wanted to post an answer here though because there are a couple considerations I've come across when doing entry updates with my add-ons:

1) If you do not need the update to trigger the EE system from explicitly noticing it and then triggering other hooks or dependencies, you can just use the EE Database Class to do a simple database update query and update that particular field directly. This carries with it the added benefit that a session does not need to be initiated to make the update, so you can use this method for automated tasks or when the logged-in user does not have permissions.

2) If you DO need to update with save\_entry in order to trigger the cascade of EE hooks and dependencies and are using a database 'select all' query to fill in your old values, then to keep the edit\_date correct you need to unset the old edit\_date and let EE fill this part in automatically. I've posted an answer with some code for doing this a few weeks back, which may be of some use: Using Channel API save\_entry to update an entry
> 3 votes

---
Tags: channel, title, channel-entries-api
---


# Question
Title: Custom data not saving to members on checkout
I'm trying to save some custom member fields to EE's member section using CartThrob's checkout form.

I have created all the necessary member fields and mapped some of the basic fields in CartThrob's settings and they save just fine. Only the custom\_data inputs don't save in the newly created EE member.

Here's the gist of what my form looks like so far:

```
{exp:cartthrob:checkout_form create_user="yes" group_id="5"}
    <input type="text" name="first_name" value="" id="first_name" class="required"  />
    <input type="text" name="last_name" value="" id="last_name" class="required"  />
    <input type="text" value="" placeholder="Preferred Name" name="custom_data[preferred_name]" />
    <input type="text" value="" placeholder="DOB Day" name="custom_data[member_dob_day]" />
{/exp:cartthrob:checkout_form}

```

This was all done following CartThrob's docs and many iterations of not working. Any direction guys, much appreciated.

# Answer
You might find this post useful which shows how we approached this scenario.

Cartthrob checkout form with different billing and member information
> 0 votes

# Answer
I believe the id is missing in your custom\_data inputs.

Try it like this:

```
<input name="custom_data[whatever]" id="custom_data[whatever]" />

```
> 0 votes

---
Tags: cartthrob, members
---


# Question
Title: remove question mark with .htaccess rewrite module
i want to remove ? from url with .htaccess rewrite module.

```

http://example.com/?/test/downloads

```

in this url i want to remove **/?** . how to remove this any idea

i am using Query string in expression engine i think this is the reason so that this question mark comes.

# Answer
> 1 votes
If you are using query strings then removing the ? will stop the site working. The ? has a special meaning in URLs, what comes after it is the query string.

---
Tags: ee2, .htaccess
---


# Question
Title: Pixel and Tonic: Matrix fields not saving File/image data
Matrix version: 2.2.2.1

EE Version: v2.2.2

PHP Version 5.4.13

When I save an image to a File field, it properly saves and publishes the content. But when I return to the entry to Edit it, the matrix file data is gone.

Our server was recently force-migrated which bumped up the PHP version a bit.

Anything else I should check?

# Answer
In case this helps anyone else out there I fixed it with the same versions of EE (2.2.2) and Matrix (2.2.2.1) as the OP and with php 5.4.x and php5.5.x.

Essentially I did a diff between the latest version of Matrix (2.5.10) and a couple of older ones and tracked it down to these two parts.

**File: system/expressionengine/third\_party/matrix/celltypes/file.php**

Lines: 131 to 143

Replace this:

```
if ($this->_data_exists($data))
{
  if (is_array($data))
  {
    $filedir = $data['filedir'];
    $filename = $data['filename'];
  }
  else if (preg_match('/^{filedir_([0-9]+)}(.*)/', $data, $matches))
  {
    $filedir  = $matches[1];
    $filename = $matches[2];
  }
}

```

With this:

```
if ($data)
{
  if (is_array($data) && ! empty($data['filedir']) && ! empty($data['filename']))
  {
    $filedir = $data['filedir'];
    $filename = $data['filename'];
  }
  else if (is_string($data) && preg_match('/^{filedir_([0-9]+)}(.*)/', $data, $matches))
  {
    $filedir  = $matches[1];
    $filename = $matches[2];
  }
}

```

**File: system/expressionengine/third\_party/matrix/ft.matrix.php**

Line: 1820

After this: `$field_id = $this->settings['field_id'];`

Add this:

```
if (empty($data))
{
  $data = array();
}

```
> 3 votes

# Answer
Often problems like this are caused by the PHP Suhosin security patch, which has a configuration option to limit the number of POST variables in a single request. If you have a long publish page or lots of matrix fields it is easy to exceed this limit if it's set too low.

The way to check this is to look at your PHP Info (under Tools \> Utilities \> PHP Info in the CP) and search for Suhosin or configuration options like `suhosin.post.max_vars`. Ideally this would be set very high (say 2000+).
> 2 votes

# Answer
I was having the same issue with the following versions:

EE 2.7.2 Matrix 2.5.9 PHP 5.4.17

Upgrading to Matrix 2.5.10 fixed my issue.
> 1 votes

---
Tags: matrix
---


title: wrap pagination in class

text:
# Question
Title: wrap pagination in class
I have a basic channel and I want the pagination to be at the top.

I have got a pagination limit of 20 and output it like this

{if '{count}'=='20' OR '{absolute\_count}'=='{total\_results}'} {paginate} {pagination\_links}{/paginate} {/if}

This is fine but the pagination appears **after** the div. I really need it inside to control my responsive layout. Can this be achieved by adding a class to the pagination tag or some other way. It must be parsed last I guess which is causing the issue.

**FIXED - add the class inside the {paginate} tag I thought this would wrap around EVERY link but it just adds a wrapper**

```
{if '{count}'=='20' OR '{absolute_count}'=='{total_results}'}
  {paginate} <div class="large-24 columns"> {pagination_links}</div>{/paginate}</div>
 {/if}

```

# Answer
The position of pagination is defined by the parameter paginate:

* if it is set as `top`, the pagination code will be removed before parsing and added back at the top of the parsing results;
* if it's set as `bottom`, the pagination code will be added to the bottom of the results;
* set it as `both`and it will be... Well, I got the idea;
* `hidden` doesn't show the pagination;
* if you want to choose where to show the pagination code, set the parameter as `inline`.

The `inline` is available since version 2.6, but a lot of people doesn't know about it yet. Even I never used it.
> 2 votes

# Answer
If memory servers me correctly the EE pagination positioning is quite restrictive and thickle.

I believe i got round this in the past by letting EE render the pagination as it wants and then using jQuery to get the contents of the pagination DIV and insert it into the actual div i wanted it to appear in.

So after the page/pagination is loaded. Run a function a bit like this....

```
function movePagination() {
    $originalPagination = $("#originalPaginationContainingDiv").html();
    $("#destinationDivForPagination").html($originalPagination);
}

```

Note: I have not tested this.
> 0 votes

---
Tags: channel, pagination, parse
---


# Question
Title: current_time and edit_date are 5 hours off, PHP date() is correct
We built a site for a hospital and they can login to a special admin page where they can update location wait times using exp:channel:form

When they first login, we show the last updated time and the last wait time updated. When I output {current\_time} and the entry's {edit\_date} inside the channel loop, it's 5 hours off.

When I echo the current time using the PHP date() function, it outputs the current time in the client's time zone (PT).

Running EE v2.7.3

What could be causing the offset in the {current\_time} and {edit\_date} EE tags? I'm pulling my hair out!

# Answer
> 1 votes
After working with EllisLab support on this issue, it turned out to be a rogue config item in the database for "server\_offset" config item. It was set to -1140 for some reason.

They were kind enough to decode, unserialize, modify, re-serialize, and re-encode the variable for us and that fixed the problem.

Here's the response regarding the resolution from EE support:

I’ve traced it down to an orphaned server\_offset setting that is in your site preferences in the database of -1140. In 2.6.0 the UI for that setting was removed, but the config is still observed as there are rare situations where it’s necessary (server OS time permanently incorrect for instance). It became somewhat of a setting in the ether though without the UI, and without being in the config file. We’ve fixed this in 2.8.0, and it will extract the value from the db if it exists and place it in the config file. For some reason, it would seem that this installation had a server offset setting of -1140 prior to being updated?

In case you are not able to update soon, I’ve just overridden that value in the config.php file with:

$config\[‘server\_offset’\] = ‘0’;

And the times look correct now. After you run the 2.8.0 update down the road, though, it will extract that db value and overwrite that with -1140. At that point you can simply remove that setting entirely from your config file after the update. Make sense?

# Answer
> 0 votes
This might be what you're looking for.

Check your localization settings in the admin panel. `Admin` =\> `Localization Settings` Here's the EE help page about it: http://ellislab.com/expressionengine/user-guide/cp/admin/localization\_settings.html

If that's still a pain in your ass, you can force it in the config.php file. See this: http://ellislab.com/expressionengine/user-guide/general/system\_configuration\_overrides.html#default-site-timezone

But you can also set localization on the user, so check your own settings there, just in case.

---
Tags: channel-form, datetime, timezone, edit-date
---


title: MX Google Maps fieldtype problem

text:
# Question
Title: MX Google Maps fieldtype problem
I'm updating a site from ExpressionEngine 2.1.1 to 2.8.1. The previous version of MX Google Maps was 1.0b I've installed version 1.5.3.140526

The exp\_fieldtypes table shows version 1.0b installed but if I check the Fieldtypes page in ExpressionEngine it shows 1.5.3.140526 as the version. When I click on the fieldtype I get 2 PHP errors:

```
A PHP Error was encountered
Severity: Warning
Message: call_user_func_array() expects parameter 1 to be a valid callback, class 'Mx_google_map_ft' does not have a method 'display_global_settings'
Filename: api/Api_channel_fields.php
Line Number: 397

```

and

```
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /Users/Josh/Sites/website/webroot/system/codeigniter/system/core/Exceptions.php:170)
Filename: core/Common.php
Line Number: 446

```

# Answer
My apology - looks like with one of update I missed procedure for version \<1.3.4. It is no more global settings in MX Google Map (most of them was replaced with ee config.php varibles). I will add this update function in next build.

Right now you can just run next query

```
update exp_fieldtypes SET has_global_settings = 'n' WHERE name = 'mx_google_map'

```

You can do this directly in EE CP -\> tools -\> data -\> sql man
> 3 votes

---
Tags: upgrade, updating, mx-google-map
---


# Question
Title: Solspace Calendar: Only show next occurrence of recurring event in list of recurring and non-recurring events
I have another interesting challenge to solve with Solspace Calendar and I've not been able to find a solution so far, which is not to say there isn't an obvious solution I've missed.

I have a custom field on events (event\_featured) which allows an admin to flag individual events as 'featured' and I want to show a list of these featured events on the homepage. However, if an event is recurring, I **only want to show the next occurrence** of that event and not *all* occurrences.

On the homepage, I'm pulling out a list of the featured events with this code:

```
{exp:calendar:cal date_range_start="today" date_range_end="2 years" enable="custom_fields"}
  {if event_featured == "y"}
    <li>
      <h3><a href="{path='events/event'}/{if edited_occurrence}{event_parent_id}{if:else}{event_id}{/if}/{event_start_date format="%Y/%m/%d"}">{event_title}</a></h3>
      {if event_all_day}<time class="eventdate" datetime="{event_start_date format="%Y-%m-%d"}">{event_start_date format="%l %j<sup>%S</sup> %F %Y"}</time>
      {if:else}<time class="eventdate" datetime="{event_start_date format="%Y-%m-%dT%H:%iZ"}">{event_start_date format="%l %j<sup>%S</sup> %F %Y <i>at</i> %g:%i%a"}</time>{/if}
      <p class="description">{event_summary}</p>
    </li>
  {/if}
{/exp:calendar:cal}

```

This correctly displays events that are flagged as featured but obviously if an event is recurring, it shows all future instances. Can anyone suggest a solution?

# Answer
> 1 votes
Another way of interpreting the question might be "how to display events in chronological order, but with each different event appearing only once, regardless of how many occurrences it has in the timeframe".

One approach is to use PHP to create an array of unique events, and display your event data only when the event is encountered for the first time in `{exp:calendar:cal}`. Here's an example (turn on PHP for your template and set it to **Output**):

```
{!-- Create the arrays --}
<?php
    $event_ids = array();
    $event_data = array();
?>

{!--
    // Check if the event was already encountered (i.e. is in the array),
    // and store your data in a separate array if this is the first time
    // encountering this event
--}
{exp:calendar:cal /* your other parameters here */}
<?php
    if( ! in_array('{event_id}', $event_ids) )
    {
        $event_ids[] = '{event_id}';
        $event_data[] = '* The data you want displayed';
    }
?>
{/exp:calendar:cal}

{!-- Display event data, still in chronological order --}
<?php
    foreach($event_data as $data)
    {
        echo $data;
    }
?>

```

Of course there are likely other strategies, using PHP, Stash, or other means, but the main idea is to create a list/group/array of unique events within your timeframe.

# Answer
> 1 votes
I wanted something very similar - a list of related events (defined by an earlier created stash) that showed a chronological list of only the NEXT 'occurrence' of each event. I saw this thread, but being new to PHP couldn't follow the example because I didn't know how to extrapolate all the $data variable to where I could build up the actual HTML I wanted... so in case anyone else in my shoes finds this later on, I wanted to share my code that hopefully explains well enough for a noob:

```
<!-- Create array to hold data from each related event against the Event ID -->
<?php $events = array(); ?>
{exp:calendar:cal
    date_range_start="today"
    date_range_end="1 year"
    pad_short_weeks="n"
    enable="custom_fields"
    event_id="{exp:stash:get name="stash_related_events"}"
    dynamic="no"}

    {events}
        <!-- Populate array with individual event details - this will include all occurrences, but we'll remove duplicates in PHP -->
        <?php $events['{event_id}'] = '{event_id}~~{event_title}~~{event_summary}~~{event_image:Medium}~~{event_location}~~{event_start_date format="%F %j, %Y"}~~{event_start_date format="%g:%i%a"}~~{event_end_date format="%F %j, %Y"}~~{event_end_date format="%g:%i%a"}'; ?>
    {/events}

    <!-- Reverse order of array because they're backwards for some reason (??) -->
    <?php $events = array_reverse($events); ?>

    <!-- Loop through each unique event_id in the array to get desired list -->
    <?php foreach($events as $event_id => $event_data) :?>

        <?php
            // Extrapolate data in the array to have usable variables using ~~ as the delimiter
            list($event_id, $title, $event_summary, $event_image, $event_location, $event_startDate, $event_startTime, $event_endDate, $event_endTime) = explode('~~',$event_data);

            // Check for empty image
            if ($event_image == "") { $event_image = "../../images/uploads/eventImages/_Medium/event-default.jpg"; }

            // Format Date/Time entry
            $event_dateTime = "";
            if ($event_startDate == $event_endDate){
                if ($event_startTime == "12:00am" && $event_endTime=="12:00pm"){
                    $event_dateTime="All day ".$event_startDate;
                } else {
                    $event_dateTime=$event_startDate." from ".$event_startTime." to ".$event_endTime;
                }
            } else {
                $event_dateTime="From ".$event_startDate.", ".$event_startTime." to ".$event_endDate.", ".$event_endTime;
            }

            // We could build up HTML inside PHP using either syntax below...
            // echo "<h2>".$title."</h2>";
            // echo "<h2>$title</h2>";  Same as above
        ?>

        <!-- But instead we'll build up HTML here and insert variables where necessary -->
        <div class="event item clearfix">
             <h2><a href="../../events/event/<?php echo $event_id ?>"><?php echo $title ?></a></h2>
             <h4 class="eventDateTime"><?php echo $event_dateTime ?></h4>
             <div class="eventImage">
                <a href="../../events/event/<?php echo $event_id ?>"><img src="<?php echo $event_image ?>" alt="<?php echo $title ?>" /></a>
             </div>
             <p>Location: <?php echo $event_location ?></p>
             <p>Summary: <?php echo $event_summary ?><p>
        </div>

    <?php endforeach; ?>

{/exp:calendar:cal}

```

Hope this helps someone save the amount of time I spent on this!

---
Tags: solspace-calendar
---


# Question
Title: Is it possible to use ExpressionEngine with an Oracle database?
I don't want to be forced to use Drupal. I would appreciate it if someone could shed some light.

# Answer
> 2 votes
Nope - ExpressionEngine requires MySQL or a compatible drop-in replacement.

---
Tags: database
---


# Question
Title: Unable to load the requested file: account/login.php
I get this error out of the blue, when trying to login to the CP, possibly because the ISP made some updates to PHP/MYSQL.

An Error Was Encountered Unable to load the requested file: account/login.php

EE is version 2.1.6 - an older customer site, has been stable for a number of years, has lots of new entries every day. No dev work going on.

Customer can't go to a later EE version until later this year. Rolling backups are taken each working day and kept for five days. The earliest backup in the current series also throws the error, which mmeans that last successful superadmin login was more than five days ago.

The front end appears to be unaffected according to the customer.

ANy pointers as to where to start looking appreciated. Similar report affecting EE 2.7.2, made on Ellislab forum in February has no replies.

# Answer
Just had to re-install the CP default themes - no idea how they were lost - since a number of folders involved, it must have been something I did while sleepwalking?? Still, idiotic error message when the problem is a missing theme.
> 1 votes

---
Tags: ee2
---


title: site's system not coming up correctly

text:
# Question
Title: site's system not coming up correctly
Thanks for helping me with my htaccess issue before and I hope you can help me once more.

A little background, I am attempting to have my local machine and staging mimic the production site.

I have been able to make the local machine work perfectly and I was on my way to do the same for the staging server.

I had logged into the site dev.example.com/system and I was configuring everything to point to dev.example.com, instead of the production site - www.example.com

After submitting the Admin\> General Configuration - I briefly saw a prompt about config, but somehow it disappeared before I read.

Now, going into system looks like an html file that is missing a css file - like a directory tree.

Firebug in firefox is showing that it can not find items in the themes folder.

```
"NetworkError: 404 Not Found - http://dev.example.com/themes/cp_themes/default/css/jquery-ui-1.8.16.custom.css?v=1400856569"

```

jquery...0856569

```
"NetworkError: 404 Not Found - http://dev.example.com/themes/cp_themes/default/css/global.css?v=1400856569"

```

global...0856569

```
 "NetworkError: 404 Not Found - http://dev.example.com/themes/javascript/compressed/jquery/jquery.js?v=1400856579"

```

jquery...0856579

etc...

Any ideas - thanks in advance

# Answer
> 1 votes
As I said in my comments:

I was still able to click on Admin\> General Configuration link which showed a very basic form, when I entered the correct path, I was once again told that I had to set the config.php to 666, which I did and everything is fine. Thanks guys - I am a true newbie to ExpressionEngine - thanks for being there

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