• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP fetch_js_safe_string函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: foreach

        $JS_STYLETITLES[] = "\"0\" : \"" . $vbphrase['master_style'] . "\"";
        $prepend = '--';
    }
    foreach ($stylecache as $style) {
        $JS_STYLETITLES[] = "\"{$style['styleid']}\" : \"" . addslashes_js($style['title'], '"') . "\"";
        $JS_STYLEPARENTS[] = "\"{$style['styleid']}\" : \"{$style['parentid']}\"";
    }
    $JS_MONTHS = array();
    $i = 0;
    $months = array('january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december');
    foreach ($months as $month) {
        $JS_MONTHS[] = "\"{$i}\" : \"" . $vbphrase["{$month}"] . "\"";
        $i++;
    }
    foreach (array('click_the_expand_collapse_button', 'this_template_has_been_customized_in_a_parent_style', 'this_template_has_not_been_customized', 'this_template_has_been_customized_in_this_style', 'template_last_edited_js', 'x_templates') as $phrasename) {
        $JS_PHRASES[] = "\"{$phrasename}\" : \"" . fetch_js_safe_string($vbphrase["{$phrasename}"]) . "\"";
    }
    ?>

<script type="text/javascript">
<!--
var SESSIONHASH = "<?php 
    echo $vbulletin->session->vars['sessionhash'];
    ?>
";
var EXPANDSET = "<?php 
    echo $vbulletin->GPC['expandset'];
    ?>
";
var GROUP = "<?php 
    echo $vbulletin->GPC['group'];
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:template.php


示例2: fetch_js_safe_string

	foreach($months AS $month)
	{
		$JS_MONTHS[] = "\"$i\" : \"" . $vbphrase["$month"] . "\"";
		$i++;
	}

	foreach (array(
		'click_the_expand_collapse_button',
		'this_template_has_been_customized_in_a_parent_style',
		'this_template_has_not_been_customized',
		'this_template_has_been_customized_in_this_style',
		'template_last_edited_js',
		'x_templates'
		) AS $phrasename)
	{
		$JS_PHRASES[] = "\"$phrasename\" : \"" . fetch_js_safe_string($vbphrase["$phrasename"]) . "\"";
	}

?>

<script type="text/javascript">
<!--
var SESSIONHASH = "<?php echo $vbulletin->session->vars['sessionhash']; ?>";
var EXPANDSET = "<?php echo $vbulletin->GPC['expandset']; ?>";
var GROUP = "<?php echo $vbulletin->GPC['group']; ?>";
var SEARCHSTRING = "<?php echo urlencode($vbulletin->GPC['searchstring']); ?>";
var STYLETITLE = { <?php echo implode(', ', $JS_STYLETITLES); ?> };
var STYLEPARENTS = { <?php echo implode(', ', $JS_STYLEPARENTS); ?> };
var MONTH = { <?php echo implode(', ', $JS_MONTHS); ?> };
var vbphrase = {
	<?php echo implode(",\r\n\t", $JS_PHRASES) . "\r\n"; ?>
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:template.php


示例3: print_template_javascript

/**
* Prints a row containing template search javascript controls
*/
function print_template_javascript()
{
    global $stylevar, $vbphrase, $vbulletin;
    print_phrase_ref_popup_javascript();
    echo '<script type="text/javascript" src="../clientscript/vbulletin_templatemgr.js"></script>';
    echo '<script type="text/javascript">
<!--
	var textarea_id = "' . $vbulletin->textarea_id . '";
	var vbphrase = { \'not_found\' : "' . fetch_js_safe_string($vbphrase['not_found']) . '" };
// -->
</script>
';
    print_label_row(iif(is_browser('ie') or is_browser('mozilla', '20040707'), $vbphrase['search_in_template'], $vbphrase['additional_functions']), iif(is_browser('ie') or is_browser('mozilla', '1.7'), '
	<input type="text" class="bginput" name="string" accesskey="t" value="' . htmlspecialchars_uni($vbulletin->GPC['searchstring']) . '" size="20" onChange="n=0;" tabindex="1" />
	<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['find'] . ' " accesskey="f" onClick="findInPage(document.cpform.string.value);" tabindex="1" />
	&nbsp;') . '<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['copy'] . ' " accesskey="c" onclick="HighlightAll();" tabindex="1" />
	&nbsp;
	<input type="button" class="button" style="font-weight:normal" value="' . $vbphrase['view_quickref'] . '" accesskey="v" onclick="js_open_phrase_ref(0, 0);" tabindex="1" />
	');
}
开发者ID:holandacz,项目名称:nb4,代码行数:23,代码来源:adminfunctions_template.php


示例4: print_color_input_row

	protected function print_color_input_row($title, $name, $value)
	{
		$cp = "";

		//only include the colorpicker on the first color element.
		if (self::$need_colorpicker)
		{
			//construct all of the markup/javascript for the color picker.
			global $vbulletin;

			//set from construct_color_picker
			global $colorPickerWidth, $colorPickerType;

			$cp = '<script type="text/javascript" src="' . $vbulletin->options['bburl'] .
				'/clientscript/vbulletin_cpcolorpicker.js?v=' .
				$vbulletin->options['simpleversion'] . '"></script>' . "\n";
			$cp .= construct_color_picker(11);

			$js_phrases[] = array();
			foreach (array(
				'css_value_invalid',
				'color_picker_not_ready',
			) AS $phrasename)
			{
				$js_phrases[] = "vbphrase.$phrasename = \"" . fetch_js_safe_string($vbphrase["$phrasename"]) . "\"";
			}

			$js_phrases = implode(";\r\n\t", $js_phrases) . ";\r\n";

			$cp .= '
					<script type="text/javascript">
					<!--
					var bburl = "' . $vbulletin->options['bburl'] .'";
					var cpstylefolder = "' . $vbulletin->options['cpstylefolder'] .'";
					var colorPickerWidth = ' . intval($colorPickerWidth) . ';
					var colorPickerType = ' . intval($colorPickerType) . ';
					if(vbphrase == undefined) {vbphrase = new Object();}
					' . $js_phrases . '

					vBulletin.events.systemInit.subscribe(function()
					{
						init_color_preview();
					});
					var cleargifurl = "' .$vbulletin->options['cleargifurl'] .'";
					//-->
				</script>';

			self::$need_colorpicker = false;
		}

		$id = 'color_'. self::$count;

		$color_preview = '<div id="preview_' . self::$count .
			'" class="colorpreview" onclick="open_color_picker(' . self::$count . ', event)"></div>';

		$title_attr = ($vbulletin->debug ? " title=\"name=&quot;$name&quot;\"" : '');
		$cell =
			"<div id=\"ctrl_$name\" class=\"color_input_container\">" .
				"<input type=\"text\" name=\"$name\" id=\"$id\" " .
					"value=\"$value\" " .
					"tabindex=\"1\" $title_attr />" .
			"</div>";

		print_label_row(
			$title,
			$cp . $cell . $color_preview,
			'', 'top', $name
		);

		self::$count++;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:71,代码来源:class_stylevar.php


示例5: array

        }
    }
    // make array for daysprune menu
    $pruneoptions = array('0' => '- ' . $vbphrase['use_forum_default'] . ' -', '1' => $vbphrase['show_threads_from_last_day'], '2' => construct_phrase($vbphrase['show_threads_from_last_x_days'], 2), '7' => $vbphrase['show_threads_from_last_week'], '10' => construct_phrase($vbphrase['show_threads_from_last_x_days'], 10), '14' => construct_phrase($vbphrase['show_threads_from_last_x_weeks'], 2), '30' => $vbphrase['show_threads_from_last_month'], '45' => construct_phrase($vbphrase['show_threads_from_last_x_days'], 45), '60' => construct_phrase($vbphrase['show_threads_from_last_x_months'], 2), '75' => construct_phrase($vbphrase['show_threads_from_last_x_days'], 75), '100' => construct_phrase($vbphrase['show_threads_from_last_x_days'], 100), '365' => $vbphrase['show_threads_from_last_year'], '-1' => $vbphrase['show_all_threads']);
    if ($pruneoptions["{$user['daysprune']}"] == '') {
        $pruneoptions["{$user['daysprune']}"] = construct_phrase($vbphrase['show_threads_from_last_x_days'], $user['daysprune']);
    }
    ($hook = vBulletinHook::fetch_hook('useradmin_edit_start')) ? eval($hook) : false;
    if ($vbulletin->GPC['userid']) {
        // a little javascript for the options menus
        ?>
		<script type="text/javascript">
		function pick_a_window(url)
		{
			var modcpurl = "<?php 
        echo fetch_js_safe_string($vbulletin->config['Misc']['modcpdir']);
        ?>
";
			if (url != '')
			{
				if (url.substr(0, 3) == '../' && url.substr(3, modcpurl.length) != modcpurl)
				{
					window.open(url);
				}
				else
				{
					window.location = url;
				}
			}
			return false;
		}
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:user.php


示例6: build_language

/**
* Reads a language or languages and updates the language db table with the denormalized phrase cache
*
* @param	integer	ID of language to be built; if -1, build all
* @param	integer	Not sure actually... any ideas?
* @param	boolean.  Wether to reset the static vars the function uses to cache items for recursing
* 			when we we build the master language.  Otherwise if we attempt to call this function
* 			twice in the same pageload we don't actually manage to update any changes after the first
* 			call.
* 			The better approach would be to use an internal function and a master function t
* 			hat generates the cached values once and passes them in.
* 			However that means unwinding this function which works but is... odd.
*/
function build_language($languageid = -1, $phrasearray = 0, $reset_static = true)
{
    static $masterlang = null, $jsphrases = null;
    if ($reset_static) {
        $masterlang = null;
        $jsphrases = null;
    }
    // load js safe phrases
    if ($jsphrases === null) {
        require_once DIR . '/includes/class_xml.php';
        $xmlobj = new vB_XML_Parser(false, DIR . '/includes/xml/js_safe_phrases.xml');
        $safephrases = $xmlobj->parse();
        $jsphrases = array();
        if (is_array($safephrases['phrase'])) {
            foreach ($safephrases['phrase'] as $varname) {
                $jsphrases["{$varname}"] = true;
            }
        }
        unset($safephrases, $xmlobj);
    }
    // update all languages if this is the master language
    if ($languageid == -1) {
        $languages = vB::getDatastore()->getValue('languagecache');
        if (empty($languages)) {
            // during install, the datastore is empty
            $languages = vB::getDbAssertor()->assertQuery('language', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT, vB_Db_Query::COLUMNS_KEY => array('languageid')));
        }
        foreach ($languages as $language) {
            build_language($language['languageid'], 0, false);
        }
        return;
    }
    // get phrase types for language update
    $gettypes = array();
    $getphrasetypes = vB::getDbAssertor()->getRows('vBForum:fetchphrasetypes', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_STORED));
    foreach ($getphrasetypes as $getphrasetype) {
        $gettypes[] = $getphrasetype['fieldname'];
    }
    unset($getphrasetype);
    //This can be called early in the install process, before phrases have been inserted
    if (empty($gettypes)) {
        return true;
    }
    if (empty($masterlang)) {
        $masterlang = array();
        $phrases = vB::getDbAssertor()->assertQuery('vBForum:phrase', array('languageid' => array(-1, 0), 'fieldname' => $gettypes, vB_dB_Query::COLUMNS_KEY => array('fieldname', 'varname', 'text')));
        foreach ($phrases as $phrase) {
            if (isset($jsphrases["{$phrase['varname']}"])) {
                $phrase['text'] = fetch_js_safe_string($phrase['text']);
            }
            if (strpos($phrase['text'], '{1}') !== false) {
                $phrase['text'] = str_replace('%', '%%', $phrase['text']);
            }
            $phrase['text'] = str_replace(array(''), '', $phrase['text']);
            $masterlang["{$phrase['fieldname']}"]["{$phrase['varname']}"] = $phrase['text'];
        }
    }
    // get phrases for language update
    $phrasearray = $masterlang;
    $phrasetemplate = array();
    $phrases = vB::getDbAssertor()->assertQuery('vBForum:phrase', array('languageid' => $languageid, 'fieldname' => $gettypes, vB_dB_Query::COLUMNS_KEY => array('fieldname', 'varname', 'text')));
    foreach ($phrases as $phrase) {
        if (isset($jsphrases["{$phrase['varname']}"])) {
            $phrase['text'] = fetch_js_safe_string($phrase['text']);
        }
        if (strpos($phrase['text'], '{1}') !== false) {
            $phrase['text'] = str_replace('%', '%%', $phrase['text']);
        }
        $phrasearray["{$phrase['fieldname']}"]["{$phrase['varname']}"] = $phrase['text'];
    }
    unset($phrase);
    if (!empty($phrasearray)) {
        vB::getDbAssertor()->assertQuery('vBForum:rebuildLanguage', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_METHOD, 'phrasearray' => $phrasearray, 'languageid' => $languageid));
    }
    vB_Cache::instance()->event("vB_Language_languageCache");
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:89,代码来源:adminfunctions_language.php


示例7: build_language

/**
* Reads a language or languages and updates the language db table with the denormalized phrase cache
*
* @param	integer	ID of language to be built; if -1, build all
* @param	integer	Not sure actually... any ideas?
* @param	boolean.  Wether to reset the static vars the function uses to cache items for recursing
* 			when we we build the master language.  Otherwise if we attempt to call this function
* 			twice in the same pageload we don't actually manage to update any changes after the first
* 			call.
* 			The better approach would be to use an internal function and a master function
* 			that generates the cached values once and passes them in.
* 			However that means unwinding this function which works but is... odd.
*/
function build_language($languageid = -1, $phrasearray = 0, $reset_static = true)
{
    global $vbulletin;
    static $masterlang, $jsphrases = null;
    if ($reset_static) {
        $masterlang = null;
        $jsphrases = null;
    }
    // load js safe phrases
    if ($jsphrases === null) {
        require_once DIR . '/includes/class_xml.php';
        $xmlobj = new vB_XML_Parser(false, DIR . '/includes/xml/js_safe_phrases.xml');
        $safephrases = $xmlobj->parse();
        $jsphrases = array();
        if (is_array($safephrases['phrase'])) {
            foreach ($safephrases['phrase'] as $varname) {
                $jsphrases["{$varname}"] = true;
            }
        }
        unset($safephrases, $xmlobj);
    }
    // update all languages if this is the master language
    if ($languageid == -1) {
        $languages = $vbulletin->db->query_read("SELECT languageid FROM " . TABLE_PREFIX . "language");
        while ($language = $vbulletin->db->fetch_array($languages)) {
            build_language($language['languageid'], 0, false);
        }
        return;
    }
    // get phrase types for language update
    $gettypes = array();
    $getphrasetypes = $vbulletin->db->query_read("\n\t\tSELECT fieldname\n\t\tFROM " . TABLE_PREFIX . "phrasetype\n\t\tWHERE editrows <> 0 AND\n\t\t\tspecial = 0\n\t");
    while ($getphrasetype = $vbulletin->db->fetch_array($getphrasetypes)) {
        $gettypes[] = "'" . $vbulletin->db->escape_string($getphrasetype['fieldname']) . "'";
    }
    unset($getphrasetype);
    $vbulletin->db->free_result($getphrasetypes);
    if (empty($masterlang)) {
        $masterlang = array();
        $phrases = $vbulletin->db->query_read("\n\t\t\tSELECT fieldname, varname, text, languageid\n\t\t\tFROM " . TABLE_PREFIX . "phrase\n\t\t\tWHERE languageid IN(-1,0) AND\n\t\t\t\tfieldname IN (" . implode(',', $gettypes) . ")\n\t\t");
        while ($phrase = $vbulletin->db->fetch_array($phrases)) {
            if (isset($jsphrases["{$phrase['varname']}"])) {
                $phrase['text'] = fetch_js_safe_string($phrase['text']);
            }
            if (strpos($phrase['text'], '{1}') !== false) {
                $phrase['text'] = str_replace('%', '%%', $phrase['text']);
            }
            $phrase['text'] = str_replace(array('', ''), '', $phrase['text']);
            if (!isset($masterlang["{$phrase['fieldname']}"]["{$phrase['varname']}"]) or !$phrase['languageid']) {
                $masterlang["{$phrase['fieldname']}"]["{$phrase['varname']}"] = $phrase['text'];
            }
        }
    }
    // get phrases for language update
    $phrasearray = $masterlang;
    $phrasetemplate = array();
    $phrases = $vbulletin->db->query_read("\n\t\tSELECT varname, text, fieldname\n\t\tFROM " . TABLE_PREFIX . "phrase\n\t\tWHERE languageid = {$languageid} AND fieldname IN (" . implode(',', $gettypes) . ")\n\t");
    while ($phrase = $vbulletin->db->fetch_array($phrases, DBARRAY_BOTH)) {
        if (isset($jsphrases["{$phrase['varname']}"])) {
            $phrase['text'] = fetch_js_safe_string($phrase['text']);
        }
        if (strpos($phrase['text'], '{1}') !== false) {
            $phrase['text'] = str_replace('%', '%%', $phrase['text']);
        }
        $phrasearray["{$phrase['fieldname']}"]["{$phrase['varname']}"] = $phrase['text'];
    }
    unset($phrase);
    $vbulletin->db->free_result($phrases);
    $SQL = 'title = title';
    foreach ($phrasearray as $fieldname => $phrases) {
        ksort($phrases);
        $cachefield = $fieldname;
        $phrases = preg_replace('/\\{([0-9]+)\\}/siU', '%\\1$s', $phrases);
        $cachetext = $vbulletin->db->escape_string(serialize($phrases));
        $SQL .= ", phrasegroup_{$cachefield} = '{$cachetext}'";
    }
    // This only loads the last dateline for the ckeditor group, if this functionality is ever needed for other groups,
    // just move this code block into the foreach() above
    $maxdateline = $vbulletin->db->query_first("\n\t\tSELECT MAX(dateline) AS dateline\n\t\tFROM " . TABLE_PREFIX . "phrase\n\t\tWHERE\n\t\t\tlanguageid IN ({$languageid},-1)\n\t\t\t\tAND\n\t\t\tfieldname = 'ckeditor'\n\t");
    $info['ckeditor'] = array('maxdateline' => $maxdateline['dateline']);
    $SQL .= ", phrasegroupinfo = '" . $vbulletin->db->escape_string(serialize($info)) . "'";
    $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "language SET {$SQL} WHERE languageid = {$languageid}");
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:96,代码来源:adminfunctions_language.php


示例8: print_color_input_row

    protected function print_color_input_row($title, $stylevarid, $color_value, $stylevar_value)
    {
        global $vbphrase;
        $cp = "";
        $color_value = htmlspecialchars_uni($color_value);
        //only include the colorpicker on the first color element.
        if (self::$need_colorpicker) {
            //construct all of the markup/javascript for the color picker.
            //set from construct_color_picker
            global $colorPickerWidth, $colorPickerType;
            $cp = '<script type="text/javascript" src="' . vB::getDatastore()->getOption('bburl') . '/clientscript/vbulletin_cpcolorpicker.js?v=' . vB::getDatastore()->getOption('simpleversion') . '"></script>' . "\n";
            $cp .= construct_color_picker(11);
            $js_phrases = array();
            foreach (array('css_value_invalid', 'color_picker_not_ready') as $phrasename) {
                $js_phrases[] = "vbphrase.{$phrasename} = \"" . fetch_js_safe_string($vbphrase["{$phrasename}"]) . "\"";
            }
            $js_phrases = implode(";\r\n\t", $js_phrases) . ";\r\n";
            $cp .= '
					<script type="text/javascript">
					<!--
					var bburl = "' . vB::getDatastore()->getOption('bburl') . '";
					var cpstylefolder = "' . vB::getDatastore()->getOption('cpstylefolder') . '";
					var colorPickerWidth = ' . intval($colorPickerWidth) . ';
					var colorPickerType = ' . intval($colorPickerType) . ';
					if(vbphrase == undefined) {vbphrase = new Object();}
					' . $js_phrases . '

					vBulletin.events.systemInit.subscribe(function()
					{
						init_color_preview();
					});
					var cleargifurl = "' . vB::getDatastore()->getOption('bburl') . '/' . vB::getDatastore()->getOption('cleargifurl') . '";
					//-->
				</script>';
            self::$need_colorpicker = false;
        }
        $vb5_config =& vB::getConfig();
        $id = 'color_' . self::$count;
        $color_name = 'stylevar[' . $stylevarid . '][color]';
        $title_attr = $vb5_config['Misc']['debug'] ? " title=\"name=&quot;{$color_name}&quot;\"" : '';
        $cell = "<div id=\"ctrl_{$color_name}\" class=\"color_input_container\">" . "<input type=\"text\" name=\"{$color_name}\" id=\"{$id}\" " . "value=\"{$color_value}\" " . "tabindex=\"1\" {$title_attr} />" . "</div>";
        $color_preview = '<div id="preview_' . self::$count . '" class="colorpreview" onclick="open_color_picker(' . self::$count . ', event)"></div>';
        $or_stylevar = $this->fetch_stylevar_input($stylevarid, 'color', $stylevar_value);
        print_label_row($title, $cp . $cell . $color_preview . $or_stylevar, '', 'top', $color_name);
        construct_hidden_code('stylevar[' . $stylevarid . '][original_color]', $color_value, false);
        self::$count++;
    }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:47,代码来源:class_stylevar.php


示例9: build_language

/**
* Reads a language or languages and updates the language db table with the denormalized phrase cache
*
* @param	integer	ID of language to be built; if -1, build all
* @param	integer	Not sure actually... any ideas?	
* @param	boolean.  Wether to reset the static vars the function uses to cache items for recursing
* 			when we we build the master language.  Otherwise if we attempt to call this function
* 			twice in the same pageload we don't actually manage to update any changes after the first
* 			call. 
* 			The better approach would be to use an internal function and a master function t
* 			hat generates the cached values once and passes them in.
* 			However that means unwinding this function which works but is... odd.  
*/
function build_language($languageid = -1, $phrasearray = 0, $reset_static=true)
{
	global $vbulletin;
	static $masterlang, $jsphrases = null;

	if($reset_static)
	{
		$masterlang = null;
		$jsphrases = null; 
	}

	// load js safe phrases
	if ($jsphrases === null)
	{
		require_once(DIR . '/includes/class_xml.php');
		$xmlobj = new vB_XML_Parser(false, DIR . '/includes/xml/js_safe_phrases.xml');
		$safephrases = $xmlobj->parse();

		$jsphrases = array();

		if (is_array($safephrases['phrase']))
		{
			foreach ($safephrases['phrase'] AS $varname)
			{
				$jsphrases["$varname"] = true;
			}
		}
		unset($safephrases, $xmlobj);
	}


	// update all languages if this is the master language
	if ($languageid == -1)
	{
		$languages = $vbulletin->db->query_read("SELECT languageid FROM " . TABLE_PREFIX . "language");
		while ($language = $vbulletin->db->fetch_array($languages))
		{
			build_language($language['languageid'], 0, false);
		}
		return;
	}

	// get phrase types for language update
	$gettypes = array();
	$getphrasetypes = $vbulletin->db->query_read("
		SELECT fieldname
		FROM " . TABLE_PREFIX . "phrasetype
		WHERE editrows <> 0 AND
			special = 0
	");
	while ($getphrasetype = $vbulletin->db->fetch_array($getphrasetypes))
	{
		$gettypes[] = "'" . $vbulletin->db->escape_string($getphrasetype['fieldname']) . "'";
	}
	unset($getphrasetype);
	$vbulletin->db->free_result($getphrasetypes);

	if (empty($masterlang))
	{
		$masterlang = array();

		$phrases = $vbulletin->db->query_read("
			SELECT fieldname, varname, text
			FROM " . TABLE_PREFIX . "phrase
			WHERE languageid IN(-1,0) AND
				fieldname IN (" . implode(',', $gettypes) . ")
		");
		while ($phrase = $vbulletin->db->fetch_array($phrases))
		{
			if (isset($jsphrases["$phrase[varname]"]))
			{
				$phrase['text'] = fetch_js_safe_string($phrase['text']);
			}
			if (strpos($phrase['text'], '{1}') !== false)
			{
				$phrase['text'] = str_replace('%', '%%', $phrase['text']);
			}

			$phrase['text'] = str_replace(
				array('', ''),
				'',
				$phrase['text']
			);

			$masterlang["{$phrase['fieldname']}"]["$phrase[varname]"] = $phrase['text'];
		}
	}
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:adminfunctions_language.php


示例10: array

    }
    $user['threadedmode'] = $threaddisplaymode;
    // make array for daysprune menu
    $pruneoptions = array('0' => '- ' . $vbphrase['use_forum_default'] . ' -', '1' => $vbphrase['show_threads_from_last_day'], '2' => construct_phrase($vbphrase['show_threads_from_last_x_days'], 2), '7' => $vbphrase['show_threads_from_last_week'], '10' => construct_phrase($vbphrase['show_threads_from_last_x_days'], 10), '14' => construct_phrase($vbphrase['show_threads_from_last_x_weeks'], 2), '30' => $vbphrase['show_threads_from_last_month'], '45' => construct_phrase($vbphrase['show_threads_from_last_x_days'], 45), '60' => construct_phrase($vbphrase['show_threads_from_last_x_months'], 2), '75' => construct_phrase($vbphrase['show_threads_from_last_x_days'], 75), '100' => construct_phrase($vbphrase['show_threads_from_last_x_days'], 100), '365' => $vbphrase['show_threads_from_last_year'], '-1' => $vbphrase['show_all_threads_guser']);
    if ($pruneoptions["{$user['daysprune']}"] == '') {
        $pruneoptions["{$user['daysprune']}"] = construct_phrase($vbphrase['show_threads_from_last_x_days'], $user['daysprune']);
    }
    // Legacy Hook 'useradmin_edit_start' Removed //
    if ($vbulletin->GPC['userid']) {
        // a little javascript for the options menus
        ?>
		<script type="text/javascript">
		function pick_a_window(url)
		{
			var modcpurl = "<?php 
        echo fetch_js_safe_string($vb5_config['Misc']['modcpdir']);
        ?>
";
			if (url != '')
			{
				if (url.substr(0, 3) == '../' && url.substr(3, modcpurl.length) != modcpurl)
				{
					window.open(url);
				}
				else
				{
					window.location = url;
				}
			}
			return false;
		}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:31,代码来源:user.php


示例11: construct_phrase

	);
	if ($pruneoptions["$user[daysprune]"] == '')
	{
		$pruneoptions["$user[daysprune]"] = construct_phrase($vbphrase['show_threads_from_last_x_days'], $user['daysprune']);
	}

	($hook = vBulletinHook::fetch_hook('useradmin_edit_start')) ? eval($hook) : false;

	if ($vbulletin->GPC['userid'])
	{
		// a little javascript for the options menus
		?>
		<script type="text/javascript">
		function pick_a_window(url)
		{
			var modcpurl = "<?php echo(fetch_js_safe_string($vbulletin->config['Misc']['modcpdir'])); ?>";
			if (url != '')
			{
				if (url.substr(0, 3) == '../' && url.substr(3, modcpurl.length) != modcpurl)
				{
					window.open(url);
				}
				else
				{
					window.location = url;
				}
			}
			return false;
		}
		</script>
		<?php
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:user.php


示例12: print_template_javascript

/**
* Prints a row containing template search javascript controls
*/
function print_template_javascript($textarea_id)
{
    $vbphrase = vB_Api::instanceInternal('phrase')->fetch(array('not_found'));
    print_phrase_ref_popup_javascript();
    echo '<script type="text/javascript" src="' . vB::getDatastore()->getOption('bburl') . '/clientscript/vbulletin_templatemgr.js?v=' . SIMPLE_VERSION . '"></script>';
    echo '<script type="text/javascript">
<!--
	var vbphrase = { \'not_found\' : "' . fetch_js_safe_string($vbphrase['not_found']) . '" };
// -->
</script>
';
    activateCodeMirror(array($textarea_id));
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:16,代码来源:adminfunctions_template.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fetch_mapped_by_url函数代码示例发布时间:2022-05-15
下一篇:
PHP fetch_ip函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap