Hot answers tagged

11

The upgrade from EE2 to EE3 is a major step - from EE3 to EE4 not such a big one. So getting your site to EE3 is the thing to focus on. How hard this will be will very much depend upon how your EE2 site is set up, and in particular what add-ons you are using. To be able to upgrade to EE3 you need to get your copy of EE2 up to a late version (I think 2.10....


9

$variables[] = array('variable_name' => 'Your value'); $variables[] = array('variable_name' => 'Different Value'); $variables[] = array('variable_name' => 'Another one'); $this->return_data = $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $variables); It is important to not manually specify indexes for the $...


7

Fixed it by changing this line: function usage() To this: public static function usage() Source: https://support.ellislab.com/bugs/detail/20352/plugins-through-php-warning-with-strict-errors-on


6

According to http://uk1.php.net/preg_replace , the /e modifier was removed in PHP 5.5.0 . If you downgrade PHP to pre-5.5.0, then the error will go away. Alternatively, in your config.php file set error_reporting(E_ALL ^ E_DEPRECATED); to hide deprecated warnings. Alternatively, upgrade Textile - but it looks like http://devot-ee.com/add-ons/textile-editor-...


5

There are a few possible solutions available here: 1. Global variable approach Amend your plugin so that it sets a global variable instead of/as well as returning the value directly. This ensures that it is parsed very early so you can use it as {cid} in tag parameters. You can set a global EE variable like this in your plugin: $this->EE->config->...


5

I was almost certain that Custom System Messages was causing this problem. The template offline message could be set in the preferences, but it was not. As Custom System Message has a greater priority over EE offline template, and no template was set, it was not working. The template was set inside Custom System Message The problem is solved.


5

Channel Images can do that and a lot of other neat stuff: http://www.devdemon.com/documentation/channel-images


5

The CE Image plugin has a watermark functionality (and much more), check 'watermark' on this page: http://www.causingeffect.com/software/expressionengine/ce-image/user-guide/parameters


4

Yes this is possible. It took me a while to find some documentation when I first tried to do it within a plugin. You need to look at the docs for the template class instead of the plugin API. Specifically the section for variable pairs. You need to create a multidimensional array that contains the different rows for your variable pair. Here's some relevant ...


4

Yes: use the sessions_end hook. It runs on every page load. Be sure to check to see if you're using it on the front-end before you set your cookie (I assume you want this for the front-end only). if(REQ != 'CP') { // do your stuff }


4

You want to use the EE->TMPL->parse_variables function. Here's an example block public function reggy() { $variables = array(); $tagdata = $this->EE->TMPL->tagdata; $variables[] = array('head_type' => 'horse mask'); return $this->EE->TMPL->parse_variables($tagdata, $variables); } You can define other replacement ...


4

If they are static variables, you could store them in the construct and refer to them like this: function __construct() { $this->var1 = "data"; $this->var2 = "data"; $this->query = "select * from table"; } function getVar1() { return $this->var1; } function getVar2() { return $this->var2; } // below has not been tested, but it ...


4

What you're trying to accomplish would be better served using a module, instead of plugins in a template. With a module, you can create a true form action and use pure PHP, rather than fighting the template parser with the spaghetti you've got here. There are good docs on building a module: http://ellislab.com/expressionengine/user-guide/development/modules....


4

You should be able to do this with the query module in a template (or with a query directly to your database, of course). Something simple like this should output what you need: {exp:query sql="SELECT email FROM exp_mailing_list WHERE list_id = '1'"} {email} {/exp:query} EDIT To improve this furher, you could use the Download Content plugin like this: {...


4

is not possible that some add-on can be affected on this. You need to be sure, that you are not login as SuperAdmin. Because Super Admin can see site even in offline.


4

You shouldn't see the site in online mode if you have set $config['is_system_on'] = 'n'; in your config.php file. If you are seeing the site, I'd guess one of the following is true: You are editing the wrong config.php file You are still logged into the control panel as a SuperAdmin. Clear browser cookies to be sure and confirm that you see the login ...


4

I'm no expert, but I don't think numbers that start with a zero are programatically treated as integers (some Googling suggests they are treated as something called Octals). In your case, unless you need to do mathematical operations on those values, why not just declare them as strings by putting quote marks around them? private function ...


4

Shine PDF Documentation Shine PDF uses the mPDF library to generate a PDF on-the-fly from an ExpressionEngine template. At its core, Shine PDF is simply a tag pair that accepts channel:entries parameters and outputs entry data accordingly: {exp:shine_pdf:make channel="good" url_title="vibes"} ... {/exp:shine_pdf:make} ...but let's take a closer look at ...


4

After setting the return data, you need to return program control to the Template class, which ends execution of the current method. if ($date[2] == 25 && $date[1] == 12) { $this->return_data = '<p>Sorry, there are no sailings on Christmas Day.</p>'; return; } Incidentally, it isn't necessary to set the $return_data class ...


4

You can do this by developing your add-on as a module rather than a plugin since only modules can use EE actions. (See the EE docs for an explanation of the difference between the types of add-on.) More info on EE actions here. Essentially, you need to develop a module to perform your desired action, then call the associated ACT URL (e.g. http://example....


4

You can make a module - like Steve advice. Use Yeoman ExpressionEngine Add-On generator to simplify developing process. On server you will need to setup cron with wget: execute cronjob every day at 3am 00 03 * * * wget http://example.com/index.php?ACT=XX&task_id=1 Or if you want something really quick and simple: Create a special template with some ...


4

I found the answer. Devotee has a list here.


4

you need to add a addon.setup.php file to the folder. https://docs.expressionengine.com/latest/development/addon_setup_php_file.html


3

If you upgrade to the current version, 2.5.5, it is bundled within the install.


3

The changelog says: Deprecated methods: Security helper’s do_hash(), use PHP’s hashing functions instead. Removed Methods: Functions::hash() The link you provide shows that do_hash() uses SHA1 by default. So: $encrypted_password = hash('sha1',stripslashes($user_info['password']));


3

Use Session Caching. http://ellislab.com/expressionengine/user-guide/development/usage/session.html#id4 You can initialise it first, but I've found it works fine with out this: //### Setup the page loading Cache ### if(!isset($this->EE->session->cache)) $this->EE->session->cache = array(); if(!isset($this->EE->session->cache[...


3

You can do it with the following example code within your plugin: require_once PATH_THIRD."modulename/modulefilename"; $obj = new ModuleClass(); $obj->module_method(); Hope, it would help you.


3

You need to make a folder in your system/expressionengine/third_party folder called auto_acronym and place your plugin file in there.


3

From the plugin file in EE 2.7: This plugin parses text using Markdown and Smartypants. To use this plugin wrap any text in this tag pair: {exp:markdown} Text to be **parsed**. {/exp:markdown} There are two parameters you can set: encode_ee_tags - ('yes'/'no') defaults to 'yes', when set to 'no' allows EE code to be rendered smartypants - ('yes'/'no') ...


3

If you look at the documentation a bit more carefully, you'll see that the {case value="xxx"} tags only use a single = sign. So, this should work {exp:switchee variable = "{champions}" parse="inward"} {case value="team 3"} <p>team 3</p> {/case} {/exp:switchee}


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