示例#1
0
    $_GET["catid"] = 'NULL';
}
$cat_id = $_GET["catid"];
$smarty->assign('getCategoriescollapsed', $startUp->Categories('getlistcollapsed', $cat_id));
$smarty->assign('setError', 'false');
$sql = "SELECT filename FROM plugins WHERE action = '" . $db->escape(1) . "'";
$items = $db->get_results($sql, ARRAY_A);
if ($items) {
    foreach ($items as $result_rows) {
        $plugins[] = $result_rows['filename'];
    }
} else {
    $plugins = '';
}
$hook->active_plugins = $plugins;
$hook->set_hooks(array('install', 'action', 'home_page', 'new_page', 'upload_page', 'torrents_page', 'detail_page', 'registration_page', 'login_page', 'account_page', 'edit_account_page', 'user_page', 'admin_action', 'new_admin_page', 'admin_settings_page'));
$hook->load_plugins();
function add_hook($tag, $function, $priority = 10)
{
    global $hook;
    $hook->add_hook($tag, $function, $priority);
}
//same as above
function register_plugin($plugin_id, $data)
{
    global $hook;
    $hook->register_plugin($plugin_id, $data);
}
$smarty->assign('hooks', $hook);
// !! do not remove....
// Lang menu hook
示例#2
0
$smarty->cache_dir = $path . '/cache/';
$smarty->debugging = false;
$smarty->caching = $conf['timecache'];
$smarty->cache_lifetime = $conf['timecache'];
$smarty->config_dir = $path . '/libs/lang/';
$sql = "SELECT filename FROM plugins WHERE action = '" . $db->escape(1) . "'";
$items = $db->get_results($sql, ARRAY_A);
if ($items) {
    foreach ($items as $result_rows) {
        $plugins[] = $result_rows['filename'];
    }
} else {
    $plugins = '';
}
$hook->active_plugins = $plugins;
$hook->set_hooks(array('action', 'home_page', 'new_page', 'paste_page', 'lastpaste_page', 'registration_page', 'login_page', 'account_page', 'admin_action', 'new_admin_page', 'admin_settings_page'));
$hook->load_plugins();
function add_hook($tag, $function, $priority = 10)
{
    global $hook;
    $hook->add_hook($tag, $function, $priority);
}
//same as above
function register_plugin($plugin_id, $data)
{
    global $hook;
    $hook->register_plugin($plugin_id, $data);
}
$smarty->assign('hooks', $hook);
// !! do not remove....
$smarty->assign("getPastes", $startUp->getPastes());
示例#3
0
<?php

//create instance of class
$hook = new phphooks();
//fetch the active plugins name form db. store in array $plugins.
$result_rows = querySQL('active_plugins');
if ($result_rows) {
    foreach ($result_rows as $result_row) {
        $plugins[] = $result_row->filename;
    }
}
//unset means load all plugins in the plugin fold. set it, just load the plugins in this array.
//$hook->active_plugins = "";
$hook->active_plugins = $plugins;
//set multiple hooks to which plugin developers can assign functions
$hook->set_hooks(array('debug', 'after_booking', 'after_del_event', 'after_del_outlet', 'after_del_user', 'after_del_res', 'after_alw_res'));
//load plugins from folder, if no argument is supplied, a 'plugins/' constant will be used
//trailing slash at the end is REQUIRED!
//this method will load all *.plugin.php files from given directory, INCLUDING subdirectories
$hook->load_plugins($plugin_path);
//now, this is a workaround because plugins, when included, can't access $hook variable, so we
//as developers have to basically redefine functions which can be called from plugin files
function add_hook($tag, $function, $priority = 10)
{
    global $hook;
    $hook->add_hook($tag, $function, $priority);
}
//same as above
function register_plugin($plugin_id, $data)
{
    global $hook;
示例#4
0
<?php

//create instance of class
$hook = new phphooks();
//fetch the active plugins name form db. store in array $plugins.
$result_rows = querySQL('active_plugins');
if ($result_rows) {
    foreach ($result_rows as $result_rows) {
        $plugins[] = $result_rows->filename;
    }
}
//unset means load all plugins in the plugin fold. set it, just load the plugins in this array.
//$hook->active_plugins = "";
$hook->active_plugins = $plugins;
//set multiple hooks to which plugin developers can assign functions
$hook->set_hooks(array('debug', 'debug_online', 'after_booking', 'before_booking', 'filter'));
// hooks info:
//   hook				file
// debugging		/web/main_page.php
// after_booking	/web/ajax/process_reservation.php
//load plugins from folder, if no argument is supplied, a 'plugins/' constant will be used
//trailing slash at the end is REQUIRED!
//this method will load all *.plugin.php files from given directory, INCLUDING subdirectories
$hook->load_plugins();
//now, this is a workaround because plugins, when included, can't access $hook variable, so we
//as developers have to basically redefine functions which can be called from plugin files
function add_hook($tag, $function, $priority = 10)
{
    global $hook;
    $hook->add_hook($tag, $function, $priority);
}
示例#5
0
$smarty->addPluginsDir($path . '/libs/plugins/');
$smarty->template_dir = $path . '/themes/';
$smarty->compile_dir = $path . '/cache/compile_tpl/';
$smarty->cache_dir = $path . '/cache/';
$smarty->debugging = true;
$smarty->caching = false;
$smarty->cache_lifetime = 0;
$sql = "SELECT filename FROM plugins WHERE action = '" . $db->escape(1) . "'";
$result_rows = $db->fetch_all_array($sql);
if ($result_rows) {
    foreach ($result_rows as $result_rows) {
        $plugins[] = $result_rows['filename'];
    }
} else {
    $plugins = '';
}
$hook->active_plugins = $plugins;
$hook->set_hooks(array('action', 'new_page'));
$hook->load_plugins();
function add_hook($tag, $function, $priority = 10)
{
    global $hook;
    $hook->add_hook($tag, $function, $priority);
}
function register_plugin($plugin_id, $data)
{
    global $hook;
    $hook->register_plugin($plugin_id, $data);
}
$smarty->assign('hooks', $hook);
// On assigne la sortie des hooks à smarty