本文整理汇总了PHP中vBulletinHook::set_pluginlist方法的典型用法代码示例。如果您正苦于以下问题:PHP vBulletinHook::set_pluginlist方法的具体用法?PHP vBulletinHook::set_pluginlist怎么用?PHP vBulletinHook::set_pluginlist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vBulletinHook
的用法示例。
在下文中一共展示了vBulletinHook::set_pluginlist方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: post_install
//.........这里部分代码省略.........
$cron['active'] = $cron['active'] ? 1 : 0;
$cron['loglevel'] = $cron['loglevel'] ? 1 : 0;
$scheduling = $cron['scheduling'];
$scheduling['weekday'] = intval($scheduling['weekday']);
$scheduling['day'] = intval($scheduling['day']);
$scheduling['hour'] = intval($scheduling['hour']);
$scheduling['minute'] = explode(',', preg_replace('#[^0-9,-]#i', '', $scheduling['minute']));
if (count($scheduling['minute']) == 0) {
$scheduling['minute'] = array(0);
} else {
$scheduling['minute'] = array_map('intval', $scheduling['minute']);
}
/*insert query*/
$this->db->query_write("\n\t\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "cron\n\t\t\t\t\t\t(weekday, day, hour, minute, filename, loglevel, active, varname, volatile, product)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t({$scheduling['weekday']},\n\t\t\t\t\t\t{$scheduling['day']},\n\t\t\t\t\t\t{$scheduling['hour']},\n\t\t\t\t\t\t'" . $this->db->escape_string(serialize($scheduling['minute'])) . "',\n\t\t\t\t\t\t'" . $this->db->escape_string($cron['filename']) . "',\n\t\t\t\t\t\t{$cron['loglevel']},\n\t\t\t\t\t\t{$cron['active']},\n\t\t\t\t\t\t'" . $this->db->escape_string($cron['varname']) . "',\n\t\t\t\t\t\t1,\n\t\t\t\t\t\t'" . $this->db->escape_string($this->productinfo['productid']) . "')\n\t\t\t\t");
$cronid = $this->db->insert_id();
// replace either inserts, or deletes+inserts
if ($cronid) {
build_cron_item($cronid);
}
$rebuild['cron'] = true;
}
}
// ############## import faq
if (!empty($this->productobj['faqentries']['faq']) and is_array($this->productobj['faqentries']['faq'])) {
$faq_entries =& $this->productobj['faqentries']['faq'];
if (!isset($faq_entries[0])) {
$faq_entries = array($faq_entries);
}
$sql = array();
foreach ($faq_entries as $faq) {
$sql[] = "\n\t\t\t\t\t('" . $this->db->escape_string($faq['faqname']) . "',\n\t\t\t\t\t'" . $this->db->escape_string($faq['faqparent']) . "',\n\t\t\t\t\t" . intval($faq['displayorder']) . ",\n\t\t\t\t\t1,\n\t\t\t\t\t'" . $this->db->escape_string($this->productinfo['productid']) . "')\n\t\t\t\t";
}
if ($sql) {
/*insert query*/
$this->db->query_write("\n\t\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "faq\n\t\t\t\t\t\t(faqname, faqparent, displayorder, volatile, product)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t" . implode(',', $sql) . "\n\t\t\t\t");
}
}
$this->productinfo['process'] = VB_AREA;
$this->productinfo['username'] = 'Product-' . VB_AREA;
import_navigation($this->productobj, $this->productinfo);
$products = fetch_product_list(true);
// Check if the plugin system is disabled. If it is, enable it if this product isn't installed.
if (!$this->registry->options['enablehooks'] and !$products[$this->productinfo['productid']]) {
$this->db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "setting\n\t\t\t\tSET value = '1'\n\t\t\t\tWHERE varname = 'enablehooks'\n\t\t\t");
$rebuild['options'] = true;
}
// Now rebuild everything we need...
if ($rebuild['plugins']) {
vBulletinHook::build_datastore($this->db);
if ($this->active) {
$plugin_data = $this->db->query_read("\n\t\t\t\t\tSELECT *\n\t\t\t\t\tFROM " . TABLE_PREFIX . "datastore\n\t\t\t\t\tWHERE title IN ('pluginlist', 'pluginlistadmin')\n\t\t\t\t");
while ($plugin_info = $this->db->fetch_array($plugin_data)) {
if ($plugin_info['title'] == 'pluginlist') {
$this->registry->pluginlist = unserialize($plugin_info['data']);
} else {
if ($plugin_info['title'] == 'pluginlistadmin') {
$this->registry->pluginlistadmin = unserialize($plugin_info['data']);
}
}
}
// enable any hooks -- this is mainly necessary for importing templates (template_safe_functions hook)
if (!defined('DISABLE_HOOKS') and VB_AREA != 'Upgrade') {
if (!empty($this->registry->pluginlistadmin) and is_array($this->registry->pluginlistadmin)) {
$this->registry->pluginlist = array_merge($this->registry->pluginlist, $this->registry->pluginlistadmin);
unset($this->registry->pluginlistadmin);
}
vBulletinHook::set_pluginlist($this->registry->pluginlist, $vbulletin->options['hookerrors']);
}
}
}
if ($rebuild['templates']) {
if ($error = build_all_styles(0, 0, '', false, 'standard')) {
return $error;
}
if ($error = build_all_styles(0, 0, '', false, 'mobile')) {
return $error;
}
}
if ($rebuild['phrases']) {
require_once DIR . '/includes/adminfunctions_language.php';
build_language();
}
if ($rebuild['options']) {
build_options();
}
if ($rebuild['cron']) {
require_once DIR . '/includes/functions_cron.php';
build_cron_next_run();
}
build_product_datastore();
build_activitystream_datastore();
// build bitfields to remove/add this products bitfields
vB_Bitfield_Builder::save($this->db);
// reload block types
$blockmanager = vB_BlockManager::create($this->registry);
$blockmanager->reloadBlockTypes();
print_dots_stop();
$this->productinfo['need_merge'] = ($rebuild['templates'] and $installed_version);
return $this->productinfo;
}
示例2: install_product
//.........这里部分代码省略.........
" . intval($faq['displayorder']) . ",
1,
'" . $db->escape_string($info['productid']) . "')
";
}
if ($sql)
{
/*insert query*/
$db->query_write("
REPLACE INTO " . TABLE_PREFIX . "faq
(faqname, faqparent, displayorder, volatile, product)
VALUES
" . implode(',', $sql) . "
");
}
}
// Check if the plugin system is disabled. If it is, enable it.
if (!$vbulletin->options['enablehooks'])
{
$db->query_write("
UPDATE " . TABLE_PREFIX . "setting
SET value = '1'
WHERE varname = 'enablehooks'
");
$rebuild['options'] = true;
}
// Now rebuild everything we need...
if ($rebuild['plugins'])
{
vBulletinHook::build_datastore($db);
if ($active)
{
$plugin_data = $db->query_read("
SELECT *
FROM " . TABLE_PREFIX . "datastore
WHERE title IN ('pluginlist', 'pluginlistadmin')
");
while ($plugin_info = $db->fetch_array($plugin_data))
{
if ($plugin_info['title'] == 'pluginlist')
{
$vbulletin->pluginlist = unserialize($plugin_info['data']);
}
else if ($plugin_info['title'] == 'pluginlistadmin')
{
$vbulletin->pluginlistadmin = unserialize($plugin_info['data']);
}
}
// enable any hooks -- this is mainly necessary for importing templates (template_safe_functions hook)
if (!defined('DISABLE_HOOKS'))
{
if (!empty($vbulletin->pluginlistadmin) AND is_array($vbulletin->pluginlistadmin))
{
$vbulletin->pluginlist = array_merge($vbulletin->pluginlist, $vbulletin->pluginlistadmin);
unset($vbulletin->pluginlistadmin);
}
vBulletinHook::set_pluginlist($vbulletin->pluginlist);
}
}
}
if ($rebuild['templates'])
{
build_all_styles();
}
if ($rebuild['phrases'])
{
require_once(DIR . '/includes/adminfunctions_language.php');
build_language();
}
if ($rebuild['options'])
{
build_options();
}
if ($rebuild['cron'])
{
require_once(DIR . '/includes/functions_cron.php');
build_cron_next_run();
}
build_product_datastore();
// build bitfields to remove/add this products bitfields
vB_Bitfield_Builder::save($db);
// reload block types
$blockmanager = vB_BlockManager::create($vbulletin);
$blockmanager->reloadBlockTypes();
print_dots_stop();
$info['need_merge'] = ($rebuild['templates'] AND $installed_version);
return $info;
}
示例3: array_merge
vbulletin_demo_init_page();
}
// #############################################################################
// setup the hooks & plugins system
if ($vbulletin->options['enablehooks'] OR defined('FORCE_HOOKS'))
{
require_once(DIR . '/includes/class_hook.php');
if ($vbulletin->options['enablehooks'] AND !defined('DISABLE_HOOKS'))
{
if (!empty($vbulletin->pluginlistadmin) AND is_array($vbulletin->pluginlistadmin))
{
$vbulletin->pluginlist = array_merge($vbulletin->pluginlist, $vbulletin->pluginlistadmin);
unset($vbulletin->pluginlistadmin);
}
vBulletinHook::set_pluginlist($vbulletin->pluginlist);
}
}
else
{
// make a null class for optimization
/**
* @ignore
*/
class vBulletinHook {
public static function fetch_hook() { return false; }
public static function fetch_hookusage() { return array(); }
}
$vbulletin->pluginlist = '';
}
$template_hook = array();
示例4: define
define('REFERRER_PASSTHRU', $vbulletin->url);
// #############################################################################
// demo mode stuff
if (defined('DEMO_MODE') and DEMO_MODE and function_exists('vbulletin_demo_init_page')) {
vbulletin_demo_init_page();
}
// #############################################################################
// setup the hooks & plugins system
if ($vbulletin->options['enablehooks'] or defined('FORCE_HOOKS')) {
require_once DIR . '/includes/class_hook.php';
if ($vbulletin->options['enablehooks'] and !defined('DISABLE_HOOKS')) {
if (!empty($vbulletin->pluginlistadmin) and is_array($vbulletin->pluginlistadmin)) {
$vbulletin->pluginlist = array_merge($vbulletin->pluginlist, $vbulletin->pluginlistadmin);
unset($vbulletin->pluginlistadmin);
}
vBulletinHook::set_pluginlist($vbulletin->pluginlist, $vbulletin->options['hookerrors']);
}
} else {
// make a null class for optimization
/**
* @ignore
*/
class vBulletinHook
{
public static function fetch_hook()
{
return false;
}
public static function fetch_hookusage()
{
return array();