Пример #1
0
		'redirect' => TYPE_STR,
	));

	verify_cp_sessionhash();

	require_once(DIR . '/includes/class_template_merge.php');

	$merge = new vB_Template_Merge($vbulletin);
	$merge->time_limit = 5;

	$merge_data = new vB_Template_Merge_Data($vbulletin);
	$merge_data->start_offset = $vbulletin->GPC['startat'];

	if ($vbulletin->GPC['product'] == 'vbulletin' OR !$vbulletin->GPC['product'])
	{
		$merge_data->add_condition("tnewmaster.product IN ('', 'vbulletin')");
	}
	else
	{
		$merge_data->add_condition("tnewmaster.product = '" . $db->escape_string($vbulletin->GPC['product']) . "'");

		$merge->merge_version = $full_product_info[$vbulletin->GPC['product']]['version'];
	}

	$completed = $merge->merge_templates($merge_data);

	if ($completed)
	{
		// completed
		build_all_styles();
Пример #2
0
                 echo '<p>Uh oh, ./install/vbulletin-adminhelp.xml doesn\'t appear to exist! Upload it and refresh the page.</p>';
                 print_cp_footer();
             }
             echo '<p>Importing vbulletin-adminhelp.xml';
             xml_import_help_topics($xml);
             echo "<br /><span class=\"smallfont\"><b>Okay</b></span></p>";
             break;
     }
     define('SCRIPT_REDIRECT', true);
 } else {
     if ($_REQUEST['do'] == 'templatemerge') {
         $vbulletin->input->clean_array_gpc('r', array('startat' => TYPE_UINT));
         require_once DIR . '/includes/class_template_merge.php';
         $merge_data = new vB_Template_Merge_Data($vbulletin);
         $merge_data->start_offset = $vbulletin->GPC['startat'];
         $merge_data->add_condition("tnewmaster.product IN ('', 'vbulletin')");
         $merge = new vB_Template_Merge($vbulletin);
         $merge->time_limit = 5;
         $completed = $merge->merge_templates($merge_data);
         if ($completed) {
             // completed
             $vbphrase['style'] = 'Style';
             $vbphrase['please_wait'] = 'Please Wait';
             build_all_styles();
             define('SCRIPT_REDIRECT', true);
         } else {
             // more templates to merge
             print_cp_redirect('tools.php?do=templatemerge&startat=' . ($merge_data->start_offset + $merge->fetch_processed_count()));
         }
     } else {
         if ($_REQUEST['do'] == 'cache') {
Пример #3
0
 /**
  * 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();
     }
 }
Пример #4
0
// #############################################################################
if ($vbulletin->GPC['step'] == (should_install_suite() ? 7 : 5))
{
	require_once(DIR . '/includes/class_template_merge.php');

	$products = array("''", "'vbulletin'");

	if (should_install_suite())
	{
		$products = array_merge($products, array("'vbblog'", "'vbcms'"));
 	}

	$merge_data = new vB_Template_Merge_Data($vbulletin);
	$merge_data->start_offset = $vbulletin->GPC['startat'];
	$merge_data->add_condition($c = "tnewmaster.product IN (" . implode(', ', $products) . ")");

	$merge = new vB_Template_Merge($vbulletin);
	$merge->time_limit = 4;
	$completed = $merge->merge_templates($merge_data);

	if ($completed)
	{
		// completed
		build_all_styles();
	}
	else
	{
		// more templates to merge
		print_next_page(0, $merge_data->start_offset + $merge->fetch_processed_count());
	}
Пример #5
0
 /**
  * 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());
     }
 }