<?php
//init plugins system
include "init.php";
//place this where you want to execute hooks for "test"
$SHP->execute_hooks('test');
//your application code
echo "<p>some hardcoded stuff</p>";
//execute hooks for "test1" only if there are hooks to execute
if ($SHP->hooks_exist('test1')) {
$SHP->execute_hooks('test1');
}
else {
echo('<p>no hooks for test1!!!</p>');
}
//execute hooks for "test2" only if there are hooks to execute
if ($SHP->hooks_exist('test2')) {
$SHP->execute_hooks('test2');
}
else {
echo('<p>no hooks for test2!!!</p>');
}
//execute hooks for "test2" only if there are hooks to execute
if ($SHP->hooks_exist('with_args')) {
echo $SHP->execute_hooks( 'with_args', date('H:i', time()) );
}
else {
echo('<p>no hooks for test2!!!</p>');
}
?>
|