20

$this->EE->config->item('site_id'); Or config_item('site_id');


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


17

That should work fine, but you can also check the REQ constant (docs) which has the following possible values: CP - Control panel requests PAGE - Frontend template requests ACTION - Module actions, e.g. mysite.com/?ACT=123 For example: if (REQ == 'CP') { return FALSE; }


11

In this case, I think building your own settings table is the way to go for sure. Using the settings column should really only be for very minor yes/no types of settings, not storing actual data. Especially when you get into supporting MSM, where you need settings for each site, it can get hairy fast. Plus, then your data is more easily searchable and ...


10

Yes. For example.... $hooks = array( "template_fetch_template" => "template_fetch_template", "typography_parse_type_end" => "typography_parse_type_end" ); foreach ($hooks as $hook => $method) { $data = array( 'class' => __CLASS__, 'method' => $method, 'hook' => $hook, ...


8

This is array_keys($row): Array ( [0] => template_id [1] => site_id [2] => group_id [3] => template_name [4] => save_template_file [5] => template_type [6] => template_data [7] => template_notes [8] => edit_date [9] => last_author_id [10] => cache [11] => refresh [12] =&...


7

Loading assets within an add-on can be tricky if you don't know how to do it properly. For instance, your code is likely failing because it's relying the CP (control panel) to serve the assets. So, if the CP class is not instantiated, your code will fail. I suggest you take a look at Theme Loader, my open source library I use for all my add-ons. It works ...


6

There are no existing extensions that I'm aware of that can handle this functionality. Currently promo code discounts are applied to a whole order, not individual items. However, it would certainly be possible to write something in PHP to handle this using the extension hooks.


6

This is a bit of an undocumented feature, but it works like this. In your extension, add a class variable called $required_by, with an array of values: $required_by = array('module'); ('module' is actually the only acceptable array value here, as neither plugins nor accessories have installation routines, which are needed for this to work.) Note that ...


6

dashEE - is fully customizable ExpressionEngine control panel dashboard alternative. Module comes with 8 default widgets but you also have the ability to develop your own tailored to your needs. In addition to developing your own stand along widgets you can also incorporate dashEE widgets into your existing custom EE modules instantly making your ...


6

open file /system/expressionengine/third_party/ext.sh_member_group_tabs.php and change line 270: if (APP_VER >= '2.6.0') to if (version_compare(APP_VER, '2.6.0', '>=')) it is also needs to make search & replace for APP_VER >= '2.6.0' & APP_VER >= '2.8' and replace it with version_compare(APP_VER, '2.6.0', '>=') & version_compare(...


5

I would assume so. Instead of asking yourself what hook replaces what hook, ask yourself if this describes the hook you need: Additional processing after entry submission, after all processing, prior to redirect. If so, entry_submission_absolute_end should be the hook you want :-) You'll get the _entry_id, an array of meta data and an array of actual ...


5

I'm not quite as trusting with the way the fields labels handles JavaScript over say the way it handles HTML which, by the way, handles nicely. Anyways, I will add another option here for future reference as I think it could be helpful either way: As I mentioned in a comment on another question you could write an extension which uses the cp_js_end hook ...


5

OK I found the bug. I'll get in touch with Digital Wax Works to update the add-on, but in the meantime here's your fix: Open up /system/expressionengine/third_party/eehive_flickr/pi.eehive_flickr.php, and at around line 310 you should find: // Retrieve favorites from Flickr $favorites = $f->favorites_getPublicList($flickr_settings['option_nsid'], NULL, ...


5

Have you checked all of your installed add-ons for updated versions? White screens are also typically a sign of hidden errors, so make sure that display_errors is enabled in your PHP environment, and set the $debug value in the admin.php file to 1. That may reveal a PHP error that identifies the problem. If that doesn't help, and you think you have the ...


5

This was driving me insane but I've figured it out. You need to edit the $entry object (1st parameter of the function) in order for this to work. You can, however, use the 2nd parameter, $values, for easy reading of the data. public function before_channel_entry_save( $entry, $values ) { // Set value for specific field name $entry->setProperty( '...


4

The entry_submission_start hook doesn't pass an $entry_id, because the entry should not have been saved yet. It only passes a $channel_id and a boolean value for $autosave. (Docs.) I see your function (which is presumably the function you've installed as the callback for entry_submission_start in your extension) is expecting three parameters ($entry_id, $...


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

I can think of two ways to do this. One is to use Resource Router. Your config would look something like this: $config['resource_router'] = array( ':num' => function($router, $wildcard) { $query = ee()->db->select('url_title') ->where('entry_id', $wildcard->value) ->where('channel_id', 1) // use the right channel id here ...


4

ref: https://docs.expressionengine.com/latest/development/legacy/libraries/cache.html#class-methods ee()->cache->delete('/myaddon/');


3

You can pop your JS into the instructions of one of the fields on that form. Will be the quickest solution IMO. OR you can use this Extension to add custom CSS/JS to the CP: http://devot-ee.com/add-ons/cp-css-js


3

I've not attempted to implement HttpOnly cookies with EE, but doing so should be relatively straightforward. If you go to line 805 of Functions.php you'll see the setcookie() call EE uses. Directly above that is the set_cookie_end hook. As that receives the $data array of cookie params it would be trivial to create an extension with a custom setcookie() call....


3

A quick solution is to pop the code into the field's instructions. It will show on adds/edits if you do that. You might be able to create a conditional based on the url to not run it on edits. EDIT: Added screenshot


3

There is also Bookmarks module, but it also does not allow you to create sets of bookmarks. I would use different approach: create a channel named "Lightboxes" with custom field that will hold relationships with entries use Safecracker to create a lighbox have some code that will add entries to relationships custom field in lightbox entry


3

I have this method defined in my extension class There it is! Action methods are only valid if they belong to a module (either mod.classname.php or mcp.classname.php). They will not work if they live in an extension or plugin.


3

Since Last Visit "Attempts to point out various actions that have happened since a visitor's last visit to your site." http://devot-ee.com/add-ons/since-last-visit Otherwise you'd need to roll your own plugin that taps into the Session Class: http://ellislab.com/expressionengine/user-guide/development/usage/session.html Specifically looking at this ...


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

I managed to fix this. My problem stemmed from an incorrect class name and missing a critical bit of code which inserted the necessary information into the extensions table. I needed to insert; ee()->db->insert('extensions', $data); within the activate_extension method The extension wasn't showing as 'Enabled' in the CP because the class name was ...


3

The code you have should work fine. I've just run a test on a module and it loads fine in EE v2.5.3 (either in a method or in the class constructor). I've just had a quick read of the EE changelog and can't see any reference to changes there, so don't think it's version related. Are you sure it's not calling the Class and then doing something unexpected? I ...


3

You're using the wrong hook. Try using entry_submission_start and/or publish_form_entry_data Update: Abort the channel entry publish process? Head-scratcher: manipulating new/updated entries after submission


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