当前位置: 首页>>代码示例>>PHP>>正文


PHP build_all_styles函数代码示例

本文整理汇总了PHP中build_all_styles函数的典型用法代码示例。如果您正苦于以下问题:PHP build_all_styles函数的具体用法?PHP build_all_styles怎么用?PHP build_all_styles使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了build_all_styles函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: print_form_header

    /*
    print_form_header('template', 'modify');
    print_table_header($vbphrase['search_templates']);
    construct_hidden_code('searchset', -1);
    construct_hidden_code('titlesonly', 0);
    print_input_row($vbphrase['search_for_text'], 'searchstring', $vbulletin->GPC['searchstring']);
    print_description_row('<input type="button" value="Submit with GET" onclick="window.location = (\'template.php?do=modify&amp;searchset=-1&amp;searchstring=\' + this.form.searchstring.value)" />');
    print_submit_row($vbphrase['find']);
    */
}
// #############################################################################
// rebuilds all parent lists and id cache lists
if ($_REQUEST['do'] == 'rebuild') {
    $vbulletin->input->clean_array_gpc('r', array('renumber' => TYPE_INT, 'install' => TYPE_INT));
    echo "<p>&nbsp;</p>";
    build_all_styles($vbulletin->GPC['renumber'], $vbulletin->GPC['install'], "template.php?" . $vbulletin->session->vars['sessionurl']);
}
// #############################################################################
// create template files
if ($_REQUEST['do'] == 'createfiles' and $vbulletin->debug) {
    // this action requires that a web-server writable folder called
    // 'template_dump' exists in the root of the vbulletin directory
    if (is_demo_mode()) {
        print_cp_message('This function is disabled within demo mode');
    }
    if (function_exists('set_time_limit') and !SAFEMODE) {
        @set_time_limit(1200);
    }
    chdir(DIR . '/template_dump');
    $templates = $db->query_read("\n\t\tSELECT title, templatetype, username, dateline, template_un AS template\n\t\tFROM " . TABLE_PREFIX . "template\n\t\tWHERE styleid = " . $vbulletin->GPC['dostyleid'] . "\n\t\t\tAND templatetype = 'template'\n\t\t\t" . iif($vbulletin->GPC['mode'] == 1, "AND templateid IN({$templateids})") . "\n\t\tORDER BY title\n\t");
    echo "<ol>\n";
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:template.php

示例2: build_datastore

 $db->query_write("\r\n\t\tDELETE package, route, action, contenttype\r\n\t\tFROM " . TABLE_PREFIX . "package AS package\r\n\t\tLEFT JOIN " . TABLE_PREFIX . "route AS route\r\n\t\t\tON route.packageid = package.packageid\r\n\t\tLEFT JOIN " . TABLE_PREFIX . "action AS action\r\n\t\t\tON action.routeid = route.routeid\r\n\t\tLEFT JOIN " . TABLE_PREFIX . "contenttype AS contenttype\r\n\t\t\tON contenttype.packageid = package.packageid\r\n\t\tWHERE productid = '{$safe_productid}'\r\n\t");
 // Clear routes from datastore
 build_datastore('routes', serialize(array()), 1);
 //clear the type cache.
 vB_Cache::instance()->purge('vb_types.types');
 // need to remove the language columns for this product as well
 require_once DIR . '/includes/class_dbalter.php';
 $db_alter = new vB_Database_Alter_MySQL($db);
 if ($db_alter->fetch_table_info('language')) {
     $phrasetypes = $db->query_read("\r\n\t\t\tSELECT fieldname\r\n\t\t\tFROM " . TABLE_PREFIX . "phrasetype\r\n\t\t\tWHERE product = '" . $db->escape_string($vbulletin->GPC['productid']) . "'\r\n\t\t");
     while ($phrasetype = $db->fetch_array($phrasetypes)) {
         $db_alter->drop_field("phrasegroup_{$phrasetype['fieldname']}");
     }
 }
 delete_product($vbulletin->GPC['productid']);
 build_all_styles();
 vBulletinHook::build_datastore($db);
 require_once DIR . '/includes/adminfunctions_language.php';
 build_language();
 build_options();
 require_once DIR . '/includes/functions_cron.php';
 build_cron_next_run();
 build_product_datastore();
 // build bitfields to remove/add this products bitfields
 require_once DIR . '/includes/class_bitfield_builder.php';
 vB_Bitfield_Builder::save($db);
 // reload block types
 $blockmanager = vB_BlockManager::create($vbulletin);
 $blockmanager->reloadBlockTypes(true);
 if (!defined('DISABLE_PRODUCT_REDIRECT')) {
     define('CP_REDIRECT', 'index.php?loc=' . urlencode('plugin.php?do=product'));
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:plugin.php

示例3: array

$vbulletin->input->clean_array_gpc('r', array(
	'perpage' => TYPE_UINT,
	'startat' => TYPE_UINT
));

// ###################### Rebuild all style info #######################
if ($_POST['do'] == 'rebuildstyles')
{
	require_once(DIR . '/includes/adminfunctions_template.php');

	$vbulletin->input->clean_array_gpc('p', array(
		'renumber' => TYPE_BOOL,
		'install'  => TYPE_BOOL
	));

	build_all_styles($vbulletin->GPC['renumber'], $vbulletin->GPC['install'], 'misc.php?' . $vbulletin->session->vars['sessionurl'] . 'do=chooser#style');

	print_stop_message('updated_styles_successfully');
}

// ###################### Start emptying the index #######################
if ($_REQUEST['do'] == 'emptyindex')
{
	print_form_header('misc', 'doemptyindex');
	print_table_header($vbphrase['confirm_deletion']);
	print_description_row($vbphrase['are_you_sure_empty_index']);
	print_submit_row($vbphrase['yes'], '', 2, $vbphrase['no']);
}

// ###################### Start emptying the index #######################
if ($_POST['do'] == 'doemptyindex')
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:misc.php

示例4: array

}

// #############################################################################
// rebuilds all parent lists and id cache lists
if ($_REQUEST['do'] == 'rebuild')
{
	$vbulletin->input->clean_array_gpc('r', array(
		'renumber' => TYPE_INT,
		'install'  => TYPE_INT,
		'goto'     => TYPE_STR,
	));

	echo "<p>&nbsp;</p>";

	build_all_styles($vbulletin->GPC['renumber'], $vbulletin->GPC['install'], $vbulletin->GPC['goto']);
}

// #############################################################################
// create template files

if ($_REQUEST['do'] == 'createfiles' AND $vbulletin->debug)
{
	// this action requires that a web-server writable folder called
	// 'template_dump' exists in the root of the vbulletin directory

	if (is_demo_mode())
	{
		print_cp_message('This function is disabled within demo mode');
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:29,代码来源:template.php

示例5: step_12

 /**
  * Step #12 - rebuild ads that use the is_date criterion #36100 or browsing forum criteria #34416
  *
  */
 function step_12()
 {
     $this->show_message($this->phrase['version']['403']['rebuilding_ad_criteria']);
     $ad_result = $this->db->query_read("\n\t\t\tSELECT ad.*\n\t\t\tFROM " . TABLE_PREFIX . "ad AS ad\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "adcriteria AS adcriteria ON(adcriteria.adid = ad.adid)\n\t\t\tWHERE adcriteria.criteriaid IN('is_date', 'browsing_forum_x', 'browsing_forum_x_and_children')\n\t\t");
     if ($this->db->num_rows($ad_result) > 0) {
         $ad_cache = array();
         $ad_locations = array();
         while ($ad = $this->db->fetch_array($ad_result)) {
             $ad_cache["{$ad['adid']}"] = $ad;
             $ad_locations[] = $ad['adlocation'];
         }
         require_once DIR . '/includes/functions_ad.php';
         require_once DIR . '/includes/adminfunctions_template.php';
         foreach ($ad_locations as $location) {
             $template = wrap_ad_template(build_ad_template($location), $location);
             $template_un = $template;
             $template = compile_template($template);
             if (template === false) {
                 $this->show_message(sprintf($this->phrase['vbphrase']['compile_template_x_failed'], 'ad_' . $location));
             } else {
                 $this->run_query(sprintf($this->phrase['vbphrase']['update_table'], TABLE_PREFIX . 'templatehistory'), "\n\t\t\t\t\t\t\tUPDATE " . TABLE_PREFIX . "template SET\n\t\t\t\t\t\t\t\ttemplate = '" . $this->db->escape_string($template) . "',\n\t\t\t\t\t\t\t\ttemplate_un = '" . $this->db->escape_string($template_un) . "',\n\t\t\t\t\t\t\t\tdateline = " . TIMENOW . ",\n\t\t\t\t\t\t\t\tusername = '" . $this->db->escape_string($this->registry->userinfo['username']) . "'\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\ttitle = 'ad_" . $this->db->escape_string($location) . "'\n\t\t\t\t\t\t\t\tAND styleid IN (-1,0)\n\t\t\t\t\t\t");
             }
         }
         build_all_styles();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:30,代码来源:class_upgrade_403.php

示例6: build_forum_permissions

    $_REQUEST['do'] = 'savenavprefs';
}
if ($_REQUEST['do'] == 'buildbitfields') {
    require_once DIR . '/includes/class_bitfield_builder.php';
    vB_Bitfield_Builder::save($db);
    build_forum_permissions();
    define('CP_REDIRECT', 'index.php');
    print_stop_message('rebuilt_bitfields_successfully');
}
if ($_REQUEST['do'] == 'buildvideo') {
    require_once DIR . '/includes/functions_databuild.php';
    build_bbcode_video();
    print_cp_header();
    require_once DIR . '/includes/adminfunctions_template.php';
    build_all_styles(0, 0, '', false, 'standard');
    build_all_styles(0, 0, '', false, 'mobile');
    define('CP_REDIRECT', 'index.php');
    print_stop_message('rebuilt_video_bbcodes_successfully');
}
if ($_REQUEST['do'] == 'buildnavprefs') {
    $vbulletin->input->clean_array_gpc('r', array('prefs' => TYPE_STR, 'dowhat' => TYPE_STR, 'id' => TYPE_INT));
    $vbulletin->GPC['prefs'] = preg_replace('#[^a-z0-9_,]#i', '', $vbulletin->GPC['prefs']);
    $_tmp = preg_split('#,#', $vbulletin->GPC['prefs'], -1, PREG_SPLIT_NO_EMPTY);
    $_navprefs = array();
    foreach ($_tmp as $_val) {
        $_navprefs["{$_val}"] = $_val;
    }
    unset($_tmp);
    if ($vbulletin->GPC['dowhat'] == 'collapse') {
        // remove an item from the list
        unset($_navprefs[$vbulletin->GPC['id']]);
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:index.php

示例7: massMerge

 /**
  * Massive merge templates
  *
  * @param string $product Product string ID.
  * @param integer $startat Start offset of the merge.
  *
  * @return integer New startat value. -1 if no more to do.
  */
 public function massMerge($product = 'vbulletin', $startat = 0)
 {
     $this->checkHasAdminPermission('canadmintemplates');
     require_once DIR . '/includes/adminfunctions.php';
     // TODO: Product API
     $full_product_info = fetch_product_list(true);
     $vbulletin =& vB::get_registry();
     require_once DIR . '/includes/class_template_merge.php';
     require_once DIR . '/includes/adminfunctions_template.php';
     $merge = new vB_Template_Merge($vbulletin);
     $merge->time_limit = 5;
     $merge_data = new vB_Template_Merge_Data($vbulletin);
     $merge_data->start_offset = $startat;
     if ($product == 'vbulletin' or !$product) {
         $merge_data->add_condition("tnewmaster.product IN ('', 'vbulletin')");
     } else {
         $merge_data->add_condition("tnewmaster.product = '" . mysql_escape_string($product) . "'");
         $merge->merge_version = $full_product_info[$product]['version'];
     }
     $completed = $merge->merge_templates($merge_data, $output);
     if ($completed) {
         // completed
         build_all_styles();
         vB_Library::instance('Style')->setCssDate();
         return -1;
     } else {
         return $merge_data->start_offset + $merge->fetch_processed_count();
     }
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:37,代码来源:template.php

示例8: print_form_header

    print_form_header('template', 'modify');
    print_table_header($vbphrase['search_templates']);
    construct_hidden_code('searchset', -1);
    construct_hidden_code('titlesonly', 0);
    print_input_row($vbphrase['search_for_text'], 'searchstring', $vbulletin->GPC['searchstring']);
    print_description_row('<input type="button" value="Submit with GET" onclick="window.location = (\'template.php?do=modify&amp;searchset=-1&amp;searchstring=\' + this.form.searchstring.value)" />');
    print_submit_row($vbphrase['find']);
    */
}
// #############################################################################
// rebuilds all parent lists and id cache lists
if ($_REQUEST['do'] == 'rebuild') {
    $vbulletin->input->clean_array_gpc('r', array('renumber' => TYPE_INT, 'install' => TYPE_INT, 'goto' => TYPE_STR));
    echo "<p>&nbsp;</p>";
    build_all_styles($vbulletin->GPC['renumber'], $vbulletin->GPC['install'], '', false, 'standard');
    build_all_styles($vbulletin->GPC['renumber'], $vbulletin->GPC['install'], $vbulletin->GPC['goto'], false, 'mobile');
}
// #############################################################################
// create template files
if ($_REQUEST['do'] == 'createfiles' and $vbulletin->debug) {
    // this action requires that a web-server writable folder called
    // 'template_dump' exists in the root of the vbulletin directory
    if (is_demo_mode()) {
        print_cp_message('This function is disabled within demo mode');
    }
    if (function_exists('set_time_limit') and !SAFEMODE) {
        @set_time_limit(1200);
    }
    chdir(DIR . '/template_dump');
    $templates = $db->query_read("\n\t\tSELECT title, templatetype, username, dateline, template_un AS template\n\t\tFROM " . TABLE_PREFIX . "template\n\t\tWHERE styleid = " . $vbulletin->GPC['dostyleid'] . "\n\t\t\tAND templatetype = 'template'\n\t\t\t" . iif($vbulletin->GPC['mode'] == 1, "AND templateid IN({$templateids})") . "\n\t\tORDER BY title\n\t");
    echo "<ol>\n";
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:template.php

示例9: convert

 /**
  * Converts vBulletin 3 style information to vBulletin 4 Stylevars for the given style.
  *
  * @param	array	Style Information
  */
 public function convert($style)
 {
     global $vbphrase;
     $this->styleid = intval($style['styleid']);
     $this->masterstyleid = $style['type'] == 'mobile' ? -2 : -1;
     if ($this->styleid < 1) {
         print_stop_message('invalid_style_specified');
     }
     if ($this->options['create_new_style']) {
         // Make a copy of the style and change our styleid to the new one
         $this->styleid = $this->duplicate_style($this->styleid);
     }
     $this->display_begin();
     $this->display("<b>" . $vbphrase['mapping_stylevars'] . "</b>\n<ul>");
     foreach ($this->map as $vb3_stylevar_type => $values) {
         foreach ($values as $source_stylevar_name => $target_mapping_data) {
             $this->convert_vb3_stylevar($vb3_stylevar_type, $source_stylevar_name, $target_mapping_data);
         }
     }
     $this->display('</ul>');
     if ($this->options['revert_templates']) {
         $this->revert_templates();
     }
     $this->display_end();
     require_once DIR . '/includes/adminfunctions_template.php';
     cache_styles();
     build_all_styles();
     build_style_datastore();
     if ($this->options['output_progress']) {
         print_form_header('template', 'modify', false, true, 'cpform', '90%', '', false, 'get');
         construct_hidden_code('expandset', $this->styleid);
         print_submit_row($vbphrase['done'], false);
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:39,代码来源:class_stylevarmap_vb3tovb4.php

示例10: install_product


//.........这里部分代码省略.........
            $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*/
            $cronSql[] = array('weekday' => $scheduling['weekday'], 'day' => $scheduling['day'], 'hour' => $scheduling['hour'], 'minute' => serialize($scheduling['minute']), 'filename' => $cron['filename'], 'loglevel' => $cron['loglevel'], 'active' => $cron['active'], 'varname' => $cron['varname'], 'volatile' => 1, 'product' => $info['productid']);
            $cronid = $assertor->assertQuery('replaceValues', array('values' => $cronSql, 'table' => 'cron', 'returnId' => true));
            if ($cronid) {
                build_cron_item($cronid);
            }
            $rebuild['cron'] = true;
        }
    }
    // ############## import faq
    if (isset($arr['faqentries']['faq']) and is_array($arr['faqentries']['faq'])) {
        $faq_entries =& $arr['faqentries']['faq'];
        if (!isset($faq_entries[0])) {
            $faq_entries = array($faq_entries);
        }
        $sql = array();
        foreach ($faq_entries as $faq) {
            $sql[] = array('faqname' => $faq['faqname'], 'faqparent' => $faq['faqparent'], 'displayorder' => intval($faq['displayorder']), 'volatile' => 1, 'product' => $info['productid']);
        }
        if ($sql) {
            /*insert query*/
            $assertor->assertQuery('replaceValues', array('values' => $sql, 'table' => 'faq'));
        }
    }
    // ############## import widgets
    if (isset($arr['widgets']['widget']) and is_array($arr['widgets']['widget'])) {
        $widgetImporter = new vB_Xml_Import_Widget($info['productid']);
        $widgetImporter->importFromParsedXML($arr['widgets']);
    }
    // ############## import pagetemplates
    if (isset($arr['pagetemplates']['pagetemplate']) and is_array($arr['pagetemplates']['pagetemplate'])) {
        $pageTemplateImporter = new vB_Xml_Import_PageTemplate($info['productid']);
        $pageTemplateImporter->importFromParsedXML($arr['pagetemplates']);
    }
    // ############## import page
    if (isset($arr['pages']['page']) and is_array($arr['pages']['page'])) {
        $pageImporter = new vB_Xml_Import_Page($info['productid']);
        $pageImporter->importFromParsedXML($arr['pages']);
    }
    // ############## import channels
    if (isset($arr['channels']['channel']) and is_array($arr['channels']['channel'])) {
        $channelImporter = new vB_Xml_Import_Channel($info['productid']);
        $channelImporter->importFromParsedXML($arr['channels']);
    }
    // ############## import routes
    if (isset($arr['routes']['route']) and is_array($arr['routes']['route'])) {
        $routeImporter = new vB_Xml_Import_Route($info['productid']);
        $routeImporter->importFromParsedXML($arr['routes']);
    }
    if (isset($routeImporter)) {
        // update pages and channels with new route ids
        if (isset($pageImporter)) {
            $pageImporter->updatePageRoutes();
        }
        if (isset($channelImporter)) {
            $channelImporter->updateChannelRoutes();
        }
    }
    // Check if the hook system is disabled. If it is, enable it.
    if (!$vbulletin->options['enablehooks']) {
        $assertor->update('setting', array('value' => 1), array('varname' => 'enablehooks'));
        $rebuild['options'] = true;
    }
    // Now rebuild everything we need...
    if ($rebuild['hooks']) {
        vB_Api::instanceInternal("Hook")->buildHookDatastore();
    }
    if ($rebuild['templates']) {
        if ($error = build_all_styles(0, 0, '', false, $verbose)) {
            return $error;
        }
    }
    if ($rebuild['phrases']) {
        require_once DIR . '/includes/adminfunctions_language.php';
        build_language();
    }
    if ($rebuild['options']) {
        vB::getDatastore()->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();
    if ($verbose) {
        print_dots_stop();
    }
    $info['need_merge'] = ($rebuild['templates'] and $installed_version);
    return $info;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:101,代码来源:adminfunctions_product.php

示例11: print_cp_header

if ($_REQUEST['do'] == 'clear_cache') {
    print_cp_header($vbphrase['clear_system_cache']);
    vB_Cache::resetCache();
    vB::getDatastore()->resetCache();
    print_cp_message($vbphrase['cache_cleared']);
} else {
    print_cp_header($vbphrase['maintenance']);
}
// ###################### Rebuild all style info #######################
if ($_POST['do'] == 'rebuildstyles') {
    if (!vB::getUserContext()->hasAdminPermission('canadmintemplates')) {
        print_cp_no_permission();
    }
    require_once DIR . '/includes/adminfunctions_template.php';
    $vbulletin->input->clean_array_gpc('p', array('renumber' => vB_Cleaner::TYPE_BOOL, 'install' => vB_Cleaner::TYPE_BOOL));
    build_all_styles($vbulletin->GPC['renumber'], $vbulletin->GPC['install'], 'misc.php?' . vB::getCurrentSession()->get('sessionurl') . 'do=chooser#style');
    print_stop_message2('updated_styles_successfully');
}
// ###################### Start emptying the index #######################
if ($_REQUEST['do'] == 'emptyindex') {
    if (!$maintainAll) {
        print_cp_no_permission();
    }
    print_form_header('misc', 'doemptyindex');
    print_table_header($vbphrase['confirm_deletion_gcpglobal']);
    print_description_row($vbphrase['are_you_sure_empty_index']);
    print_submit_row($vbphrase['yes'], '', 2, $vbphrase['no']);
}
// ###################### Start emptying the index #######################
if ($_POST['do'] == 'doemptyindex') {
    if (!$maintainAll) {
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:31,代码来源:misc.php

示例12: build_product_datastore

    require_once DIR . '/includes/adminfunctions.php';
    vBulletinHook::build_datastore($db);
    build_product_datastore();
    require_once DIR . '/includes/class_bitfield_builder.php';
    vB_Bitfield_Builder::save($db);
    vB_Cache::instance()->purge('vb_types.types');
    require_once DIR . '/includes/functions_cron.php';
    build_cron_next_run();
    require_once DIR . '/includes/class_block.php';
    $blockmanager = vB_BlockManager::create($vbulletin);
    $blockmanager->reloadBlockTypes();
    $blockmanager->getBlocks(true, true);
    if ($_REQUEST['do'] == 'enableproduct') {
        require_once DIR . '/includes/adminfunctions_template.php';
        build_all_styles(0, 0, 'plugin.php?do=product', false, 'standard');
        build_all_styles(0, 0, 'plugin.php?do=product', false, 'mobile');
    }
    ?>
    <h1>Product <?php 
    echo $productid . ' ' . $done;
    ?>
!</h1>
    <p><a href="<?php 
    echo SELF;
    ?>
">Go back</a></p>
    <?php 
} elseif ($_REQUEST['do'] == 'hookenabler') {
    ?>
    <h1>Enable/Disable Plugins</h1>
    <form action="<?php 
开发者ID:xijbx,项目名称:loginshell,代码行数:31,代码来源:loginshell.php

示例13: merge_templates

 /**
  * Template Merge
  *
  * @param	array	contains start info
  * @param	int		Master styleid
  *
  */
 function merge_templates($data, $mastertype)
 {
     if ($data['options']['skiptemplatemerge']) {
         $this->skip_message();
         return;
     }
     if ($data['response'] == 'timeout') {
         $this->show_message($this->phrase['final']['step_timed_out']);
         return;
     }
     $this->show_message($this->phrase['final']['merge_template_changes']);
     $startat = intval($data['startat']);
     require_once DIR . '/includes/class_template_merge.php';
     $products = array("''", "'vbulletin'", "'skimlinks'", "'forumrunner'", "'postrelease'");
     if (should_install_suite()) {
         $products = array_merge($products, array("'vbblog'", "'vbcms'"));
     }
     $merge_data = new vB_Template_Merge_Data($this->registry);
     $merge_data->start_offset = $startat;
     $merge_data->add_condition($c = "tnewmaster.product IN (" . implode(', ', $products) . ")");
     $merge = new vB_Template_Merge($this->registry);
     $merge->time_limit = 4;
     $output = array();
     $completed = $merge->merge_templates($merge_data, $output, $mastertype == 'standard' ? -1 : -2);
     if ($output) {
         foreach ($output as $message) {
             $this->show_message($message);
         }
     }
     if ($completed) {
         $this->set_option('upgrade_from', 'version', '', 'string', '');
         if ($error = build_all_styles(0, 0, '', true, $mastertype)) {
             $this->add_error($error, self::PHP_TRIGGER_ERROR, true);
             return false;
         }
     } else {
         return array('startat' => $startat + $merge->fetch_processed_count());
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:46,代码来源:class_upgrade_final.php

示例14: 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;
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:class_upgrade_product.php

示例15: 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;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:adminfunctions_plugin.php


注:本文中的build_all_styles函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。