What i am looking to do is run some code every time a page of the /system/ is loaded. If i could run it as soon as the user signs on or after every time the “Publish” button was used that would be ideal.
Basically set up like a cronjob but it wont run unless you sign on, post, or update an entry.
Anyone have an idea as to where i should put this code beside throwing an include(“foo.php” inside of system/index.php
Thanks i got it to work just too well. So well that once i enabled the extension my code is the ONLY thing that ran. After some digging in jquery i got a working example and got it working. Thanks for pointing me in the right direction.
Here is my solution just in case any oen else is looking for this.
in side your function activate_extension()
$DB->query($DB->insert_string('exp_extensions',
array(
'extension_id' => '',
'class' => "extension_name",
'method' => "shoulddothiswhenit_ends",
'hook' => "show_full_control_panel_end",
'settings' => "",
'priority' => 10,
'version' => $this->version,
'enabled' => "y"
)
)
);
In side your class
function shoulddothiswhenit_ends($html)
{
return "foo bar ".$html;
}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.