本文整理汇总了PHP中print_dots_start函数的典型用法代码示例。如果您正苦于以下问题:PHP print_dots_start函数的具体用法?PHP print_dots_start怎么用?PHP print_dots_start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_dots_start函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
/**
* Parse XML
*
* @param string location of XML
*/
public function parse($xml)
{
print_dots_start('<b>' . $this->vbphrase['importing_product'] . "</b>, {$this->vbphrase[please_wait]}", ':', 'dspan');
$this->xmlobj = new vB_XML_Parser($xml);
if ($this->xmlobj->error_no == 1) {
print_dots_stop();
throw new vB_Exception_AdminStopMessage('no_xml_and_no_path');
}
if (!($this->productobj = $this->xmlobj->parse())) {
print_dots_stop();
throw new vB_Exception_AdminStopMessage(array('xml_error_x_at_line_y', $this->xmlobj->error_string(), $this->xmlobj->error_line()));
}
// ############## general product information
$this->productinfo['productid'] = substr(preg_replace('#[^a-z0-9_]#', '', strtolower($this->productobj['productid'])), 0, 25);
$this->productinfo['title'] = $this->productobj['title'];
$this->productinfo['description'] = $this->productobj['description'];
$this->productinfo['version'] = $this->productobj['version'];
$this->productinfo['active'] = $this->productobj['active'];
$this->productinfo['url'] = $this->productobj['url'];
$this->productinfo['versioncheckurl'] = $this->productobj['versioncheckurl'];
if (!$this->productinfo['productid']) {
print_dots_stop();
if (!empty($this->productobj['plugin'])) {
throw new vB_Exception_AdminStopMessage('this_file_appears_to_be_a_plugin');
} else {
throw new vB_Exception_AdminStopMessage('invalid_file_specified');
}
}
if (strtolower($this->productinfo['productid']) == 'vbulletin') {
print_dots_stop();
throw new vB_Exception_AdminStopMessage(array('product_x_installed_no_overwrite', 'vBulletin'));
}
// check for bitfield conflicts on install
$bitfields = vB_Bitfield_Builder::return_data();
if (!$bitfields) {
$bfobj =& vB_Bitfield_Builder::init();
if ($bfobj->errors) {
print_dots_stop();
throw new vB_Exception_AdminStopMessage(array('bitfield_conflicts_x', '<li>' . implode('</li><li>', $bfobj->errors) . '</li>'));
}
}
return true;
}
示例2: xml_import_help_topics
function xml_import_help_topics($xml = false)
{
global $vbulletin, $vbphrase;
print_dots_start('<b>' . $vbphrase['importing_admin_help'] . "</b>, {$vbphrase['please_wait']}", ':', 'dspan');
require_once DIR . '/includes/class_xml.php';
$xmlobj = new vB_XML_Parser($xml, $GLOBALS['path']);
if ($xmlobj->error_no == 1) {
print_dots_stop();
print_stop_message('no_xml_and_no_path');
} else {
if ($xmlobj->error_no == 2) {
print_dots_stop();
print_stop_message('please_ensure_x_file_is_located_at_y', 'vbulletin-adminhelp.xml', $GLOBALS['path']);
}
}
if (!($arr = $xmlobj->parse())) {
print_dots_stop();
print_stop_message('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line());
}
if (!$arr['helpscript']) {
print_dots_stop();
print_stop_message('invalid_file_specified');
}
$product = empty($arr['product']) ? 'vbulletin' : $arr['product'];
$has_phrases = !empty($arr['hasphrases']);
$arr = $arr['helpscript'];
if ($product == 'vbulletin') {
$product_sql = "product IN ('vbulletin', '')";
} else {
$product_sql = "product = '" . $vbulletin->db->escape_string($product) . "'";
}
$vbulletin->db->query_write("\n\t\tDELETE FROM " . TABLE_PREFIX . "adminhelp\n\t\tWHERE {$product_sql}\n\t\t\t AND volatile = 1\n\t");
if ($has_phrases) {
$vbulletin->db->query_write("\n\t\t\tDELETE FROM " . TABLE_PREFIX . "phrase\n\t\t\tWHERE {$product_sql}\n\t\t\t\tAND fieldname = 'cphelptext'\n\t\t\t\tAND languageid = -1\n\t\t");
}
// Deal with single entry
if (!is_array($arr[0])) {
$arr = array($arr);
}
foreach ($arr as $helpscript) {
$help_sql = array();
$phrase_sql = array();
$help_sql_len = 0;
$phrase_sql_len = 0;
// Deal with single entry
if (!is_array($helpscript['helptopic'][0])) {
$helpscript['helptopic'] = array($helpscript['helptopic']);
}
foreach ($helpscript['helptopic'] as $topic) {
$help_sql[] = "\n\t\t\t\t('" . $vbulletin->db->escape_string($helpscript['name']) . "',\n\t\t\t\t'" . $vbulletin->db->escape_string($topic['act']) . "',\n\t\t\t\t'" . $vbulletin->db->escape_string($topic['opt']) . "',\n\t\t\t\t" . intval($topic['disp']) . ",\n\t\t\t\t1,\n\t\t\t\t'" . $vbulletin->db->escape_string($product) . "')\n\t\t\t";
$help_sql_len += strlen(end($help_sql));
if ($has_phrases) {
$phrase_name = fetch_help_phrase_short_name(array('script' => $helpscript['name'], 'action' => $topic['act'], 'optionname' => $topic['opt']));
if (isset($topic['text']['value'])) {
$phrase_sql[] = "\n\t\t\t\t\t\t(-1,\n\t\t\t\t\t\t'cphelptext',\n\t\t\t\t\t\t'{$phrase_name}_text',\n\t\t\t\t\t\t'" . $vbulletin->db->escape_string($topic['text']['value']) . "',\n\t\t\t\t\t\t'" . $vbulletin->db->escape_string($product) . "',\n\t\t\t\t\t\t'" . $vbulletin->db->escape_string($topic['text']['username']) . "',\n\t\t\t\t\t\t" . intval($topic['text']['date']) . ",\n\t\t\t\t\t\t'" . $vbulletin->db->escape_string($topic['text']['version']) . "')\n\t\t\t\t\t";
$phrase_sql_len += strlen(end($phrase_sql));
}
if (isset($topic['title']['value'])) {
$phrase_sql[] = "\n\t\t\t\t\t\t(-1,\n\t\t\t\t\t\t'cphelptext',\n\t\t\t\t\t\t'{$phrase_name}_title',\n\t\t\t\t\t\t'" . $vbulletin->db->escape_string($topic['title']['value']) . "',\n\t\t\t\t\t\t'" . $vbulletin->db->escape_string($product) . "',\n\t\t\t\t\t\t'" . $vbulletin->db->escape_string($topic['title']['username']) . "',\n\t\t\t\t\t\t" . intval($topic['title']['date']) . ",\n\t\t\t\t\t\t'" . $vbulletin->db->escape_string($topic['title']['version']) . "')\n\t\t\t\t\t";
$phrase_sql_len += strlen(end($phrase_sql));
}
}
if ($phrase_sql_len > 102400) {
// insert max of 100k of phrases at a time
/*insert query*/
$vbulletin->db->query_write("\n\t\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "phrase\n\t\t\t\t\t\t(languageid, fieldname, varname, text, product, username, dateline, version)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t" . implode(",\n", $phrase_sql));
$phrase_sql = array();
$phrase_sql_len = 0;
}
if ($help_sql_len > 102400) {
// insert max of 100k of phrases at a time
/*insert query*/
$vbulletin->db->query_write("\n\t\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "adminhelp\n\t\t\t\t\t\t(script, action, optionname, displayorder, volatile, product)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t" . implode(",\n\t", $help_sql));
$help_sql = array();
$help_sql_len = 0;
}
}
if ($help_sql) {
/*insert query*/
$vbulletin->db->query_write("\n\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "adminhelp\n\t\t\t\t\t(script, action, optionname, displayorder, volatile, product)\n\t\t\t\tVALUES\n\t\t\t\t\t" . implode(",\n\t", $help_sql));
}
if ($phrase_sql) {
/*insert query*/
$vbulletin->db->query_write("\n\t\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "phrase\n\t\t\t\t\t\t(languageid, fieldname, varname, text, product, username, dateline, version)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t" . implode(",\n", $phrase_sql));
}
}
// stop the 'dots' counter feedback
print_dots_stop();
require_once DIR . '/includes/adminfunctions_language.php';
build_language();
}
示例3: xml_import_style
/**
* Reads XML style file and imports data from it into the database
*
* @param string XML data
* @param integer Style ID
* @param integer Parent style ID
* @param string New style title
* @param boolean Allow vBulletin version mismatch
* @param integer Display order for new style
* @param boolean Allow user selection of new style
*/
function xml_import_style($xml = false, $styleid = -1, $parentid = -1, $title = '', $anyversion = false, $displayorder = 1, $userselect = true)
{
// $GLOBALS['path'] needs to be passed into this function or reference $vbulletin->GPC['path']
global $vbulletin, $vbphrase;
print_dots_start('<b>' . $vbphrase['importing_style'] . "</b>, {$vbphrase['please_wait']}", ':', 'dspan');
require_once DIR . '/includes/class_xml.php';
$xmlobj = new vB_XML_Parser($xml, $vbulletin->GPC['path']);
if ($xmlobj->error_no == 1) {
print_dots_stop();
print_stop_message('no_xml_and_no_path');
} else {
if ($xmlobj->error_no == 2) {
print_dots_stop();
print_stop_message('please_ensure_x_file_is_located_at_y', 'vbulletin-style.xml', $vbulletin->GPC['path']);
}
}
if (!($arr = $xmlobj->parse())) {
print_dots_stop();
print_stop_message('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line());
}
if (!$arr['templategroup']) {
print_dots_stop();
print_stop_message('invalid_file_specified');
}
$version = $arr['vbversion'];
$master = $arr['type'] == 'master' ? 1 : 0;
$title = empty($title) ? $arr['name'] : $title;
$product = empty($arr['product']) ? 'vbulletin' : $arr['product'];
$arr = $arr['templategroup'];
if (empty($arr[0])) {
$arr = array($arr);
}
$full_product_info = fetch_product_list(true);
$product_info = $full_product_info["{$product}"];
// version check
if ($version != $product_info['version'] and !$anyversion and !$master) {
print_dots_stop();
print_stop_message('upload_file_created_with_different_version', $product_info['version'], $version);
}
if ($master) {
// overwrite master style
echo "<h3>{$vbphrase['master_style']}</h3>\n<p>{$vbphrase['please_wait']}</p>";
vbflush();
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "template WHERE styleid = -10 AND (product = '" . $vbulletin->db->escape_string($product) . "'" . iif($product == 'vbulletin', " OR product = ''") . ")");
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "template SET styleid = -10 WHERE styleid = -1 AND (product = '" . $vbulletin->db->escape_string($product) . "'" . iif($product == 'vbulletin', " OR product = ''") . ")");
$styleid = -1;
} else {
if ($styleid == -1) {
// creating a new style
if ($test = $vbulletin->db->query_first("SELECT styleid FROM " . TABLE_PREFIX . "style WHERE title = '" . $vbulletin->db->escape_string($title) . "'")) {
print_dots_stop();
print_stop_message('style_already_exists', $title);
} else {
echo "<h3><b>" . construct_phrase($vbphrase['creating_a_new_style_called_x'], $title) . "</b></h3>\n<p>{$vbphrase['please_wait']}</p>";
vbflush();
/*insert query*/
$styleresult = $vbulletin->db->query_write("\n\t\t\t\t\tINSERT INTO " . TABLE_PREFIX . "style\n\t\t\t\t\t(title, parentid, displayorder, userselect)\n\t\t\t\t\tVALUES\n\t\t\t\t\t('" . $vbulletin->db->escape_string($title) . "', {$parentid}, {$displayorder}, " . ($userselect ? 1 : 0) . ")\n\t\t\t\t");
$styleid = $vbulletin->db->insert_id($styleresult);
}
} else {
// overwriting an existing style
if ($getstyle = $vbulletin->db->query_first("SELECT title FROM " . TABLE_PREFIX . "style WHERE styleid = {$styleid}")) {
echo "<h3><b>" . construct_phrase($vbphrase['overwriting_style_x'], $getstyle['title']) . "</b></h3>\n<p>{$vbphrase['please_wait']}</p>";
vbflush();
} else {
print_dots_stop();
print_stop_message('cant_overwrite_non_existent_style');
}
}
}
// types array...
$types = array($vbphrase['template'], $vbphrase['stylevar'], $vbphrase['css'], $vbphrase['replacement_variable']);
$querybits = array();
$querytemplates = 0;
foreach ($arr as $templategroup) {
if (empty($templategroup['template'][0])) {
$tg = array($templategroup['template']);
} else {
$tg =& $templategroup['template'];
}
foreach ($tg as $template) {
$title = $vbulletin->db->escape_string($template['name']);
$template['template'] = $vbulletin->db->escape_string($template['value']);
$template['username'] = $vbulletin->db->escape_string($template['username']);
if ($template['templatetype'] != 'template') {
// template is a special template
$querybits[] = "({$styleid}, '{$template['templatetype']}', '{$title}', '{$template['template']}', '', {$template['date']}, '{$template['username']}', '" . $vbulletin->db->escape_string($template['version']) . "', '" . $vbulletin->db->escape_string($product) . "')";
} else {
// template is a standard template
//.........这里部分代码省略.........
示例4: array
}
// #############################################################################
if ($_POST['do'] == 'doimport') {
$vbulletin->input->clean_array_gpc('p', array('serverfile' => TYPE_STR));
$vbulletin->input->clean_array_gpc('f', array('pluginfile' => TYPE_FILE));
// got an uploaded file?
if (file_exists($vbulletin->GPC['pluginfile']['tmp_name'])) {
$xml = file_read($vbulletin->GPC['pluginfile']['tmp_name']);
} else {
if (file_exists($vbulletin->GPC['serverfile'])) {
$xml = file_read($vbulletin->GPC['serverfile']);
} else {
print_stop_message('no_file_uploaded_and_no_local_file_found');
}
}
print_dots_start('<b>' . $vbphrase['importing_plugins'] . "</b>, {$vbphrase['please_wait']}", ':', 'dspan');
require_once DIR . '/includes/class_xml.php';
$xmlobj = new vB_XML_Parser($xml);
if ($xmlobj->error_no == 1) {
print_dots_stop();
print_stop_message('no_xml_and_no_path');
}
if (!($arr = $xmlobj->parse())) {
print_dots_stop();
print_stop_message('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line());
}
if (!$arr['plugin']) {
print_dots_stop();
if (!empty($arr['productid'])) {
print_stop_message('this_file_appears_to_be_a_product');
} else {
示例5: xml_import_style
/**
* Reads XML style file and imports data from it into the database
*
* @param string XML data
* @param integer Style ID
* @param integer Parent style ID
* @param string New style title
* @param boolean Allow vBulletin version mismatch
* @param integer Display order for new style
* @param boolean Allow user selection of new style
* @param int|null Starting template group index for this run of importing templates (0 based).
* Null means all templates (single run)
* @paream int|null
*
* @return array Array of information about the imported style
*/
function xml_import_style(
$xml = false,
$styleid = -1,
$parentid = -1,
$title = '',
$anyversion = false,
$displayorder = 1,
$userselect = true,
$startat = null,
$perpage = null
)
{
// $GLOBALS['path'] needs to be passed into this function or reference $vbulletin->GPC['path']
global $vbulletin, $vbphrase;
print_dots_start('<b>' . $vbphrase['importing_style'] . "</b>, $vbphrase[please_wait]", ':', 'dspan');
require_once(DIR . '/includes/class_xml.php');
//where is this used? I hate having this random global value in the middle of this function
$xmlobj = new vB_XML_Parser($xml, $vbulletin->GPC['path']);
if ($xmlobj->error_no == 1)
{
print_dots_stop();
print_stop_message('no_xml_and_no_path');
}
else if ($xmlobj->error_no == 2)
{
print_dots_stop();
print_stop_message('please_ensure_x_file_is_located_at_y', 'vbulletin-style.xml', $vbulletin->GPC['path']);
}
if(!$parsed_xml = $xmlobj->parse())
{
print_dots_stop();
print_stop_message('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line());
}
$version = $parsed_xml['vbversion'];
$master = ($parsed_xml['type'] == 'master' ? 1 : 0);
$title = (empty($title) ? $parsed_xml['name'] : $title);
$product = (empty($parsed_xml['product']) ? 'vbulletin' : $parsed_xml['product']);
$one_pass = (is_null($startat) AND is_null($perpage));
if (!$one_pass AND (!is_numeric($startat) OR !is_numeric($perpage) OR $perpage <= 0 OR $startat < 0))
{
print_dots_stop();
print_stop_message('');
}
if ($one_pass OR ($startat == 0))
{
// version check
$full_product_info = fetch_product_list(true);
$product_info = $full_product_info["$product"];
if ($version != $product_info['version'] AND !$anyversion AND !$master)
{
print_dots_stop();
print_stop_message('upload_file_created_with_different_version', $product_info['version'], $version);
}
//Initialize the style -- either init the master, create a new style, or verify the style to overwrite.
if ($master)
{
$import_data = @unserialize(fetch_adminutil_text('master_style_import'));
if (!empty($import_data) AND (TIMENOW - $import_data['last_import']) <= 30)
{
print_dots_stop();
print_stop_message('must_wait_x_seconds_master_style_import', vb_number_format($import_data['last_import'] + 30 - TIMENOW));
}
// overwrite master style
echo "<h3>$vbphrase[master_style]</h3>\n<p>$vbphrase[please_wait]</p>";
vbflush();
$vbulletin->db->query_write("
DELETE FROM " . TABLE_PREFIX . "template
WHERE styleid = -10 AND (product = '" . $vbulletin->db->escape_string($product) . "'" .
iif($product == 'vbulletin', " OR product = ''") . ")"
);
//.........这里部分代码省略.........
示例6: print_form_header
<?php
print_form_header('ame', 'importoptions', 1, 1, 'uploadform" onsubmit="return js_confirm_upload(this, this.uploadedfile);');
badhook_check();
print_table_header($vbphrase['import']);
print_description_row($vbphrase['ame_import_desc']);
print_upload_row($vbphrase['upload_xml_file'], 'uploadedfile', 999999999);
print_input_row($vbphrase['import_xml_file'], 'serverfile', './includes/xml/ame.xml');
print_submit_row($vbphrase['import'], 0);
}
/**
* Display imported results
*/
if ($do == "importoptions") {
$vbulletin->input->clean_gpc('f', 'uploadedfile', TYPE_FILE);
$vbulletin->input->clean_gpc('p', 'serverfile', TYPE_FILE);
print_dots_start($vbphrase['ame_importing']);
if (file_exists($vbulletin->GPC['uploadedfile']['tmp_name'])) {
$xml = file_read($vbulletin->GPC['uploadedfile']['tmp_name']);
} else {
if (file_exists($vbulletin->GPC['serverfile'])) {
$xml = file_read($vbulletin->GPC['serverfile']);
} else {
print_dots_stop();
print_stop_message('no_file_uploaded_and_no_local_file_found');
}
}
require_once DIR . '/includes/class_xml.php';
$xmlobj = new vB_XML_Parser($xml);
if ($xmlobj->error_no == 1) {
print_dots_stop();
print_stop_message('no_xml_and_no_path');
示例7: xml_import_language
/**
* Imports a language from a language XML file
*
* @param string XML language string
* @param integer Language to overwrite
* @param string Override title for imported language
* @param boolean Allow import of language from mismatched vBulletin version
* @param boolean Allow user-select of imported language
* @param boolean Echo output..
* @param boolean Read charset from XML header
*/
function xml_import_language($xml = false, $languageid = -1, $title = '', $anyversion = false, $userselect = true, $output = true, $readcharset = false)
{
global $vbulletin, $vbphrase;
print_dots_start('<b>' . $vbphrase['importing_language'] . "</b>, {$vbphrase['please_wait']}", ':', 'dspan');
require_once DIR . '/includes/class_xml.php';
require_once DIR . '/includes/functions_misc.php';
$xmlobj = new vB_XML_Parser($xml, $GLOBALS['path'], $readcharset);
if ($xmlobj->error_no == 1) {
print_dots_stop();
print_stop_message('no_xml_and_no_path');
} else {
if ($xmlobj->error_no == 2) {
print_dots_stop();
print_stop_message('please_ensure_x_file_is_located_at_y', 'vbulletin-language.xml', $GLOBALS['path']);
}
}
if (!($arr =& $xmlobj->parse())) {
print_dots_stop();
print_stop_message('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line());
}
if (!$arr['phrasetype']) {
print_dots_stop();
print_stop_message('invalid_file_specified');
}
$title = empty($title) ? $arr['name'] : $title;
$version = $arr['vbversion'];
$master = $arr['type'] == 'master' ? 1 : 0;
$just_phrases = $arr['type'] == 'phrases' ? 1 : 0;
if (!empty($arr['settings'])) {
$langinfo = $arr['settings'];
}
$langinfo['product'] = empty($arr['product']) ? 'vbulletin' : $arr['product'];
// look for skipped groups
$skipped_groups = array();
if (!empty($arr['skippedgroups'])) {
$skippedgroups =& $arr['skippedgroups']['skippedgroup'];
if (!is_array($skippedgroups[0])) {
$skippedgroups = array($skippedgroups);
}
foreach ($skippedgroups as $skipped) {
if (is_array($skipped)) {
$skipped_groups[] = $vbulletin->db->escape_string($skipped['value']);
} else {
$skipped_groups[] = $vbulletin->db->escape_string($skipped);
}
}
}
if ($skipped_groups) {
$sql_skipped = "AND " . TABLE_PREFIX . "phrase.fieldname NOT IN ('" . implode("', '", $skipped_groups) . "')";
} else {
$sql_skipped = '';
}
foreach ($langinfo as $key => $val) {
$langinfo["{$key}"] = $vbulletin->db->escape_string(trim($val));
}
$langinfo['options'] = intval($langinfo['options']);
if ($version != $vbulletin->options['templateversion'] and !$anyversion and !$master) {
print_dots_stop();
print_stop_message('upload_file_created_with_different_version', $vbulletin->options['templateversion'], $version);
}
//set up the phrase array
$arr = $arr['phrasetype'];
if (!is_array($arr[0])) {
$arr = array($arr);
}
//spin through the phrases to check validity. We want to do this *before* we prep for import
//so that if we abort do to an error, we haven't made any changes first
foreach (array_keys($arr) as $key) {
$phraseTypes =& $arr["{$key}"];
foreach ($phraseTypes['phrase'] as $phrase) {
if (!validate_string_for_interpolation($phrase['value'])) {
print_dots_stop();
print_stop_message('phrase_text_not_safe', $phrase['name']);
}
}
}
// prepare for import
if ($master) {
// lets stop it from dieing cause someone borked a previous update
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "phrase WHERE languageid = -10");
// master style
if ($output and VB_AREA != 'Install' and VB_AREA != 'Upgrade') {
echo "<h3>{$vbphrase['master_language']}</h3>\n<p>{$vbphrase['please_wait']}</p>";
vbflush();
}
$vbulletin->db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "phrase SET\n\t\t\t\tlanguageid = -10\n\t\t\tWHERE languageid = -1\n\t\t\t\tAND (product = '" . $vbulletin->db->escape_string($langinfo['product']) . "'" . iif($langinfo['product'] == 'vbulletin', " OR product = ''") . ")\n\t\t\t\t{$sql_skipped}\n\t\t");
$languageid = -1;
} else {
if ($languageid == 0) {
//.........这里部分代码省略.........
示例8: xml_restore_settings
/**
* Restores a settings backup from an XML file
*
* Call as follows:
* $path = './path/to/install/vbulletin-settings.xml';
* xml_import_settings($xml);
*
* @param mixed Either XML string or boolean false to use $path global variable
* @param bool Ignore blacklisted settings
*/
function xml_restore_settings($xml = false, $blacklist = true)
{
global $vbulletin, $vbphrase;
$newsettings = array();
print_dots_start('<b>' . $vbphrase['importing_settings'] . "</b>, {$vbphrase['please_wait']}", ':', 'dspan');
require_once DIR . '/includes/class_xml.php';
$xmlobj = new vB_XML_Parser($xml, $GLOBALS['path']);
if ($xmlobj->error_no == 1) {
print_dots_stop();
print_stop_message('no_xml_and_no_path');
} else {
if ($xmlobj->error_no == 2) {
print_dots_stop();
print_stop_message('please_ensure_x_file_is_located_at_y', 'vbulletin-settings.xml', $GLOBALS['path']);
}
}
if (!($newsettings = $xmlobj->parse())) {
print_dots_stop();
print_stop_message('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line());
}
if (!$newsettings['setting']) {
print_dots_stop();
print_stop_message('invalid_file_specified');
}
$product = empty($newsettings['product']) ? 'vbulletin' : $newsettings['product'];
foreach ($newsettings['setting'] as $setting) {
// Loop to update all the settings
$vbulletin->db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "setting\n\t\t\tSET value='" . $vbulletin->db->escape_string($setting['value']) . "'\n\t\t\tWHERE varname ='" . $vbulletin->db->escape_string($setting['varname']) . "'\n\t\t\t\tAND product ='" . $vbulletin->db->escape_string($product) . "'\n\t\t\t\t" . ($blacklist ? "AND blacklist = 0" : "") . "\n\t\t");
}
unset($newsettings);
// rebuild the $vbulletin->options array
build_options();
// stop the 'dots' counter feedback
print_dots_stop();
}
示例9: xml_import_grid
/**
* Reads XML grids file and imports data from it into the database
*
* @param string XML data
* @param boolean Allow overwriting of existing grids with same name
*/
function xml_import_grid($xml = false, $allowoverwrite = false)
{
// $GLOBALS['path'] needs to be passed into this function or reference $vbulletin->GPC['path']
global $vbulletin, $vbphrase;
print_dots_start('<b>' . $vbphrase['importing_grid'] . "</b>, $vbphrase[please_wait]", ':', 'dspan');
require_once(DIR . '/includes/class_xml.php');
$xmlobj = new vB_XML_Parser($xml, $vbulletin->GPC['path']);
if ($xmlobj->error_no == 1)
{
print_dots_stop();
print_stop_message('no_xml_and_no_path');
}
else if ($xmlobj->error_no == 2)
{
print_dots_stop();
print_stop_message('please_ensure_x_file_is_located_at_y', 'vbulletin-grid.xml', $vbulletin->GPC['path']);
}
if(!$arr = $xmlobj->parse())
{
print_dots_stop();
print_stop_message('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line());
}
if (!$arr['grid'])
{
print_dots_stop();
print_stop_message('invalid_file_specified');
}
$grids = array();
$gridq = $vbulletin->db->query_read("
SELECT gridid
FROM " . TABLE_PREFIX . "cms_grid
");
while ($grid = $vbulletin->db->fetch_array($gridq))
{
$grids[] = $grid['gridid'];
}
if (!is_array($arr['grid'][0]))
{
$arr['grid'] = array($arr['grid']);
}
require_once(DIR . '/includes/adminfunctions_template.php');
$newgrids = array();
foreach($arr['grid'] AS $grid)
{
$vbulletin->db->query_write("
" . ($allowoverwrite ? "REPLACE" : "INSERT IGNORE") . " INTO " . TABLE_PREFIX . "cms_grid
(title, auxheader, auxfooter, addcolumn, addcolumnsnap, addcolumnsize, gridcolumns, gridhtml)
VALUES
(
'" . $vbulletin->db->escape_string($grid['name']) . "',
" . intval($grid['auxheader']) . ",
" . intval($grid['auxfooter']) . ",
" . intval($grid['addcolumn']) . ",
" . intval($grid['addcolumnsnap']) . ",
" . intval($grid['addcolumnsize']) . ",
" . intval($grid['gridcolumns']) . ",
'" . $vbulletin->db->escape_string($grid['value']) . "'
)
");
if ($gridid = $vbulletin->db->insert_id())
{
$title = "vbcms_grid_$gridid";
$vbulletin->db->query_write("
REPLACE INTO " . TABLE_PREFIX . "template
(styleid, title, template, template_un, dateline, username, product, version)
VALUES
(
0,
'" . $vbulletin->db->escape_string($title) . "',
'" . $vbulletin->db->escape_string(compile_template($grid["value"])) . "',
'" . $vbulletin->db->escape_string($grid["value"]) . "',
" . TIMENOW . ",
'" . $vbulletin->vbulletin->userinfo['username'] . "',
'vbcms',
'" . $vbulletin->db->escape_string($vbulletin->options['templateversion']) . "'
)
");
}
}
$newgrids = array();
$gridq = $vbulletin->db->query_read("
SELECT gridid
//.........这里部分代码省略.........
示例10: install_product
/**
* Installs a product from the xml text
*
* This function depends on the vb class loader, which requires that the
* framework init is called.
*
* @return bool True if the product requires a template merge, false otherwise
*/
function install_product($xml, $allow_overwrite)
{
global $vbphrase;
global $vbulletin;
global $db;
require_once(DIR . '/includes/class_bitfield_builder.php');
require_once(DIR . '/includes/class_xml.php');
require_once(DIR . '/includes/class_block.php');
//share some code with the main xml style import
require_once(DIR . '/includes/adminfunctions_template.php');
print_dots_start('<b>' . $vbphrase['importing_product'] . "</b>, $vbphrase[please_wait]", ':', 'dspan');
$xmlobj = new vB_XML_Parser($xml);
if ($xmlobj->error_no == 1)
{
print_dots_stop();
throw new vB_Exception_AdminStopMessage('no_xml_and_no_path');
}
if(!$arr = $xmlobj->parse())
{
print_dots_stop();
throw new vB_Exception_AdminStopMessage(
array('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line()));
}
// ############## general product information
$info = array(
'productid' => substr(preg_replace('#[^a-z0-9_]#', '', strtolower($arr['productid'])), 0, 25),
'title' => $arr['title'],
'description' => $arr['description'],
'version' => $arr['version'],
'active' => $arr['active'],
'url' => $arr['url'],
'versioncheckurl' => $arr['versioncheckurl']
);
if (!$info['productid'])
{
print_dots_stop();
if (!empty($arr['plugin']))
{
throw new vB_Exception_AdminStopMessage('this_file_appears_to_be_a_plugin');
}
else
{
throw new vB_Exception_AdminStopMessage('invalid_file_specified');
}
}
if (strtolower($info['productid']) == 'vbulletin')
{
print_dots_stop();
throw new vB_Exception_AdminStopMessage(array('product_x_installed_no_overwrite', 'vBulletin'));
}
// check for bitfield conflicts on install
$bitfields = vB_Bitfield_Builder::return_data();
if (!$bitfields)
{
$bfobj =& vB_Bitfield_Builder::init();
if ($bfobj->errors)
{
print_dots_stop();
throw new vB_Exception_AdminStopMessage(array(
'bitfield_conflicts_x',
'<li>' . implode('</li><li>', $bfobj->errors) . '</li>'
));
}
}
// get system version info
$system_versions = array(
'php' => PHP_VERSION,
'vbulletin' => $vbulletin->options['templateversion'],
'products' => fetch_product_list(true)
);
$mysql_version = $db->query_first("SELECT VERSION() AS version");
$system_versions['mysql'] = $mysql_version['version'];
// ############## import dependencies
if (is_array($arr['dependencies']['dependency']))
{
$dependencies =& $arr['dependencies']['dependency'];
if (!isset($dependencies[0]))
{
$dependencies = array($dependencies);
}
//.........这里部分代码省略.........
示例11: xml_restore_settings
/**
* Restores a settings backup from an XML file
*
* Call as follows:
* $path = './path/to/install/vbulletin-settings.xml';
* xml_import_settings($xml);
*
* @param mixed Either XML string or boolean false to use $path global variable
* @param bool Ignore blacklisted settings
*/
function xml_restore_settings($xml = false, $blacklist = true)
{
$newsettings = array();
$vbphrase = vB_Api::instanceInternal('phrase')->fetch(array('please_wait', 'importing_settings'));
print_dots_start('<b>' . $vbphrase['importing_settings'] . "</b>, {$vbphrase['please_wait']}", ':', 'dspan');
require_once DIR . '/includes/class_xml.php';
$xmlobj = new vB_XML_Parser($xml, $GLOBALS['path']);
if ($xmlobj->error_no() == 1) {
print_dots_stop();
print_stop_message2('no_xml_and_no_path');
} else {
if ($xmlobj->error_no() == 2) {
print_dots_stop();
print_stop_message('please_ensure_x_file_is_located_at_y', 'vbulletin-settings.xml', $GLOBALS['path']);
}
}
if (!($newsettings = $xmlobj->parse())) {
print_dots_stop();
print_stop_message('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line());
}
if (!$newsettings['setting']) {
print_dots_stop();
print_stop_message2('invalid_file_specified');
}
$product = empty($newsettings['product']) ? 'vbulletin' : $newsettings['product'];
foreach ($newsettings['setting'] as $setting) {
// Loop to update all the settings
$conditions = array(array('field' => 'varname', 'value' => $setting['varname'], 'operator' => vB_dB_Query::OPERATOR_EQ), array('field' => 'product', 'value' => $product, 'operator' => vB_dB_Query::OPERATOR_EQ));
if ($blacklist) {
$conditions[] = array('field' => 'blacklist', 'value' => 0, 'operator' => vB_dB_Query::OPERATOR_EQ);
}
vB::getDbAssertor()->assertQuery('setting', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_UPDATE, 'value' => $setting['value'], vB_dB_Query::CONDITIONS_KEY => $conditions));
}
unset($newsettings);
// rebuild the options array
vB::getDatastore()->build_options();
// stop the 'dots' counter feedback
print_dots_stop();
}
示例12: install_product
/**
* Installs a product from the xml text
*
* This function depends on the vb class loader, which requires that the
* framework init is called.
*
* @return bool True if the product requires a template merge, false otherwise
*/
function install_product($xml, $allow_overwrite = false, $verbose = true)
{
global $vbphrase;
global $vbulletin;
$assertor = vB::getDbAssertor();
require_once DIR . '/includes/class_bitfield_builder.php';
require_once DIR . '/includes/class_xml.php';
//share some code with the main xml style import
require_once DIR . '/includes/adminfunctions_template.php';
if ($verbose) {
print_dots_start('<b>' . $vbphrase['importing_product'] . "</b>, {$vbphrase['please_wait']}", ':', 'dspan');
}
$xmlobj = new vB_XML_Parser($xml);
if ($xmlobj->error_no() == 1) {
if ($verbose) {
print_dots_stop();
}
throw new vB_Exception_AdminStopMessage('no_xml_and_no_path');
}
if (!($arr = $xmlobj->parse())) {
if ($verbose) {
print_dots_stop();
}
throw new vB_Exception_AdminStopMessage(array('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line()));
}
// ############## general product information
$info = array('productid' => substr(preg_replace('#[^a-z0-9_]#', '', strtolower($arr['productid'])), 0, 25), 'title' => $arr['title'], 'description' => $arr['description'], 'version' => $arr['version'], 'active' => $arr['active'], 'url' => $arr['url'], 'versioncheckurl' => $arr['versioncheckurl']);
if (!$info['productid']) {
if ($verbose) {
print_dots_stop();
}
throw new vB_Exception_AdminStopMessage('invalid_file_specified');
}
if (strtolower($info['productid']) == 'vbulletin') {
if ($verbose) {
print_dots_stop();
}
throw new vB_Exception_AdminStopMessage(array('product_x_installed_no_overwrite', 'vBulletin'));
}
// check for bitfield conflicts on install
$bitfields = vB_Bitfield_Builder::return_data();
if (!$bitfields) {
$bfobj =& vB_Bitfield_Builder::init();
if ($bfobj->errors) {
if ($verbose) {
print_dots_stop();
}
throw new vB_Exception_AdminStopMessage(array('bitfield_conflicts_x', '<li>' . implode('</li><li>', $bfobj->errors) . '</li>'));
}
}
// get system version info
$system_versions = array('php' => PHP_VERSION, 'vbulletin' => $vbulletin->options['templateversion'], 'products' => fetch_product_list(true));
$mysql_version = $assertor->getRow('mysqlVersion');
$system_versions['mysql'] = $mysql_version['version'];
// ############## import dependencies
if (isset($arr['dependencies']['dependency']) and is_array($arr['dependencies']['dependency'])) {
$dependencies =& $arr['dependencies']['dependency'];
if (!isset($dependencies[0])) {
$dependencies = array($dependencies);
}
$dependency_errors = array();
$ignore_dependency_errors = array();
// let's check the dependencies
foreach ($dependencies as $dependency) {
// if we get an error, we haven't met this dependency
// if we go through without a problem, we have automatically met
// all dependencies for this "class" (mysql, php, vb, a specific product, etc)
$this_dependency_met = true;
// build a phrase for the version compats -- will look like (minver / maxver)
if ($dependency['minversion']) {
$compatible_phrase = construct_phrase($vbphrase['compatible_starting_with_x'], htmlspecialchars_uni($dependency['minversion']));
} else {
$compatible_phrase = '';
}
if ($dependency['maxversion']) {
$incompatible_phrase = construct_phrase($vbphrase['incompatible_with_x_and_greater'], htmlspecialchars_uni($dependency['maxversion']));
} else {
$incompatible_phrase = '';
}
if ($compatible_phrase or $incompatible_phrase) {
$required_version_info = "({$compatible_phrase}";
if ($compatible_phrase and $incompatible_phrase) {
$required_version_info .= ' / ';
}
$required_version_info .= "{$incompatible_phrase})";
}
// grab the appropriate installed version string
if ($dependency['dependencytype'] == 'product') {
// group dependencies into types -- individual products get their own group
$dependency_type_key = "product-{$dependency['parentproductid']}";
// undocumented feature -- you can put a producttitle attribute in a dependency so the id isn't displayed
$parent_product_title = !empty($dependency['producttitle']) ? $dependency['producttitle'] : $dependency['parentproductid'];
//.........这里部分代码省略.........
示例13: xml_import_style
/**
* Reads XML style file and imports data from it into the database
*
* @param string XML data
* @param integer Style ID
* @param integer Parent style ID
* @param string New style title
* @param boolean Allow vBulletin version mismatch
* @param integer Display order for new style
* @param boolean Allow user selection of new style
* @param int|null Starting template group index for this run of importing templates (0 based). Null means all templates (single run)
* @param int|null
* @param int 0 = normal import, 1 = style generator
* @param string Import Filename
*
* @return array Array of information about the imported style
*/
function xml_import_style($xml = false, $styleid = -1, $parentid = -1, $title = '', $anyversion = false, $displayorder = 1, $userselect = true, $startat = null, $perpage = null, $importtype = 0, $filename = 'vbulletin-style.xml')
{
// $GLOBALS['path'] needs to be passed into this function or reference $vbulletin->GPC['path']
global $vbulletin, $vbphrase;
print_dots_start('<b>' . $vbphrase['importing_style'] . "</b>, {$vbphrase['please_wait']}", ':', 'dspan');
require_once DIR . '/includes/class_xml.php';
//where is this used? I hate having this random global value in the middle of this function
$xmlobj = new vB_XML_Parser($xml, $vbulletin->GPC['path']);
if ($xmlobj->error_no == 1) {
print_dots_stop();
print_stop_message('no_xml_and_no_path');
} else {
if ($xmlobj->error_no == 2) {
print_dots_stop();
print_stop_message('please_ensure_x_file_is_located_at_y', $filename, $vbulletin->GPC['path']);
}
}
if (!($parsed_xml = $xmlobj->parse())) {
print_dots_stop();
print_stop_message('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line());
}
if (!$styleid) {
if ($parentid == -1 or $parentid == -2) {
$styleid = $parentid;
} else {
$style = $vbulletin->db->query_first("\n\t\t\t\tSELECT IF(type = 'standard', -1, -2) AS mastertype\n\t\t\t\tFROM " . TABLE_PREFIX . "style\n\t\t\t\tWHERE styleid = {$parentid}\n\t\t\t");
$styleid = $style['mastertype'];
}
}
$version = $parsed_xml['vbversion'];
$master = $parsed_xml['type'] == 'master' ? true : false;
$mobilemaster = $parsed_xml['type'] == 'mobilemaster' ? true : false;
$title = empty($title) ? $parsed_xml['name'] : $title;
$product = empty($parsed_xml['product']) ? 'vbulletin' : $parsed_xml['product'];
$one_pass = (is_null($startat) and is_null($perpage));
if (!$one_pass and (!is_numeric($startat) or !is_numeric($perpage) or $perpage <= 0 or $startat < 0)) {
print_dots_stop();
print_stop_message('');
}
if ($one_pass or $startat == 0) {
// version check
$full_product_info = fetch_product_list(true);
$product_info = $full_product_info["{$product}"];
if ($version != $product_info['version'] and !$anyversion and !$master and !$mobilemaster) {
print_dots_stop();
print_stop_message('upload_file_created_with_different_version', $product_info['version'], $version);
}
//Initialize the style -- either init the master, create a new style, or verify the style to overwrite.
if ($master or $mobilemaster) {
$styleid = $master ? -1 : -2;
$specialstyleid = $master ? -10 : -20;
$import_data = @unserialize(fetch_adminutil_text("master_style_import_{$product}_{$specialstyleid}"));
if (!empty($import_data) and TIMENOW - $import_data['last_import'] <= 30) {
print_dots_stop();
if ($master) {
print_stop_message('must_wait_x_seconds_master_style_import', vb_number_format($import_data['last_import'] + 30 - TIMENOW));
} else {
print_stop_message('must_wait_x_seconds_mobile_master_style_import', vb_number_format($import_data['last_import'] + 30 - TIMENOW));
}
}
$stylename = $master ? $vbphrase['master_style'] : $vbphrase['mobile_master_style'];
// overwrite master style
if (VB_AREA != 'Upgrade' and VB_AREA != 'Install') {
echo "<h3>{$stylename}</h3>\n<p>{$vbphrase['please_wait']}</p>";
vbflush();
}
$vbulletin->db->query_write("\n\t\t\t\tDELETE FROM " . TABLE_PREFIX . "template\n\t\t\t\tWHERE styleid = {$specialstyleid} AND (product = '" . $vbulletin->db->escape_string($product) . "'" . ($product == 'vbulletin' ? " OR product = ''" : "") . ")");
$vbulletin->db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "template\n\t\t\t\tSET styleid = {$specialstyleid} WHERE styleid = {$styleid} AND (product = '" . $vbulletin->db->escape_string($product) . "'" . ($product == 'vbulletin' ? " OR product = ''" : "") . ")");
} else {
if ($styleid == -1 or $styleid == -2) {
$type = $styleid == -1 ? 'standard' : 'mobile';
// creating a new style
$test = $vbulletin->db->query_first("\n\t\t\t\t\tSELECT styleid FROM " . TABLE_PREFIX . "style\n\t\t\t\t\tWHERE\n\t\t\t\t\t\ttitle = '" . $vbulletin->db->escape_string($title) . "'\n\t\t\t\t\t\t\tAND\n\t\t\t\t\t\ttype = '{$type}'\n\t\t\t\t");
if ($test) {
print_dots_stop();
print_stop_message('style_already_exists', $title);
} else {
echo "<h3><b>" . construct_phrase($vbphrase['creating_a_new_style_called_x'], $title) . "</b></h3>\n<p>{$vbphrase['please_wait']}</p>";
vbflush();
/*insert query*/
$styleresult = $vbulletin->db->query_write("\n\t\t\t\t\t\tINSERT INTO " . TABLE_PREFIX . "style\n\t\t\t\t\t\t(title, parentid, displayorder, userselect, type)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t('" . $vbulletin->db->escape_string($title) . "', {$parentid}, {$displayorder}, " . ($userselect ? 1 : 0) . ", '{$type}')\n\t\t\t\t\t");
$styleid = $vbulletin->db->insert_id($styleresult);
}
//.........这里部分代码省略.........
示例14: print_form_header
<?php
print_form_header('automediaembed_admin', 'importoptions', 1, 1, 'uploadform" onsubmit="return js_confirm_upload(this, this.uploadedfile);');
print_table_header($vbphrase['import']);
print_description_row($vbphrase['automediaembed_import_desc']);
print_upload_row($vbphrase['upload_xml_file'], 'uploadedfile', 999999999);
print_input_row($vbphrase['import_xml_file'], 'serverfile', './includes/xml/ame.xml');
print_submit_row($vbphrase['import'], 0);
}
/**
* Display imported results
*/
if ($action == "importoptions") {
$vbulletin->input->clean_gpc('f', 'uploadedfile', TYPE_FILE);
$vbulletin->input->clean_gpc('p', 'serverfile', TYPE_FILE);
print_dots_start($vbphrase['automediaembed_importing']);
if (file_exists($vbulletin->GPC['uploadedfile']['tmp_name'])) {
$xml = file_read($vbulletin->GPC['uploadedfile']['tmp_name']);
} else {
if (file_exists($vbulletin->GPC['serverfile'])) {
$xml = file_read($vbulletin->GPC['serverfile']);
} else {
print_stop_message('no_file_uploaded_and_no_local_file_found');
}
}
require_once DIR . '/includes/class_xml.php';
$xmlobj = new vB_XML_Parser($xml);
if ($xmlobj->error_no == 1) {
print_dots_stop();
print_stop_message('no_xml_and_no_path');
}
示例15: xml_import_style
/**
* Reads XML style file and imports data from it into the database
*
* @param string $xml XML data
* @param integer $styleid Style ID
* @param integer $parentid Parent style ID
* @param string $title New style title
* @param boolean $anyversion Allow vBulletin version mismatch
* @param integer $displayorder Display order for new style
* @param boolean $userselct Allow user selection of new style
* @param int|null $startat Starting template group index for this run of importing templates (0 based). Null means all templates (single run)
* @param int|null $perpage Number of templates to import at a time
* @param boolean $scilent Run silently (do not echo)
* @param array|boolean $parsed_xml Parsed array of XML data. If provided the function will ignore $xml and use the provided, already parsed data.
*
* @return array Array of information about the imported style
*/
function xml_import_style($xml = false, $styleid = -1, $parentid = -1, $title = '', $anyversion = false, $displayorder = 1, $userselect = true, $startat = null, $perpage = null, $scilent = false, $parsed_xml = false)
{
// $GLOBALS['path'] needs to be passed into this function or reference $vbulletin->GPC['path']
//checking the root node name
if (!empty($xml)) {
$r = new XMLReader();
if ($r->xml($xml)) {
if ($r->read()) {
$node_name = $r->name;
if ($node_name != 'style') {
print_stop_message2('file_uploaded_not_in_right_format_error');
}
} else {
//can not read the document
print_stop_message2('file_uploaded_unreadable');
}
} else {
//can not open the xml
print_stop_message2('file_uploaded_unreadable');
}
}
global $vbulletin;
if (!$scilent) {
$vbphrase = vB_Api::instanceInternal('phrase')->fetch(array('importing_style', 'please_wait', 'creating_a_new_style_called_x'));
print_dots_start('<b>' . $vbphrase['importing_style'] . "</b>, {$vbphrase['please_wait']}", ':', 'dspan');
}
require_once DIR . '/includes/class_xml.php';
if (empty($parsed_xml)) {
//where is this used? I hate having this random global value in the middle of this function
$xmlobj = new vB_XML_Parser($xml, $vbulletin->GPC['path']);
if ($xmlobj->error_no() == 1) {
if ($scilent) {
throw new vB_Exception_AdminStopMessage('no_xml_and_no_path');
}
print_dots_stop();
print_stop_message2('no_xml_and_no_path');
} else {
if ($xmlobj->error_no() == 2) {
if ($scilent) {
throw new vB_Exception_AdminStopMessage(array('please_ensure_x_file_is_located_at_y', 'vbulletin-style.xml', $vbulletin->GPC['path']));
}
print_dots_stop();
print_stop_message2(array('please_ensure_x_file_is_located_at_y', 'vbulletin-style.xml', $vbulletin->GPC['path']));
}
}
if (!($parsed_xml = $xmlobj->parse())) {
if ($scilent) {
throw new vB_Exception_AdminStopMessage(array('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line()));
}
print_dots_stop();
print_stop_message2(array('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line()));
}
}
$version = $parsed_xml['vbversion'];
$master = $parsed_xml['type'] == 'master' ? 1 : 0;
$title = empty($title) ? $parsed_xml['name'] : $title;
$product = empty($parsed_xml['product']) ? 'vbulletin' : $parsed_xml['product'];
$one_pass = (is_null($startat) and is_null($perpage));
if (!$one_pass and (!is_numeric($startat) or !is_numeric($perpage) or $perpage <= 0 or $startat < 0)) {
if ($scilent) {
throw new vB_Exception_AdminStopMessage('');
}
print_dots_stop();
print_stop_message2('');
}
$outputtext = '';
if ($one_pass or $startat == 0) {
require_once DIR . '/includes/adminfunctions.php';
// version check
$full_product_info = fetch_product_list(true);
$product_info = $full_product_info["{$product}"];
if ($version != $product_info['version'] and !$anyversion and !$master) {
if ($scilent) {
throw new vB_Exception_AdminStopMessage(array('upload_file_created_with_different_version', $product_info['version'], $version));
}
print_dots_stop();
print_stop_message2(array('upload_file_created_with_different_version', $product_info['version'], $version));
}
//Initialize the style -- either init the master, create a new style, or verify the style to overwrite.
if ($master) {
$import_data = @unserialize(fetch_adminutil_text('master_style_import'));
if (!empty($import_data) and TIMENOW - $import_data['last_import'] <= 30) {
if ($scilent) {
//.........这里部分代码省略.........