Hot answers tagged

11

There are a couple of ways to create plugins which return entry IDs like that. The first, and most obvious, is for your plugin to return a pipe-separated list of entries, which is then passed to a channel entries tag. In your plugin file: $tag_vars = array(array('search_entry_ids' => '4|6|12|19')); $this->return_data = $this->EE->TMPL->...


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

You probably don't need to build your own plugin for this. If that logic is all you have to worry about then Switchee and a couple of regular expressions are all you need. {exp:switchee variable="{segment_1}" parse="inward"} {!-- Seg 1 = empty. Embed homepage template. --} {case value="''"} {embed="embeds/homepage"} {/case} {!-- ...


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

The full array of tag params is stored at $EE->TMPL->tagparams. So you can grab them like so: // Get the EE instance $EE = get_instance(); // Get all of the current tag params $all_params = $EE->TMPL->tagparams; From there you can loop through and find all of the params that begin with “search:” like this: // Find all of the search:xyz params $...


5

Unfortunately, and I use that statement loosely, I don't believe so. In fact, some of the WYSIWYG editors may even remove double spacing after a period. Why? Because, technically speaking its bad practice. Everyone who follows or attempts to follow the standard rules of typography, The Complete Manual of Typography: A Guide to Setting Perfect Type by James ...


5

I would suggest bundling all of your custom functionality for the project into one add-on (more on this thinking) - then you can use EE's helper implementation for this. (Have a look at the recommended add-on directory structure.) In your add-on package, add a helpers directory, and in it place one or more PHP files which contain your function(s). Be sure ...


5

Your EE tag can only output the jQuery snippet. It cannot run jQuery server-side and produce the width value for you to use. The jQuery snippet will run in the browser when the page loads, after the EE tag has rendered. You cannot gain access to a jQuery/client-side value in server-side code before the page has been rendered. You should just keep this in ...


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

You can use a custom query to fetch the titles and url_titles on the channel_titles table. It has a year, month and day column. If you need custom fields too, then you could only fetch the entry_id's and feed those to an embed, for a regular channel:entries tag. edit (example) On this day:<hr> {exp:query sql=" SELECT title, url_title, year ...


4

Take a look at the fetch_param() method in the Template library. There you can see all it does is return the value of the given key in the tagparams array, offering a fallback default. So, it should be completely safe, unless EllisLab decides to make it a private property, which I doubt they'll do.


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.


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