本文整理汇总了PHP中load_plugins函数的典型用法代码示例。如果您正苦于以下问题:PHP load_plugins函数的具体用法?PHP load_plugins怎么用?PHP load_plugins使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load_plugins函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build_element_list
build_element_list($elements_main);
if ($elements_aux) {
build_element_list($elements_aux);
}
load_elements('init');
register_element_tabs();
$event = gps('event') ? gps('event') : 'article';
$step = gps('step');
if (!$dbversion or $dbversion != $thisversion or $txp_using_svn) {
define('TXP_UPDATE', 1);
include txpath . '/update/_update.php';
}
load_elements($event);
register_element_tabs();
if (!empty($admin_side_plugins) and gps('event') != 'plugin') {
load_plugins(1);
}
include txpath . '/lib/txplib_head.php';
// ugly hack, for the people that don't update their admin_config.php
// Get rid of this when we completely remove admin_config and move privs to db
if ($event == 'list') {
require_privs('article');
} else {
require_privs($event);
}
callback_event($event, $step, 1);
// let elements override older /include/txp_foo.php admin pages
if (!controller_name($event)) {
$inc = txpath . '/include/txp_' . $event . '.php';
if (is_readable($inc)) {
include $inc;
示例2: pwg_db_connect
try {
pwg_db_connect($conf['db_host'], $conf['db_user'], $conf['db_password'], $conf['db_base']);
} catch (Exception $e) {
my_error(l10n($e->getMessage()), true);
}
pwg_db_check_charset();
load_conf_from_db();
$logger = new Logger(array('directory' => PHPWG_ROOT_PATH . $conf['data_location'] . $conf['log_dir'], 'severity' => $conf['log_level'], 'filename' => 'log_' . date('Y-m-d') . '_' . sha1(date('Y-m-d') . $conf['db_password']) . '.txt', 'globPattern' => 'log_*.txt', 'archiveDays' => $conf['log_archive_days']));
if (!$conf['check_upgrade_feed']) {
if (!isset($conf['piwigo_db_version']) or $conf['piwigo_db_version'] != get_branch_from_version(PHPWG_VERSION)) {
redirect(get_root_url() . 'upgrade.php');
}
}
ImageStdParams::load_from_db();
session_start();
load_plugins();
// users can have defined a custom order pattern, incompatible with GUI form
if (isset($conf['order_by_custom'])) {
$conf['order_by'] = $conf['order_by_custom'];
}
if (isset($conf['order_by_inside_category_custom'])) {
$conf['order_by_inside_category'] = $conf['order_by_inside_category_custom'];
}
include PHPWG_ROOT_PATH . 'include/user.inc.php';
if (in_array(substr($user['language'], 0, 2), array('fr', 'it', 'de', 'es', 'pl', 'hu', 'ru', 'nl', 'tr', 'da'))) {
define('PHPWG_DOMAIN', substr($user['language'], 0, 2) . '.piwigo.org');
} elseif ('zh_CN' == $user['language']) {
define('PHPWG_DOMAIN', 'cn.piwigo.org');
} elseif ('pt_BR' == $user['language']) {
define('PHPWG_DOMAIN', 'br.piwigo.org');
} else {
示例3: redirect
$orig_plugin_name = "";
if (isset($_POST["origpluginname"])) {
$orig_plugin_name = $_POST["origpluginname"];
}
$code = "";
if (isset($_POST["code"])) {
$code = $_POST["code"];
}
if (isset($_POST["cancel"])) {
redirect("listusertags.php" . $urlext);
return;
}
$userid = get_userid();
$access = check_permission($userid, 'Modify User-defined Tags');
$smarty = new Smarty_CMS($gCms->config);
load_plugins($smarty);
$ajax = false;
if (isset($_POST['ajax']) && $_POST['ajax']) {
$ajax = true;
}
if ($access) {
if (isset($_POST["editplugin"])) {
$CMS_EXCLUDE_FROM_RECENT = 1;
$validinfo = true;
if ($plugin_name == "") {
$error[] = lang('nofieldgiven', array(lang('editusertag')));
$validinfo = false;
} elseif (preg_match('<^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$>', $plugin_name) == 0) {
$error[] = lang('error_udt_name_chars');
$validinfo = false;
} else {
示例4: exit
<?php
if (!defined('SITE')) {
exit('No direct script access allowed');
}
// modified indexhibit functions
// chronological
// sectional
// front_*_css
// front_*_js
// procedure
load_plugins(DIRNAME . BASENAME . '/site/plugin/', 'plugin');
// functions
// this file will grab all the plugin.$something.php and load it up
function load_plugins($path, $default)
{
// let's get the folders and info...
$modules = array();
if (is_dir($path)) {
if ($fp = opendir($path)) {
while (($module = readdir($fp)) !== false) {
if (strpos($module, 'plugin', 0) === 0) {
$modules[] = $module;
}
}
}
closedir($fp);
}
foreach ($modules as $load) {
include_once $path . $load;
}
示例5: load_plugin
/**
* Load a plugin
*
* @param String $plugin the plugin to load
*/
function load_plugin($plugin)
{
load_plugins($plugin);
}
示例6: _initiate_callbacks
function _initiate_callbacks($event, $step = '', $pre = 0)
{
$results = array();
$tab = gps('tab');
$plugin = gps('plugin');
if ($tab === 'plugin' and empty($plugin)) {
# Force the loading of public side plugins on a visit to the MLP>Plugins, in case they do register strings...
//echo "Initiating callbacks and loading active public plugins ... ";
load_plugins(0);
# Initiates our string enumeration event...
$results = $this->_do_callback("l10n.enumerate_strings", '', 0, array(&$this, '_process_string_callbacks'));
}
return $results;
}
示例7: Smarty_CMS
/**
* Constructor
*
* @param array The hash of CMSMS config settings
*/
function Smarty_CMS(&$config)
{
$this->Smarty();
global $CMS_ADMIN_PAGE;
if (isset($CMS_ADMIN_PAGE) && $CMS_ADMIN_PAGE == 1) {
$this->template_dir = $config["root_path"] . '/' . $config['admin_dir'] . '/templates/';
$this->config_dir = $config["root_path"] . '/' . $config['admin_dir'] . '/configs/';
} else {
$this->template_dir = $config["root_path"] . '/tmp/templates/';
$this->config_dir = $config["root_path"] . '/tmp/configs/';
}
$this->compile_dir = TMP_TEMPLATES_C_LOCATION;
$this->cache_dir = TMP_CACHE_LOCATION;
#$this->plugins_dir = array($config["root_path"].'/lib/smarty/plugins',$config["root_path"].'/plugins',$config["root_path"].'/plugins/cache');
$this->plugins_dir = array($config["root_path"] . '/lib/smarty/plugins', $config["root_path"] . '/plugins');
$this->compiler_file = 'CMS_Compiler.class.php';
$this->compiler_class = 'CMS_Compiler';
//use_sub_dirs doesn't work in safe mode
//if (ini_get("safe_mode") != "1")
// $this->use_sub_dirs = true;
//$this->caching = false;
//$this->compile_check = true;
$this->assign('app_name', 'CMS');
//$this->debugging = false;
//$this->force_compile = false;
$this->cache_plugins = false;
if ($config["debug"] == true) {
//$this->caching = false;
$this->force_compile = true;
$this->debugging = true;
}
if (is_sitedown()) {
$this->caching = false;
$this->force_compile = true;
}
if (isset($CMS_ADMIN_PAGE) && $CMS_ADMIN_PAGE == 1) {
$this->caching = false;
$this->force_compile = true;
}
load_plugins($this);
$this->register_resource("db", array(&$this, "template_get_template", "template_get_timestamp", "db_get_secure", "db_get_trusted"));
$this->register_resource("print", array(&$this, "template_get_template", "template_get_timestamp", "db_get_secure", "db_get_trusted"));
$this->register_resource("template", array(&$this, "template_get_template", "template_get_timestamp", "db_get_secure", "db_get_trusted"));
$this->register_resource("tpl_top", array(&$this, "template_top_get_template", "template_get_timestamp", "db_get_secure", "db_get_trusted"));
$this->register_resource("tpl_head", array(&$this, "template_head_get_template", "template_get_timestamp", "db_get_secure", "db_get_trusted"));
$this->register_resource("tpl_body", array(&$this, "template_body_get_template", "template_get_timestamp", "db_get_secure", "db_get_trusted"));
$this->register_resource("htmlblob", array(&$this, "global_content_get_template", "global_content_get_timestamp", "db_get_secure", "db_get_trusted"));
$this->register_resource("globalcontent", array(&$this, "global_content_get_template", "global_content_get_timestamp", "db_get_secure", "db_get_trusted"));
$this->register_resource("content", array(&$this, "content_get_template", "content_get_timestamp", "db_get_secure", "db_get_trusted"));
$this->register_resource("module", array(&$this, "module_get_template", "module_get_timestamp", "db_get_secure", "db_get_trusted"));
$this->register_resource("module_db_tpl", array(&$this, "module_db_template", "module_db_timestamp", "db_get_secure", "db_get_trusted"));
$this->register_resource("module_file_tpl", array(&$this, "module_file_template", "module_file_timestamp", "db_get_secure", "db_get_trusted"));
}
示例8: instantiate_db
}
}
global $db;
/*
* Database (db) object
* @global object $db
**/
$db =& instantiate_db();
// set error handler
set_error_handler('_amember_error_handler');
// load language
load_language_defs();
load_language("/language");
/// load plugins
load_plugins('protect');
load_plugins('payment');
global $config;
if ($config['product_paysystem']) {
$ps_list = array('' => '* Choose a paysystem *');
foreach ($l = get_paysystems_list() as $p) {
$ps_list[$p['paysys_id']] = $p['title'];
}
add_product_field('paysys_id', 'Payment System', 'select', "Choose payment system to be used with this product.<br />\n This option only available if you have enabled option<br />\n \"Assign paysystem to product\" in aMember CP => Setup => Advanced\n ", '', array('options' => $ps_list));
}
if (!is_lite()) {
// add require another subscription field
$require_options = array();
$prevent_options = array();
foreach ($db->get_products_list() as $pr) {
$require_options['ACTIVE-' . $pr['product_id']] = 'Require ACTIVE subscription for "' . $pr['title'] . '"';
$require_options['EXPIRED-' . $pr['product_id']] = 'Require EXPIRED subscription for "' . $pr['title'] . '"';