本文整理汇总了PHP中vB_AJAX_XML_Builder::add_tag方法的典型用法代码示例。如果您正苦于以下问题:PHP vB_AJAX_XML_Builder::add_tag方法的具体用法?PHP vB_AJAX_XML_Builder::add_tag怎么用?PHP vB_AJAX_XML_Builder::add_tag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vB_AJAX_XML_Builder
的用法示例。
在下文中一共展示了vB_AJAX_XML_Builder::add_tag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* Private
* Verifies that fetch_table_info() has been called for a valid table and sets current error condition to none
* .. in other words verify that fetchTableInfo returns true before proceeding on
*
* @param void
*
* @return void
*/
function init_table_info()
{
global $vbulletin;
// need registry!
if (!$this->init) {
$this->fetch_table_info();
}
if (!$this->init) {
$message = '<strong>vB_Database_Alter</strong>: fetch_table_info() has not been called successfully.<br />' . $this->fetch_error_message();
if ($vbulletin->GPC['ajax']) {
require_once DIR . '/includes/class_xml.php';
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$xml->add_tag('error', $message);
$xml->print_xml();
} else {
echo $message;
exit;
}
}
$this->set_error();
}
示例2: eval
($hook = vBulletinHook::fetch_hook('attachment_lightbox')) ? eval($hook) : false;
$templater = vB_Template::create('lightbox');
$templater->register('attachmentinfo', $attachmentinfo);
$templater->register('current', $current);
$templater->register('first', $first);
$templater->register('height', $height);
$templater->register('imagelink', $imagelink);
$templater->register('last', $last);
$templater->register('total', $total);
$templater->register('uniqueid', $uniqueid);
$templater->register('width', $width);
$html = $templater->render(true);
$xml->add_group('img');
$xml->add_tag('html', process_replacement_vars($html));
$xml->add_tag('link', $imagelink);
$xml->add_tag('name', $attachmentinfo['filename']);
$xml->add_tag('date', $attachmentinfo['date_string']);
$xml->add_tag('time', $attachmentinfo['time_string']);
$xml->close_group();
}
else
{
$xml->add_group('errormessage');
$xml->add_tag('error', 'notimage');
$xml->add_tag('extension', $attachmentinfo['extension']);
$xml->close_group();
}
$xml->print_xml();
}
示例3: array
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;
/*======================================================================*\
|| ####################################################################
|| #
|| # CVS: $RCSfile$ - $Revision: 35520 $
|| ####################################################################
\*======================================================================*/
示例4: array
//and that page will do all the work.
}
//This is for the calendar widget paging;
if ($_REQUEST['do'] == 'calwidget' )
{
$vbulletin->input->clean_array_gpc('r', array(
'year' => TYPE_UINT,
'month' => TYPE_UINT));
if ( $vbulletin->GPC_exists['year'] AND $vbulletin->GPC_exists['month'])
{
$view = vBCms_Widget_Calendar::getCalendar($vbulletin->GPC['year'], $vbulletin->GPC['month']);
$view->registerTemplater(vB_View::OT_XHTML, new vB_Templater_vB());
$html = $view->render();
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$xml->add_tag('html', $html);
$xml->print_xml();
}
}
($hook = vBulletinHook::fetch_hook('ajax_complete')) ? eval($hook) : false;
/*======================================================================*\
|| ####################################################################
|| #
|| # CVS: $RCSfile$ - $Revision: 37230 $
|| ####################################################################
\*======================================================================*/
示例5: getUiXml
/**
* vB_Search_Type::getUiXml()
* This gets the xml which will be passed to the ajax function. It just wraps
* get_ui in html
*
* @param array $prefs : the stored prefs for this contenttype
* @return the appropriate user interface wrapped in XML
*/
public function getUiXml($prefs)
{
global $vbulletin;
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$xml->add_group('root');
$xml->add_tag('html', $this->listUi($prefs));
$xml->close_group();
$xml->print_xml();
}
示例6: 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 $
|| ####################################################################
\*======================================================================*/
示例7: render
/**
* Renders the view to a string and returns it.
*
* @return string
*/
public function render($send_content_headers = false)
{
require_once DIR . '/includes/class_xml.php';
$xml = new vB_AJAX_XML_Builder(vB::$vbulletin, 'text/xml');
$xml->add_group('container');
$xml->add_tag('success', 1);
if ($this->content) {
$xml->add_tag('html', $this->content->render());
}
$xml->add_tag('title', $this->title);
$xml->add_tag('status', $this->status);
$xml->add_tag('message', $this->feedback);
if (sizeof($this->errors)) {
$xml->add_group('errors');
foreach ($this->errors as $error) {
$xml->add_tag('error', $error['message'], array('errcode' => $error['code']));
}
$xml->close_group();
}
if (sizeof($this->urls)) {
$xml->add_group('urls');
foreach ($this->urls as $type => $url) {
$xml->add_tag('url', $url, array('type' => $type));
}
$xml->close_group();
}
$xml->close_group();
if ($send_content_headers and !vB::contentHeadersSent()) {
$xml->send_content_type_header();
$xml->send_content_length_header();
vB::contentHeadersSent(true);
}
return $xml->fetch_xml();
}
示例8: array
$doc = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n\r\n";
$doc .= $xml->output();
$xml = null;
require_once DIR . '/includes/functions_file.php';
file_download($doc, 'vbulletin-settings.xml', 'text/xml');
}
// #############################################################################
// ajax setting value validation
if ($_POST['do'] == 'validate') {
$vbulletin->input->clean_array_gpc('p', array('varname' => TYPE_STR, 'setting' => TYPE_ARRAY));
$varname = convert_urlencoded_unicode($vbulletin->GPC['varname']);
$value = convert_urlencoded_unicode($vbulletin->GPC['setting']["{$varname}"]);
require_once DIR . '/includes/class_xml.php';
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$xml->add_group('setting');
$xml->add_tag('varname', $varname);
if ($setting = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "setting WHERE varname = '" . $db->escape_string($varname) . "'")) {
$raw_value = $value;
$value = validate_setting_value($value, $setting['datatype']);
$valid = exec_setting_validation_code($setting['varname'], $value, $setting['validationcode'], $raw_value);
} else {
$valid = 1;
}
$xml->add_tag('valid', $valid);
$xml->close_group();
$xml->print_xml();
}
// ***********************************************************************
print_cp_header($vbphrase['vbulletin_options']);
// ###################### Start do import settings XML #######################
if ($_POST['do'] == 'doimport') {
示例9: min
$user_tags_remain = $tags_remain;
} else {
$user_tags_remain = min($tags_remain, $user_tags_remain);
}
}
}
($hook = vBulletinHook::fetch_hook('threadtag_manage_tagsremain')) ? eval($hook) : false;
$show['tag_limit_phrase'] = $user_tags_remain !== null;
$tags_remain = vb_number_format($user_tags_remain);
$tag_delimiters = addslashes_js($vbulletin->options['tagdelimiter']);
if ($vbulletin->GPC['ajax']) {
eval('$html = "' . fetch_template('tag_edit_ajax') . '";');
require_once DIR . '/includes/class_xml.php';
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$xml->add_group('tag');
$xml->add_tag('html', process_replacement_vars($html));
$xml->add_tag('delimiters', $vbulletin->options['tagdelimiter']);
$xml->close_group();
$xml->print_xml();
}
// navbar and output
$navbits = array();
$parentlist = array_reverse(explode(',', substr($foruminfo['parentlist'], 0, -3)));
foreach ($parentlist as $forumid) {
$forum_title = $vbulletin->forumcache["{$forumid}"]['title'];
$navbits['forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumid}"] = $forum_title;
}
$navbits['showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadinfo['threadid']}"] = $threadinfo['prefix_plain_html'] . ' ' . $threadinfo['title'];
$navbits[''] = $vbphrase['tag_management'];
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
示例10: halt
//.........这里部分代码省略.........
}
$vboptions =& $vbulletin->options;
$technicalemail =& $vbulletin->config['Database']['technicalemail'];
$bbuserinfo =& $vbulletin->userinfo;
$requestdate = date('l, F jS Y @ h:i:s A', TIMENOW);
$date = date('l, F jS Y @ h:i:s A');
$scriptpath = str_replace('&', '&', $vbulletin->scriptpath);
$referer = REFERRER;
$ipaddress = IPADDRESS;
$classname = get_class($this);
if ($this->connection_recent) {
$this->hide_errors();
list($mysqlversion) = $this->query_first("SELECT VERSION() AS version", DBARRAY_NUM);
$this->show_errors();
}
$display_db_error = (VB_AREA == 'Upgrade' or VB_AREA == 'Install' or $vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']);
// Hide the MySQL Version if its going in the source
if (!$display_db_error) {
$mysqlversion = '';
}
eval('$message = "' . str_replace('"', '\\"', file_get_contents(DIR . '/includes/database_error_message.html')) . '";');
// add a backtrace to the message
if ($vbulletin->debug) {
$trace = debug_backtrace();
$trace_output = "\n";
foreach ($trace as $index => $trace_item) {
$param = in_array($trace_item['function'], array('require', 'require_once', 'include', 'include_once')) ? $trace_item['args'][0] : '';
// remove path
$param = str_replace(DIR, '[path]', $param);
$trace_item['file'] = str_replace(DIR, '[path]', $trace_item['file']);
$trace_output .= "#{$index} {$trace_item['class']}{$trace_item['type']}{$trace_item['function']}({$param}) called in {$trace_item['file']} on line {$trace_item['line']}\n";
}
$message .= "\n\nStack Trace:\n{$trace_output}\n";
}
require_once DIR . '/includes/functions_log_error.php';
if (function_exists('log_vbulletin_error')) {
log_vbulletin_error($message, 'database');
}
if ($technicalemail != '' and !$vbulletin->options['disableerroremail'] and verify_email_vbulletin_error($this->errno, 'database')) {
// If vBulletinHook is defined then we know that options are loaded, so we can then use vbmail
if (class_exists('vBulletinHook', false)) {
@vbmail($technicalemail, $this->appshortname . ' Database Error!', $message, true, $technicalemail);
} else {
@mail($technicalemail, $this->appshortname . ' Database Error!', preg_replace("#(\r\n|\r|\n)#s", @ini_get('sendmail_path') === '' ? "\r\n" : "\n", $message), "From: {$technicalemail}");
}
}
if (defined('STDIN')) {
echo $message;
exit;
}
// send ajax reponse after sending error email
if ($vbulletin->GPC['ajax']) {
require_once DIR . '/includes/class_xml.php';
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$error = '<p>Database Error</p>';
if ($vbulletin->debug or VB_AREA == 'Upgrade') {
$error .= "\r\n\r\n{$errortext}";
$error .= "\r\n\r\n{$this->error}";
}
eval('$ajaxmessage = "' . str_replace('"', '\\"', file_get_contents(DIR . '/includes/database_error_message_ajax.html')) . '";');
$xml->add_group('errors');
$xml->add_tag('error', $error);
$xml->add_tag('error_html', $ajaxmessage);
$xml->close_group('errors');
$xml->print_xml();
}
if (!headers_sent()) {
if (SAPI_NAME == 'cgi' or SAPI_NAME == 'cgi-fcgi') {
header('Status: 503 Service Unavailable');
} else {
header($_SERVER['SERVER_PROTOCOL'] . ' 503 Service Unavailable');
}
}
if ($display_db_error) {
// display error message on screen
$message = '<form><textarea rows="15" cols="70" wrap="off" id="message">' . htmlspecialchars_uni($message) . '</textarea></form>';
} else {
if ($vbulletin->debug) {
// display hidden error message
$message = "\r\n<!--\r\n" . htmlspecialchars_uni($message) . "\r\n-->\r\n";
} else {
$message = '';
}
}
if ($vbulletin->options['bburl']) {
$imagepath = $vbulletin->options['bburl'];
} else {
// this might not work with too many slashes in the archive
$imagepath = VB_AREA == 'Forum' ? '.' : '..';
}
eval('$message = "' . str_replace('"', '\\"', file_get_contents(DIR . '/includes/database_error_page.html')) . '";');
// This is needed so IE doesn't show the pretty error messages
$message .= str_repeat(' ', 512);
die($message);
} else {
if (!empty($errortext)) {
$this->error = $errortext;
}
}
}
示例11: array
if (!($vbulletin->userinfo['permissions']['cms']['admin'] & 2)) {
print_cp_no_permission();
}
fetch_phrase_group('cpcms');
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
//If we get an ajax request, we return the XML and exit
if ($_REQUEST['do'] == 'perms_section') {
require_once DIR . '/includes/functions_misc.php';
require_once DIR . '/includes/adminfunctions_misc.php';
$vbulletin->input->clean_array_gpc('r', array('sectionid' => TYPE_UINT));
if ($vbulletin->GPC_exists['sectionid']) {
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$xml->add_group('root');
$xml->add_tag('html', $vbulletin->GPC['sectionid'] ? getSectionTable($vbulletin->GPC['sectionid']) : showDefault());
$xml->close_group();
$xml->print_xml();
return;
}
} else {
if ($_REQUEST['do'] == 'save') {
saveData();
} else {
if ($_REQUEST['do'] == 'remove_perms') {
removePerms();
}
}
}
print_cp_header($vbphrase['permissions_manager']);
?>
示例12: array
$update = true;
if (!$vbulletin->GPC['ajax']) {
$vbulletin->url = fetch_seo_url('thread', $threadinfo, array('page' => $vbulletin->GPC['pagenumber'], '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("\r\n\t\tSELECT votetotal, votenum\r\n\t\tFROM " . TABLE_PREFIX . "thread\r\n\t\tWHERE threadid = {$threadinfo['threadid']}\r\n\t");
$average = $thread['votetotal'] / $thread['votenum'];
$rating = round($average);
$xml->add_tag('rating_full', vb_number_format($average, 2));
$xml->add_tag('rating', $rating);
$xml->add_tag('vote_threshold_met', intval($thread['votenum'] >= $vbulletin->options['showvotes']));
/*
//I don't think we need this any longer.
if ($thread['votenum'] >= $vbulletin->options['showvotes'])
{ // Show Voteavg
$thread['voteavg'] = vb_number_format($average, 2);
// $thread['rating'] = round($thread['votetotal'] / $thread['votenum']);
$html = "$vbphrase[rating]: <img class=\"inlineimg\" src=\"$stylevar[imgdir_rating]/rating_$rating.gif\" alt=\"" .
construct_phrase($vbphrase['thread_rating_x_votes_y_average'], $thread['votenum'],
$thread['voteavg']) . "\" border=\"0\" />";
$xml->add_tag('voteavg', process_replacement_vars($html));
}
示例13: print_cp_message
/**
* Halts execution and shows the specified message
*
* @param string Message to display
* @param mixed If specified, a redirect will be performed to the URL in this parameter
* @param integer If redirect is specified, this is the time in seconds to delay before redirect
* @param string If specified, will provide a specific URL for "Go Back". If empty, no button will be displayed!
* @param bool If true along with redirect, 'CONTINUE' button will be used instead of automatic redirect
*/
function print_cp_message($text = '', $redirect = NULL, $delay = 1, $backurl = NULL, $continue = false)
{
global $vbulletin, $vbphrase;
if ($vbulletin->GPC['ajax']) {
require_once DIR . '/includes/class_xml.php';
$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
$xml->add_tag('error', $text);
$xml->print_xml();
exit;
}
if ($redirect and $vbulletin->session->vars['sessionurl']) {
if (strpos($redirect, '?') === false) {
$redirect .= '?';
}
$redirect .= '&' . $vbulletin->session->vars['sessionurl'];
}
if (!defined('DONE_CPHEADER')) {
print_cp_header($vbphrase['vbulletin_message']);
}
echo '<p> </p><p> </p>';
print_form_header('', '', 0, 1, 'messageform', '65%');
print_table_header($vbphrase['vbulletin_message']);
print_description_row("<blockquote><br />{$text}<br /><br /></blockquote>");
if ($redirect and $redirect !== NULL) {
// redirect to the new page
if ($continue) {
$continueurl = str_replace('&', '&', $redirect);
print_table_footer(2, construct_button_code($vbphrase['continue'], create_full_url($continueurl)));
} else {
print_table_footer();
$redirect_click = create_full_url($redirect);
$redirect_click = str_replace('"', '', $redirect_click);
echo '<p align="center" class="smallfont">' . construct_phrase($vbphrase['if_you_are_not_automatically_redirected_click_here_x'], $redirect_click) . "</p>\n";
print_cp_redirect($redirect, $delay);
}
} else {
// end the table and halt
if ($backurl === NULL) {
$backurl = 'javascript:history.back(1)';
}
if (strpos($backurl, 'history.back(') !== false) {
//if we are attempting to run a history.back(1), check we have a history to go back to, otherwise attempt to close the window.
$back_button = '
<input type="button" id="backbutton" class="button" value="' . $vbphrase['go_back'] . '" title="" tabindex="1" onclick="if (history.length) { history.back(1); } else { self.close(); }"/>
<script type="text/javascript">
<!--
if (history.length < 1 || ((is_saf || is_moz) && history.length <= 1)) // safari + gecko start at 1
{
document.getElementById("backbutton").parentNode.removeChild(document.getElementById("backbutton"));
}
//-->
</script>';
// remove the back button if it leads back to the login redirect page
if (strpos($vbulletin->url, 'login.php?do=login') !== false) {
$back_button = '';
}
} else {
if ($backurl !== '') {
// regular window.location=url call
$backurl = create_full_url($backurl);
$backurl = str_replace(array('"', "'"), '', $backurl);
$back_button = '<input type="button" class="button" value="' . $vbphrase['go_back'] . '" title="" tabindex="1" onclick="window.location=\'' . $backurl . '\';"/>';
} else {
$back_button = '';
}
}
print_table_footer(2, $back_button);
}
// and now terminate the script
print_cp_footer();
}
示例14: array
$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);
示例15: showCommentsXml
public static function showCommentsXml($nodeid, $userinfo, $pageno = 1,
$perpage = 20, $target_url = '')
{
require_once DIR . '/includes/functions_misc.php';
global $show;
$xml = new vB_AJAX_XML_Builder( vB::$vbulletin, 'text/xml');
$xml->add_group('root');
//todo handle prefs for xml types
$xml->add_tag('html', $check_val = self::showComments($nodeid, $userinfo, $pageno,
$perpage, $target_url));
$xml->close_group();
$xml->print_xml();
}