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

PHP process_replacement_vars函数代码示例

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

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



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

示例1: eval

        if ($vbulletin->GPC['reason'] == '') {
            eval(standard_error(fetch_error('noreason')));
        }
        if ($perform_floodcheck) {
            $reportobj->perform_floodcheck_commit();
        }
        $reportobj->do_report($vbulletin->GPC['reason'], $messageinfo);
        $url =& $vbulletin->url;
        eval(print_standard_redirect('redirect_reportthanks'));
    }
}
if ($_REQUEST['do'] == 'quickedit') {
    $vbulletin->input->clean_array_gpc('p', array('editorid' => TYPE_NOHTML));
    require_once DIR . '/includes/class_xml.php';
    require_once DIR . '/includes/functions_editor.php';
    $vminfo = verify_visitormessage($vbulletin->GPC['vmid']);
    $editorid = construct_edit_toolbar(htmlspecialchars_uni($vminfo['pagetext']), false, 'visitormessage', true, true, false, 'qenr', $vbulletin->GPC['editorid']);
    $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
    $xml->add_group('quickedit');
    $xml->add_tag('editor', process_replacement_vars($messagearea), array('reason' => '', 'parsetype' => 'visitormessage', 'parsesmilies' => true, 'mode' => $show['is_wysiwyg_editor']));
    $xml->close_group();
    $xml->print_xml();
}
($hook = vBulletinHook::fetch_hook('visitor_message_complete')) ? eval($hook) : false;
eval('print_output("' . fetch_template($templatename) . '");');
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:39, Wed May 30th 2012
|| # CVS: $RCSfile$ - $Revision: 39862 $
|| ####################################################################
\*======================================================================*/
开发者ID:benyamin20,项目名称:vbregistration,代码行数:31,代码来源:visitormessage.php


示例2: print_output


//.........这里部分代码省略.........
								" . (function_exists('memory_get_usage') ? "<li class=\"smallfont\" style=\"display:inline; margin-right:8px\"><span class=\"shade\">Memory Usage</span> " . number_format(memory_get_usage() / 1024) . 'KB</li>' : '') . "
								<li class=\"smallfont\" style=\"display:inline; margin-right:8px\"><span class=\"shade\">Queries Executed</span> " . (empty($_TEMPLATEQUERIES) ? $vbulletin->db->querycount : "<span title=\"Uncached Templates!\" style=\"color:red; font-weight:bold\">{$vbulletin->db->querycount}</span>") . " <a href=\"" . (htmlspecialchars($vbulletin->scriptpath)) . (strpos($vbulletin->scriptpath, '?') === false ? '?' : '&amp;') . "explain=1\" target=\"_blank\" title=\"Explain Queries\">(?)</a></li>
							</ul>
						</div>
					</div>
					<div class=\"blocksubhead collapse\">
						<a style=\"top:5px;\" class=\"collapse\" id=\"collapse_debuginfo_body\" href=\"#top\"><img src=\"" . vB_Template_Runtime::fetchStyleVar('imgdir_button') . "/collapse_40b.png\" alt=\"\" title=\"Collapse Debug Information\" /></a>
						More Information
					</div>
					<div class=\"blockbody\" id=\"debuginfo_body\">
						<div class=\"blockrow\">
							<div style=\"width:48%; float:left;\">
								<div style=\"margin-bottom:6px; font-weight:bold;\">Template Usage (" . sizeof($tempusagecache) . "):</div>
								<ul style=\"list-style:none; margin:0px; padding:0px\"><li class=\"smallfont\">" . implode('</li><li class="smallfont">', $tempusagecache) . "&nbsp;</li></ul>
								<hr style=\"margin:10px 0px 10px 0px\" />

								<div style=\"margin-bottom:6px; font-weight:bold;\">Phrase Groups Available (" . sizeof($GLOBALS['phrasegroups']) . "):</div>
								<ul style=\"list-style:none; margin:0px; padding:0px\">$phrase_groups</ul>
							</div>
							<div style=\"width:48%; float:right;\">
								<div style=\"margin-bottom:6px; font-weight:bold;\">Included Files (" . sizeof($included_files = get_included_files()) . "):</div>
								<ul style=\"list-style:none; margin:0px; padding:0px\"><li class=\"smallfont\">" . implode('</li><li class="smallfont">', str_replace(str_replace('\\', '/', DIR) . '/', '', preg_replace('#^(.*/)#si', '<span class="shade">./\1</span>', str_replace('\\', '/', $included_files)))) . "&nbsp;</li></ul>
								<hr style=\"margin:10px 0px 10px 0px\" />

								<div style=\"margin-bottom:6px; font-weight:bold;\">Hooks Called ($hook_total):</div>
								<ul style=\"list-style:none; margin:0px; padding:0px\">$hook_usage</ul>
							</div>
							<br style=\"clear:both;\" />
						</div>
					</div>
					<div class=\"blockbody\">
						<div class=\"blockrow\">
							<label>Messages:<select style=\"display:block; width:100%\">$messages</select></label>
						</div>
					</div>
				</div>
			</div>
		";

		$vartext = str_replace('</body>', "<!--start debug html-->$debughtml<!--end debug html-->\n</body>", $vartext);
	}
	// end debug code

	$output = process_replacement_vars($vartext);

	if ($vbulletin->debug AND function_exists('memory_get_usage'))
	{
		$output = preg_replace('#(<!--querycount-->Executed <b>\d+</b> queries<!--/querycount-->)#siU', 'Memory Usage: <strong>' . number_format((memory_get_usage() / 1024)) . 'KB</strong>, \1', $output);
	}

	// parse PHP include ##################
	($hook = vBulletinHook::fetch_hook('global_complete')) ? eval($hook) : false;

	// make sure headers sent returns correctly
	if (ob_get_level() AND ob_get_length())
	{
		ob_end_flush();
	}

	if (!headers_sent())
	{
		if ($vbulletin->options['gzipoutput'])
		{
			$output = fetch_gzipped_text($output, $vbulletin->options['gziplevel']);
		}

		if ($sendheader)
		{
			@header('Content-Length: ' . strlen($output));
		}
	}

	// Trigger shutdown event
	$vbulletin->shutdown->shutdown();

	if (defined('NOSHUTDOWNFUNC'))
	{
		exec_shut_down();
	}

	// show regular page
	if (empty($vbulletin->db->explain))
	{
		echo $output;
	}
	// show explain
	else
	{
		$querytime = $vbulletin->db->time_total;
		echo "\n<b>Page generated in $totaltime seconds with " . $vbulletin->db->querycount . " queries,\nspending $querytime doing MySQL queries and " . ($totaltime - $querytime) . " doing PHP things.\n\n<hr />Shutdown Queries:</b>" . (defined('NOSHUTDOWNFUNC') ? " <b>DISABLED</b>" : '') . "<hr />\n\n";
	}

	// broken if zlib.output_compression is on with Apache 2
	if (SAPI_NAME != 'apache2handler' AND SAPI_NAME != 'apache2filter')
	{
		flush();
	}

	exit;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:functions.php


示例3: array

$postbit_factory->registry =& $vbulletin;
$postbit_factory->forum =& $foruminfo;
$postbit_factory->thread =& $threadinfo;
$postbit_factory->cache = array();
$postbit_factory->bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$postbit_obj =& $postbit_factory->fetch_postbit('post');
$postbit_obj->highlight =& $replacewords;
$postbit_obj->cachable = (!$post['pagetext_html'] and $vbulletin->options['cachemaxage'] > 0 and TIMENOW - $vbulletin->options['cachemaxage'] * 60 * 60 * 24 <= $threadinfo['lastpost']);
($hook = vBulletinHook::fetch_hook('showpost_post')) ? eval($hook) : false;
$postbits = $postbit_obj->construct_postbit($post);
// save post to cache if relevant
if ($postbit_obj->cachable) {
    /*insert query*/
    $db->shutdown_query("\n\t\tREPLACE INTO " . TABLE_PREFIX . "postparsed (postid, dateline, hasimages, pagetext_html, styleid, languageid)\n\t\tVALUES (\n\t\t\t{$post['postid']}, " . intval($threadinfo['lastpost']) . ", " . intval($postbit_obj->post_cache['has_images']) . ", '" . $db->escape_string($postbit_obj->post_cache['text']) . "', " . intval(STYLEID) . ", " . intval(LANGUAGEID) . "\n\t\t\t)\n\t");
}
($hook = vBulletinHook::fetch_hook('showpost_complete')) ? eval($hook) : false;
//if ($_SERVER['REQUEST_METHOD'] == 'POST' AND
if ($vbulletin->GPC['ajax']) {
    require_once DIR . '/includes/class_xml.php';
    $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
    $xml->add_tag('postbit', process_replacement_vars($postbits));
    $xml->print_xml();
} else {
    eval('print_output("' . fetch_template('SHOWTHREAD_SHOWPOST') . '");');
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 08:19, Wed Nov 5th 2008
|| # CVS: $RCSfile$ - $Revision: 26399 $
|| ####################################################################
\*======================================================================*/
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:showpost.php


示例4: construct_edit_toolbar

	$editorid = construct_edit_toolbar(
		htmlspecialchars_uni($vminfo['pagetext']),
		false,
		'visitormessage',
		true,
		true,
		false,
		'qenr',
		$vbulletin->GPC['editorid']
	);

	$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');

	$xml->add_group('quickedit');
	$xml->add_tag('editor', process_replacement_vars($messagearea), array(
		'reason'       => '',
		'parsetype'    => 'visitormessage',
		'parsesmilies' => true,
		'mode'         => $show['is_wysiwyg_editor']
	));
	$xml->close_group();

	$xml->print_xml();
}

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

/*======================================================================*\
|| ####################################################################
|| # 
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:visitormessage.php


示例5: intval

            case 'signature':
                $dohtml = $vbulletin->userinfo['permissions']['signaturepermissions'] & $vbulletin->bf_ugp_signaturepermissions['allowhtml'];
                break;
            default:
                if (intval($vbulletin->GPC['parsetype'])) {
                    $parsetype = intval($vbulletin->GPC['parsetype']);
                    $foruminfo = fetch_foruminfo($parsetype);
                    $dohtml = $foruminfo['allowhtml'];
                    break;
                } else {
                    $dohtml = false;
                }
                //($hook = vBulletinHook::fetch_hook('editor_switch_wysiwyg_to_standard')) ? eval($hook) : false;
        }
        $html_parser = new vB_WysiwygHtmlParser($vbulletin);
        $vbulletin->GPC['pagetext'] = process_replacement_vars($html_parser->parse_wysiwyg_html_to_bbcode($vbulletin->GPC['pagetext'], $dohtml));
    }
    // If we have a posthash then only save it if it is valid
    // this can be used to grab attachments that are attached to this draft
    if ($vbulletin->GPC['posthash'] and $vbulletin->GPC['posthash'] != md5($vbulletin->GPC['poststarttime'] . $vbulletin->userinfo['userid'] . $vbulletin->userinfo['salt'])) {
        $vbulletin->GPC['posthash'] = '';
    }
    $db->query_write("\n\t\tREPLACE INTO " . TABLE_PREFIX . "autosave\n\t\t\t(contenttypeid, contentid, parentcontentid, userid, pagetext, title, posthash, dateline)\n\t\tVALUES\n\t\t(\n\t\t\t'" . $db->escape_string($vbulletin->GPC['contenttypeid']) . "',\n\t\t\t{$vbulletin->GPC['contentid']},\n\t\t\t{$vbulletin->GPC['parentcontentid']},\n\t\t\t{$vbulletin->userinfo['userid']},\n\t\t\t'" . $db->escape_string($vbulletin->GPC['pagetext']) . "',\n\t\t\t'" . $db->escape_string($vbulletin->GPC['title']) . "',\n\t\t\t'" . $db->escape_string($vbulletin->GPC['posthash']) . "',\n\t\t\t" . TIMENOW . "\n\t\t)\n\t");
    $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
    $xml->add_tag('ok', 1);
    $xml->print_xml();
}
($hook = vBulletinHook::fetch_hook('ajax_complete')) ? eval($hook) : false;
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:ajax.php


示例6: ON

    } else {
        $threadresult = $vbulletin->db->query_read_slave("\n\t\t\tSELECT pm.*, pmtext.*\n\t\t\tFROM " . TABLE_PREFIX . "pm AS pm\n\t\t\tINNER JOIN " . TABLE_PREFIX . "pmtext AS pmtext ON(pmtext.pmtextid = pm.pmtextid)\n\t\t\tWHERE (pm.parentpmid=" . $pm['parentpmid'] . "\n\t\t\t\t\tOR pm.pmid = " . $pm['parentpmid'] . ")\n\t\t\tAND pm.pmid != " . $vbulletin->GPC['pmid'] . "\n\t\t\tAND pm.userid=" . $vbulletin->userinfo['userid'] . "\n\t\t\tAND pmtext.dateline < " . intval($pm['dateline']) . "\n\t\t\tORDER BY pmtext.dateline DESC\n\t\t");
        if ($vbulletin->db->num_rows($threadresult)) {
            $threadpms = '';
            while ($threadpm = $vbulletin->db->fetch_array($threadresult)) {
                $postbit_factory = new vB_Postbit_Factory();
                $postbit_factory->registry =& $vbulletin;
                $postbit_factory->cache = array();
                $postbit_factory->bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
                $postbit_obj =& $postbit_factory->fetch_postbit('pm');
                $threadpms .= $postbit_obj->construct_postbit($threadpm);
            }
        } else {
            $threadpms = vB_Template::create('pm_nomessagehistory')->render();
        }
        $xml->add_tag('html', process_replacement_vars($threadpms));
    }
    $xml->close_group();
    $xml->print_xml(true);
}
// ############################### start pm folder view ###############################
if ($_REQUEST['do'] == 'messagelist') {
    $vbulletin->input->clean_array_gpc('r', array('folderid' => TYPE_INT, 'perpage' => TYPE_UINT, 'pagenumber' => TYPE_UINT));
    ($hook = vBulletinHook::fetch_hook('private_messagelist_start')) ? eval($hook) : false;
    $folderid = $vbulletin->GPC['folderid'];
    $folderjump = construct_folder_jump(0, $vbulletin->GPC['folderid'], false, '', true);
    $foldername = $foldernames["{$vbulletin->GPC['folderid']}"]['name'];
    // count receipts
    $receipts = $db->query_first_slave("\n\t\tSELECT\n\t\t\tSUM(IF(readtime <> 0, 1, 0)) AS confirmed,\n\t\t\tSUM(IF(readtime = 0, 1, 0)) AS unconfirmed\n\t\tFROM " . TABLE_PREFIX . "pmreceipt\n\t\tWHERE userid = " . $vbulletin->userinfo['userid']);
    // get ignored users
    $ignoreusers = preg_split('#\\s+#s', $vbulletin->userinfo['ignorelist'], -1, PREG_SPLIT_NO_EMPTY);
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:private.php


示例7: build_style

/**
* Converts all data from the template table for a style into the style table
*
* @param	integer	Style ID
* @param	string	Title of style
* @param	array	Array of actions set to true/false: docss/dostylevars/doreplacements/doposteditor
* @param	string	List of parent styles
* @param	string	Indent for HTML printing
*/
function build_style($styleid, $title = '', $actions, $parentlist = '', $indent = '')
{
    global $vbulletin, $_queries, $vbphrase, $_query_special_templates;
    static $phrase, $csscache;
    if (($actions['doreplacements'] or $actions['docss']) and $vbulletin->options['storecssasfile']) {
        $actions['docss'] = true;
        $actions['doreplacements'] = true;
    }
    if ($styleid != -1) {
        $QUERY = array();
        // echo the title and start the listings
        echo "{$indent}<li><b>{$title}</b> ... <span class=\"smallfont\">";
        vbflush();
        // build the templateid cache
        $templatelist = build_template_id_cache($styleid, 1, $parentlist);
        $QUERY[] = "templatelist = '" . $vbulletin->db->escape_string($templatelist) . "'";
        echo "({$vbphrase['templates']}) ";
        vbflush();
        // cache special templates
        if ($actions['docss'] or $actions['dostylevars'] or $actions['doreplacements'] or $actions['doposteditor']) {
            // get special templates for this style
            $template_cache = array();
            $templateids = implode(',', unserialize($templatelist));
            $templates = $vbulletin->db->query_read("\n\t\t\t\tSELECT title, template, templatetype\n\t\t\t\tFROM " . TABLE_PREFIX . "template\n\t\t\t\tWHERE templateid IN ({$templateids})\n\t\t\t\t\tAND (templatetype <> 'template' OR title IN('" . implode("', '", $_query_special_templates) . "'))\n\t\t\t");
            while ($template = $vbulletin->db->fetch_array($templates)) {
                $template_cache["{$template['templatetype']}"]["{$template['title']}"] = $template;
            }
            $vbulletin->db->free_result($templates);
        }
        // style vars
        if ($actions['dostylevars']) {
            // rebuild the stylevars field for this style
            $stylevars = array();
            foreach ($template_cache['stylevar'] as $template) {
                // set absolute paths for image directories
                /*if (substr($template['title'], 0, 7) == 'imgdir_')
                		{
                			if (!preg_match('#^https?://#i', $template['template']))
                			{
                				$template['template'] = "$template[template]";
                			}
                		}*/
                $stylevars["{$template['title']}"] = $template['template'];
            }
            $QUERY[] = "stylevars = '" . $vbulletin->db->escape_string(serialize($stylevars)) . '\'';
            echo "({$vbphrase['stylevars']}) ";
            vbflush();
        }
        // replacements
        if ($actions['doreplacements']) {
            // rebuild the replacements field for this style
            $replacements = array();
            if (is_array($template_cache['replacement'])) {
                foreach ($template_cache['replacement'] as $template) {
                    // set the key to be a case-insentitive preg find string
                    $replacementkey = '#' . preg_quote($template['title'], '#') . '#si';
                    $replacements["{$replacementkey}"] = $template['template'];
                }
                $QUERY[] = 'replacements = \'' . $vbulletin->db->escape_string(serialize($replacements)) . '\'';
            } else {
                $QUERY[] = 'replacements = \'\'';
            }
            echo "({$vbphrase['replacement_variables']}) ";
            vbflush();
        }
        // css
        if ($actions['docss']) {
            // build a quick cache with the ~old~ contents of the css fields from the style table
            if (!is_array($csscache)) {
                $csscache = array();
                $fetchstyles = $vbulletin->db->query_read("SELECT styleid, css FROM " . TABLE_PREFIX . "style");
                while ($fetchstyle = $vbulletin->db->fetch_array($fetchstyles)) {
                    $fetchstyle['css'] .= "\n";
                    $csscache["{$fetchstyle['styleid']}"] = $fetchstyle['css'];
                }
            }
            // rebuild the css field for this style
            $css = array();
            foreach ($template_cache['css'] as $template) {
                $css["{$template['title']}"] = unserialize($template['template']);
            }
            // build the CSS contents
            $csscolors = array();
            $css = construct_css($css, $styleid, $title, $csscolors);
            // attempt to delete the old css file if it exists
            delete_css_file($styleid, $csscache["{$styleid}"]);
            $adblock_is_evil = str_replace('ad', 'be', substr(md5(microtime()), 8, 8));
            $cssfilename = 'clientscript/vbulletin_css/style-' . $adblock_is_evil . '-' . str_pad($styleid, 5, '0', STR_PAD_LEFT) . '.css';
            // if we are going to store CSS as files, run replacement variable substitution on the file to be saved
            if ($vbulletin->options['storecssasfile'] and write_css_file($cssfilename, process_replacement_vars($css, array('styleid' => $styleid, 'replacements' => serialize($replacements))))) {
                $css = "@import url(\"{$cssfilename}\");";
//.........这里部分代码省略.........
开发者ID:holandacz,项目名称:nb4,代码行数:101,代码来源:adminfunctions_template.php


示例8: vB_Attach_Display_Content

        $attach = new vB_Attach_Display_Content($vbulletin, 'vBBlog_BlogEntry');
        $postattach = $attach->fetch_postattach(0, $bloginfo['blogid']);
    }
    require_once DIR . '/includes/class_blog_entry.php';
    require_once DIR . '/includes/class_bbcode_blog.php';
    require_once DIR . '/includes/class_xml.php';
    $bbcode = new vB_BbCodeParser_Blog_Snippet($vbulletin, fetch_tag_list());
    $factory = new vB_Blog_EntryFactory($vbulletin, $bbcode, $categories);
    $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
    $bloginfo['state'] = 'visible';
    $entry_handler =& $factory->create($bloginfo);
    if ($vbulletin->userinfo['userid'] == $bloginfo['userid']) {
        $entry_handler->userinfo = $vbulletin->userinfo;
    }
    $entry_handler->attachments = $postattach;
    $xml->add_tag('entrybit', process_replacement_vars($entry_handler->construct()));
    $xml->print_xml();
}
// #############################################################################
// return a comment in an editor
if ($_POST['do'] == 'quickeditcomment') {
    $vbulletin->input->clean_array_gpc('p', array('blogtextid' => TYPE_UINT, 'editorid' => TYPE_STR));
    $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
    if (!$vbulletin->options['quickedit']) {
        // if quick edit has been disabled after showthread is loaded, return a string to indicate such
        $xml->add_tag('disabled', 'true');
        $xml->print_xml();
    } else {
        $vbulletin->GPC['editorid'] = preg_replace('/\\W/s', '', $vbulletin->GPC['editorid']);
        /* Check they can view a blog, any blog */
        if (!($vbulletin->userinfo['permissions']['vbblog_general_permissions'] & $vbulletin->bf_ugp_vbblog_general_permissions['blog_canviewown']) and !($vbulletin->userinfo['permissions']['vbblog_general_permissions'] & $vbulletin->bf_ugp_vbblog_general_permissions['blog_canviewothers'])) {
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:blog_ajax.php


示例9: eval

                $vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadinfo['threadid']}&amp;page=" . $vbulletin->GPC['pagenumber'] . "&amp;pp=" . $vbulletin->GPC['perpage'];
                eval(print_standard_redirect('redirect_threadrate_add'));
            }
        }
    }
}
require_once DIR . '/includes/class_xml.php';
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$xml->add_group('threadrating');
if ($update) {
    $thread = $db->query_first_slave("\n\t\tSELECT votetotal, votenum\n\t\tFROM " . TABLE_PREFIX . "thread\n\t\tWHERE threadid = {$threadinfo['threadid']}\n\t");
    if ($thread['votenum'] >= $vbulletin->options['showvotes']) {
        // Show Voteavg
        $thread['voteavg'] = vb_number_format($thread['votetotal'] / $thread['votenum'], 2);
        $thread['rating'] = round($thread['votetotal'] / $thread['votenum']);
        $xml->add_tag('voteavg', process_replacement_vars("{$vbphrase['rating']}: <img class=\"inlineimg\" src=\"{$stylevar['imgdir_rating']}/rating_{$thread['rating']}.gif\" alt=\"" . construct_phrase($vbphrase['thread_rating_x_votes_y_average'], $thread['votenum'], $thread['voteavg']) . "\" border=\"0\" />"));
    } else {
        $xml->add_tag('voteavg', '');
    }
    if (!function_exists('fetch_phrase')) {
        require_once DIR . '/includes/functions_misc.php';
    }
    $xml->add_tag('message', fetch_phrase('redirect_threadrate_add', 'frontredirect', 'redirect_'));
} else {
    $xml->add_tag('error', fetch_error('threadratevoted'));
}
$xml->close_group();
$xml->print_xml();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 08:19, Wed Nov 5th 2008
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:threadrate.php


示例10: vB_AJAX_XML_Builder

     $popup = $vbulletin->input->clean_gpc('r', 'popup', TYPE_BOOL);
     if ($popup) {
         $templater = vB_Template::create('tag_edit_ajax_popup');
     } else {
         $templater = vB_Template::create('tag_edit_ajax');
     }
     $templater->register('contentid', $contentid);
     $templater->register('contenttype', $contenttypeid);
     $templater->register('tags_remain', $tags_remain);
     $templater->register('tag_manage_options', $tag_manage_options);
     $templater->register('url', $url);
     $html = $templater->render();
     require_once DIR . '/includes/class_xml.php';
     $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
     $xml->add_group('tag');
     $xml->add_tag($popup ? 'tagpopup' : 'html', process_replacement_vars($html));
     $xml->add_tag('delimiters', $vbulletin->options['tagdelimiter']);
     $xml->close_group();
     $xml->print_xml();
 } else {
     $returnurl = $content->fetch_return_url();
     $title = $content->get_title();
     if (!$title) {
         $title = $content->fetch_content_type_diplay();
     }
     $content_type_label = $content->fetch_content_type_diplay();
     // navbar and output
     $navbits = $content->fetch_page_nav();
     $navbar = render_navbar_template($navbits);
     $templater = vB_Template::create('tag_edit');
     $templater->register_page_templates();
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:threadtag.php


示例11: vB_UserCSS

if ($_REQUEST['do'] == 'customize')
{
	$cssdisplayinfo = $usercss->build_display_array();
	$errors = '';

	// if we don't have errors, the displayed values are the existing ones
	// otherwise, use the form submission
	if (!defined('HAVE_ERRORS'))
	{
		if ($vbulletin->GPC['copyprofilecss'] AND ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_profile_styling']))
		{
			$profileusercss = new vB_UserCSS($vbulletin, $vbulletin->userinfo['userid']);
			$selectors_saved = $profileusercss->existing;
			$usercss_profile_preview = $profileusercss->build_css($profileusercss->fetch_effective());
			$usercss_profile_preview = str_replace('/*sessionurl*/', $vbulletin->session->vars['sessionurl_js'], $usercss_profile_preview);
			$usercss_profile_preview = process_replacement_vars($usercss_profile_preview);
			unset($profileusercss);
			define('VBBLOG_NOUSERCSS', true);
		}
		else
		{
			$selectors_saved = $usercss->existing;
		}
	}

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

	$usercssbits = '';
	foreach ($cssdisplayinfo AS $selectorname => $selectorinfo)
	{
		$selector = $selector_base;
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:blog_usercp.php


示例12: vB_AJAX_XML_Builder

		$templater = vB_Template::create('reputationbit');
			$templater->register('postid', $postid);
			$templater->register('url', $url);
			$templater->register('userinfo', $userinfo);
		$reputationbit = $templater->render();
	}

	if ($vbulletin->GPC['ajax'])
	{
		$templater = vB_Template::create('reputation_ajax');
			$templater->register('reputationbit', $reputationbit);
		$reputation = $templater->render();

		require_once(DIR . '/includes/class_xml.php');
		$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
		$xml->add_tag('reputationbit', process_replacement_vars($reputation));
		$xml->print_xml();
	}

	// draw nav bar
	$navbits = array();
	$parentlist = array_reverse(explode(',', $foruminfo['parentlist']));
	foreach ($parentlist AS $forumID)
	{
		$forumTitle = $vbulletin->forumcache["$forumID"]['title'];
		$navbits[fetch_seo_url('forum', array('forumid' => $forumID, 'title' => $forumTitle))] = $forumTitle;
	}
	$navbits[fetch_seo_url('thread', $threadinfo, array('p' => $postid)) . "#post$postid"] = $threadinfo['prefix_plain_html'] . ' ' . $threadinfo['title'];
	$navbits[''] = $vbphrase['reputation'];
	$navbits = construct_navbits($navbits);
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:reputation.php


示例13: vB_Attach_Display_Content

			{
				$post['postcount'] = ++$postcount;
			}

			if ($post['attach'])
			{
				require_once(DIR . '/packages/vbattach/attach.php');
				$attach = new vB_Attach_Display_Content($vbulletin, 'vBForum_Post');
				$post['attachments'] = $attach->fetch_postattach(0, $post['postid']);
			}

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

			$postbit_obj =& $postbit_factory->fetch_postbit($fetchtype);

			$xml->add_tag('postbit', process_replacement_vars($postbit_obj->construct_postbit($post)), array('postid' => $post['postid']));
		}

		// ajax posts always mark the thread as read because any missed posts are retrieved as well
		mark_thread_read($threadinfo, $foruminfo, $vbulletin->userinfo['userid'], TIMENOW);
		

		// if post is not moderated, attempt to publish this new reply to user's Facebook feed
		if ($newpost['visible'] AND is_facebookenabled())
		{
			// check if this is a cms comment post, and make the appropriate FB post if so
			if (isset($vbulletin->options['vbcmsforumid']) AND $foruminfo['forumid'] == $vbulletin->options['vbcmsforumid'])
			{
				// only post fo facebook if we have a return node
				if ($vbulletin->GPC_exists['return_node'] AND intval($vbulletin->GPC['return_node']))
				{
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:newreply.php


示例14: build_style


//.........这里部分代码省略.........
                foreach ($template_cache['replacement'] as $template) {
                    // set the key to be a case-insentitive preg find string
                    $replacementkey = '#' . preg_quote($template['title'], '#') . '#si';
                    $replacements["{$replacementkey}"] = $template['template'];
                }
                $QUERY[] = 'replacements = \'' . $vbulletin->db->escape_string(serialize($replacements)) . '\'';
            } else {
                $QUERY[] = 'replacements = \'\'';
            }
            if (VB_AREA != 'Upgrade' and VB_AREA != 'Install') {
                echo "({$vbphrase['replacement_variables']}) ";
                vbflush();
            }
        }
        // css -- old style css
        if ($actions['docss'] and $template_cache['css']) {
            // build a quick cache with the ~old~ contents of the css fields from the style table
            if (!is_array($csscache)) {
                $csscache = array();
                $fetchstyles = $vbulletin->db->query_read("SELECT styleid, css FROM " . TABLE_PREFIX . "style");
                while ($fetchstyle = $vbulletin->db->fetch_array($fetchstyles)) {
                    $fetchstyle['css'] .= "\n";
                    $csscache["{$fetchstyle['styleid']}"] = $fetchstyle['css'];
                }
            }
            // rebuild the css field for this style
            $css = array();
            foreach ($template_cache['css'] as $template) {
                $css["{$template['title']}"] = unserialize($template['template']);
            }
            // build the CSS contents
            $csscolors = array();
            $css = construct_css($css, $styleid, $title, $csscolors);
            // attempt to delete the old css file if it exists
            delete_css_file($styleid, $csscache["{$styleid}"]);
            $adblock_is_evil = str_replace('ad', 'be', substr(md5(microtime()), 8, 8));
            $cssfilename = 'clientscript/vbulletin_css/style-' . $adblock_is_evil . '-' . str_pad($styleid, 5, '0', STR_PAD_LEFT) . '.css';
            // if we are going to store CSS as files, run replacement variable substitution on the file to be saved
            if ($vbulletin->options['storecssasfile']) {
                $css = process_replacement_vars($css, array('styleid' => $styleid, 'replacements' => serialize($replacements)));
                $css = preg_replace('#(?<=[^a-z0-9-]|^)url\\((\'|"|)(.*)\\1\\)#iUe', "rewrite_css_file_url('\\2', '\\1')", $css);
                if (write_css_file($cssfilename, $css)) {
                    $css = "@import url(\"{$cssfilename}\");";
                }
            }
            $fullcsstext = "<style type=\"text/css\" id=\"vbulletin_css\">\r\n" . "/**\r\n* vBulletin " . $vbulletin->options['templateversion'] . " CSS\r\n* Style: '{$title}'; Style ID: {$styleid}\r\n*/\r\n" . "{$css}\r\n</style>\r\n" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"clientscript/vbulletin_important.css?v=" . $vbulletin->options['simpleversion'] . "\" />";
            $QUERY[] = "css = '" . $vbulletin->db->escape_string($fullcsstext) . "'";
            $QUERY[] = "csscolors = '" . $vbulletin->db->escape_string(serialize($csscolors)) . "'";
            if (VB_AREA != 'Upgrade' and VB_AREA != 'Install') {
                echo "({$vbphrase['css']}) ";
                vbflush();
            }
        }
        // do the style update query
        if (sizeof($QUERY)) {
            $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "style SET\n" . implode(",\n", $QUERY) . "\nWHERE styleid = {$styleid}");
        }
        //write out the new css -- do this *after* we update the style record
        if ($vbulletin->options['storecssasfile']) {
            if (!write_style_css_directory($styleid, $parentlist, 'ltr')) {
                if (VB_AREA != 'Upgrade' and VB_AREA != 'Install') {
                    echo fetch_error("rebuild_failed_to_write_css");
                } else {
                    return fetch_error("rebuild_failed_to_write_css");
                }
            } else {
                if (!write_style_css_directory($styleid, $parentlist, 'rtl')) {
                    if (VB_AREA != 'Upgrade' and VB_AREA != 'Install') {
                        echo fetch_error("rebuild_failed_to_write_css");
                    } else {
                        return fetch_error("rebuild_failed_to_write_css");
                    }
                }
            }
        } else {
            // race condition here
            //delete_style_css_directory($styleid, 'ltr');
            //delete_style_css_directory($styleid, 'rtl');
        }
        // finish off the listings
        if (VB_AREA != 'Upgrade' and VB_AREA != 'Install') {
            echo "</span><b>" . $vbphrase['done'] . "</b>.<br />&nbsp;</li>\n";
            vbflush();
        }
    }
    $childsets = $vbulletin->db->query_read("\n\t\tSELECT\n\t\t\tstyleid, title, parentlist\n\t\tFROM " . TABLE_PREFIX . "style\n\t\tWHERE\n\t\t\tparentid = {$styleid}\n\t");
    if ($vbulletin->db->num_rows($childsets)) {
        if (VB_AREA != 'Upgrade' and VB_AREA != 'Install') {
            echo "{$indent}<ul class=\"ldi\">\n";
        }
        while ($childset = $vbulletin->db->fetch_array($childsets)) {
            if ($error = build_style($childset['styleid'], $childset['title'], $actions, $childset['parentlist'], $indent . "\t", $resetcache)) {
                return $error;
            }
        }
        if (VB_AREA != 'Upgrade' and VB_AREA != 'Install') {
            echo "{$indent}</ul>\n";
        }
    }
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:adminfunctions_template.php


示例15: vB_BbCodeParser

                 // Get the viewing user's moderated posts
                 if ($vbulletin->userinfo['userid'] and !fetch_socialgroup_modperm('canmoderategroupmessages', $group)) {
                     $state_or[] = "(gm.postuserid = " . $vbulletin->userinfo['userid'] . " AND state = 'moderation')";
                 }
                 require_once DIR . '/includes/class_bbcode.php';
                 require_once DIR . '/includes/class_groupmessage.php';
                 $bbcode =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
                 $factory =& new vB_Group_MessageFactory($vbulletin, $bbcode, $group);
                 $hook_query_fields = $hook_query_joins = $hook_query_where = '';
                 ($hook = vBulletinHook::fetch_hook('group_message_post_ajax')) ? eval($hook) : false;
                 $messages = $db->query_read_slave("\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tgm.*, user.*, gm.ipaddress AS messageipaddress\n\t\t\t\t\t\t" . ($deljoinsql ? ",deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason" : "") . "\n\t\t\t\t\t\t" . ($vbulletin->options['avatarenabled'] ? ",avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,customavatar.width AS avwidth,customavatar.height AS avheight, customavatar.width_thumb AS avwidth_thumb, customavatar.height_thumb AS avheight_thumb, customavatar.filedata_thumb" : "") . "\n\t\t\t\t\t\t{$hook_query_fields}\n\t\t\t\t\tFROM " . TABLE_PREFIX . "groupmessage AS gm\n\t\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (gm.postuserid = user.userid)\n\t\t\t\t\t" . ($vbulletin->options['avatarenabled'] ? "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)" : "") . "\n\t\t\t\t\t{$deljoinsql}\n\t\t\t\t\t{$hook_query_joins}\n\t\t\t\t\tWHERE gm.groupid = {$group['groupid']}\n\t\t\t\t\t\tAND (" . implode(" OR ", $state_or) . ")\n\t\t\t\t\t\tAND " . (($lastviewed = $vbulletin->GPC['lastcomment']) ? "(gm.dateline > {$lastviewed} OR gm.gmid = {$gmid})" : "gm.gmid = {$gmid}") . "\n\t\t\t\t\t\t{$hook_query_where}\n\t\t\t\t\tORDER BY gm.dateline ASC\n\t\t\t\t");
                 while ($message = $db->fetch_array($messages)) {
                     $response_handler =& $factory->create($message);
                     // Shall we pre parse these?
                     $response_handler->cachable = false;
                     $xml->add_tag('message', process_replacement_vars($response_handler->construct()), array('gmid' => $message['gmid'], 'visible' => $message['state'] == 'visible' ? 1 : 0, 'bgclass' => $bgclass));
                 }
                 $xml->add_tag('time', TIMENOW);
                 $xml->close_group();
                 $xml->print_xml(true);
             } else {
                 ($hook = vBulletinHook::fetch_hook('group_message_post_complete')) ? eval($hook) : false;
                 $vbulletin->url = 'group.php?' . $vbulletin->session->vars['sessionurl'] . "groupid={$group['groupid']}&gmid={$gmid}#gmessage{$gmid}";
                 eval(print_standard_redirect('visitormessagethanks', true, true));
             }
         }
     }
 }
 if ($_GET['do'] == 'message') {
     require_once DIR . '/includes/functions_editor.php';
     ($hook = vBulletinHook::fetch_hook('group_message_form_start')) ? eval($hook) : false;
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:group.php


示例16: actionSwitchMode

	/**
	 * Gets editor in the selected mode.
	 *
	 * @return string
	 */
	public function actionSwitchMode()
	{
		// Set up the style info - we need charset to be set for convert_urlencoded_unicode
		$this->bootstrap->force_styleid(0);
		$this->bootstrap->load_style();


		require_once DIR . '/includes/class_xml.php';

		vB::$vbulletin->input->clean_array_gpc('r', array(
			'towysiwyg' => vB_Input::TYPE_BOOL,
			'allowsmilie' => vB_Input::TYPE_BOOL,
			'message' => vB_Input::TYPE_STR,
		));

		vB::$vbulletin->GPC['message'] = convert_urlencoded_unicode(vB::$vbulletin->GPC['message']);

		$xml = new vB_AJAX_XML_Builder(vB::$vbulletin, 'text/xml');

		if (vB::$vbulletin->GPC['towysiwyg'])
		{
			$wysiwyg_parser = new vBCms_BBCode_Wysiwyg(vB::$vbulletin, vBCms_BBCode_Wysiwyg::fetchCmsTags());

			// todo: options
			$wysiwyg_html = $wysiwyg_parser->do_parse(vB::$vbulletin->GPC['message'], false, vB::$vbulletin->GPC['allowsmilie'], true, true, true);

			$xml->add_tag('message', process_replacement_vars($wysiwyg_html));
		}
		else
		{
			$html_parser = new vBCms_WysiwygHtmlParser(vB::$vbulletin);
			$do_html = false; // todo: option
			$message = $html_parser->parse(vB::$vbulletin->GPC['message'], $do_html);

			$xml->add_tag('message', process_replacement_vars($message));
		}

		if (!vB::contentHeadersSent())
		{
			$xml->send_content_type_header();
			$xml->send_content_length_header();

			vB::contentHeadersSent(true);
		}

		return $xml->fetch_xml();
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:52,代码来源:editor.php


示例17: build_style

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP process_smilies函数代码示例发布时间:2022-05-15
下一篇:
PHP process_post_preview函数代码示例发布时间: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