init 4chan
This commit is contained in:
commit
c850337f1e
390 changed files with 195936 additions and 0 deletions
28
plugins/yotsuba_plugins.php
Normal file
28
plugins/yotsuba_plugins.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?
|
||||
|
||||
// yotsuba plugin API
|
||||
|
||||
// add a function $function to the list of callbacks named by $hook.
|
||||
function register_callback($hook, $function) {
|
||||
global $HOOKS;
|
||||
if( !isset($HOOKS[$hook]) )
|
||||
$HOOKS[$hook] = array($function);
|
||||
else
|
||||
array_push($HOOKS[$hook], $function);
|
||||
}
|
||||
|
||||
// run all the callback functions associated with the name $hook.
|
||||
// they will be passed $args.
|
||||
function run_callback($hook, $args) {
|
||||
global $HOOKS;
|
||||
if(isset($HOOKS[$hook]))
|
||||
foreach($HOOKS[$hook] as $function)
|
||||
if(function_exists($function))
|
||||
$function($args);
|
||||
}
|
||||
|
||||
// load plugins
|
||||
if(defined('PLUGIN_DIR'))
|
||||
foreach(explode(',', PLUGINS) as $plugin)
|
||||
include_once PLUGIN_DIR . trim($plugin) . '.php';
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue