Hot answers tagged

19

So, when I'm doing BR related add-ons - I work in isolation a lot of the time only hitting BR once and then using Action ID's to perform the development test work. So, first thing you're going to need to do is create your hook as normal and install an empty add-on. You'll need to do this anyway, so it makes sense to do it. You also want to register the ...


9

I'm not an .htaccess guru, but we worked with someone to develop a base .htaccess file for use with our clients, and they all contain this ## MOD REWRITE BASE ## Checks for file/folder before serving pages in ExpressionEngine RewriteEngine On RewriteCond $1 !\.(gif|jpe?g|png|txt)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d ...


9

Ok, this is something it looks like Ellis is not ready to really let people do even though it's in documentation, except perhaps developers who would provide via a full add-on installer and handling. However, it is possible. a. First, there is an EE interface to install new button features, but it is not called anywhere, Addons_installer:install_rte_tool. ...


8

You need to find and remove some calls to the error_reporting() PHP function. This is set by the main index.php file in EE, and is often changed by extensions and other add-ons. You'll need to search through your whole codebase to make sure to remove all of these calls. The main culprit is the following section of index.php. When you have $config['debug'] = ...


8

You shouldn't be declaring functions inside your __construct() method. Move sliceurl a bit further down, and call it using $this->sliceurl (since it's part of your class): class Youtube_id_from_url { public $return_data = ""; public function __construct($urltag = NULL) { $this->EE =& get_instance(); if (empty($...


7

Sorry for the super simple answer, but I would just abstract your logic so you could execute the same function with the cron job as you would with the template tag. By creating an EE module you could create an ACT id to execute the cron job script, and use the plugin portion for the template. A common library would be the two that links it all together. ...


7

You can't set up Snippets, but you can set up Global Variables in your config.php file. Below is a code example from this blog post titled ExpressionEngine config.php. $default_global_vars = array( // Tag parameters - Short hand tag params 'global:disable_default' => 'disable="categories|pagination|member_data"', 'global:disable_all' ...


7

$this->EE is referring to the EE singleton object that basically powers everything in EE. You need to reference the global object from memory. $this->EE =& get_instance(); If this doesn't work, then be sure you are executing your code within the EE bootstrap (within a module, plugin, extension, library, or some other approved place).


7

Totally agree with Steven's comment, I'll give my own answer though as we recently went through similar. We were migrating to a new server and took the opportunity to build php 5.5 on the server to skip a version and save us the hassle of any major version upgrades again anytime soon. Here was our strategy. Upgrade all sites to latest EE build Upgrade all ...


6

Here are 3 quick/easy options: USING PHP This question on Stack Overflow sounds like what you're wanting to do: Use php to trigger another php script, then ignore USING CURL Another method would be to use CURL. Here's a Stack Overflow answer with an example. USING JAVASCRIPT Another method is using JS/jQuery. This answer on Stack Overflow shows example ...


6

Try this: <?=fixFloat($progress) <= 100 ? fixFloat($progress) : 100?> That code says: "if fixFloat($progress) is less or equal to 100, then output fixFloat($progress), otherwise output 100". Updated by Nonprofit Tech: I used both @Justin's and @GDMac's response. For the progress bar, I added the max-width: 100%; to the inline style. But the ...


5

The parse_variables function handles this natively so there's really no need to complicate things unless you need some additional functionality. The template class documentation includes some detailed instructions, but basically you just need to add a my_fields array to your main array of variable data. $vars['title'] = 'My Title'; $vars['my_fields'] = ...


5

I think I found it in the Code-Snippets in mod.forum.php starting at line ~1770 // Is this a forum view? AND the snippet starting at line ~1810 // Is this the thread view? … just delete or comment-out the code starting with: $crumbs .= $this->_crumb_trail( … … where you find forum_path('/viewcategory… inside. That's the crumb with the Category in it. ...


5

You should do this in an Extension instead - an extension on the sessions_end hook (which is called near the beginning of every request to the site, just after the Session library has finished loading). You could then create new Global Variables before any template parsing begins, and which would then be available to all of your templates. Extensions are ...


5

That's because SLASH is actually the encoded form of /. Here's how it's set: define('SLASH', '&#47;');


5

In addition to installing EE on a subdomain, it's also perfectly possible to install it in a subdirectory rather than at web root. You could just install it in a suitable directory with a name not used as a route in Cake, eg /content/ etc. This has the advantage of keeping your domain consistent for end users, with fairly minimal mucking about, though you ...


5

If I'm interpreting your setup correctly, Jack, it seems you have the right basic setup and it may just be a couple of small edits you need to make to your setup to have the links work the way you intend. First, go into Admin > Channel Administration > Global Preferences and ensure that you set "Use Category URL Titles In Links?" to yes (otherwise, rather ...


5

The methods you want to use in order to have a tag pair is: //To loop over multiple items with variables //inside each (eg: looping through entries $this->EE->TMPL->parse_variables($template, $data); //To show a single item with multiple variables within it $this->EE->TMPL->parse_variables_row($template, $data); Most of the time you ...


4

If displaying, one option could be to use the Nice Date plugin by low http://gotolow.com/addons/low-nice-date/docs which will displays date given a formatting.


4

No, you can't generate them dynamically but you can use Snippet Sync or Libraree to use snippets as files and port them into other projects. I use Libraree as part of my base install with a couple base snippets for a header and footer that I carry through projects. Using config overrides (Focus Lab's Master Config) I set where to store the files and edit ...


4

One option would be to use the APP_VER constant. You can see it here with a few other version constants as well: http://ellislab.com/expressionengine/user-guide/development/constants.html#version-constants This will give you the version number with decimals unlike Adrian's solution so, pick which route you'd like. For example: if (APP_VER == '2.5.3') { ...


4

The culprit is probably $site_pages['templates'][$eid]. A couple of obvious things to check would be: What's in the templates array? Find out with var_dump($site_pages['templates']); Check where $eid is set. It's a bit of a leap of faith, but since the error looks like it relates to a template that isn't there, is there any chance you've assigned that page ...


4

There are multiple PHP settings you should change to allow for larger file uploads: upload_max_filesize max_input_time memory_limit max_execution_time post_max_size This page gives details.


4

GROUP_CONCAT is your friend. Instead of returning multiple rows of entry IDs, GROUP_CONCAT lets you return a single row containing a concatenated string of a single field, like entry_id, like in this example: {exp:query sql="SELECT GROUP_CONCAT(DISTINCT entry_id SEPARATOR '|') AS entry_ids FROM exp_channel_titles WHERE channel_id = 1 ...


4

So here's what I've found out: EE uses an INT database field to store a UNIX timestamp Because of this, EE can display dates back to about 1901 Switching the database field from INT to BIGINT fixes the problem, but can dramatically increase the size of that database table I discovered the INT vs BIGINT fix through a web search and tested it with success. I ...


4

Yes, as long as the template in which you put the snippet has PHP enabled.


4

It won't work at all. EE 2.7 (and most add-ons built for it) use features only available in PHP 5.2+, probably most notable is json_encode which EE uses a lot internally. Some add-ons such as Store 2 even require PHP 5.3 as minimum now. Personally I would ditch the host and find one who takes software updates (and therefore server security) more seriously. ...


4

This is easily accomplished using the start_on parameter. If the start_on date/time should be current time use: {exp:channel:entries channel="events" limit="3" sort="asc" start_on="{current_time format='%Y-%m-%d %H:%i'}" show_future_entries="yes" } If the start_on date/time should be dynamic, enable PHP in the template and set it ...


4

If you add parse="inward" to your channel entries tag parameters, it will force module tags inside your parameters to be parsed before the channel entries tag.


4

Turns out, this has nothing to do with Store at all. Found my answer on StackOverflow: Since PHP 5.3.9 there's a new configuration setting called "max_input_vars" which limits the number of input variables. The default setting is 1000. Also check if Suhosin is installed, because there's also a similar setting.


Only top voted, non community-wiki answers of a minimum length are eligible