本文整理汇总了PHP中vB_BbCodeParser类的典型用法代码示例。如果您正苦于以下问题:PHP vB_BbCodeParser类的具体用法?PHP vB_BbCodeParser怎么用?PHP vB_BbCodeParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了vB_BbCodeParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse_pm_bbcode
function parse_pm_bbcode($bbcode, $smilies = true)
{
global $vbulletin;
require_once DIR . '/includes/class_bbcode.php';
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
return $bbcode_parser->parse($bbcode, 'privatemessage', $smilies);
}
示例2: parse_usernote_bbcode
function parse_usernote_bbcode($bbcode, $smilies = true)
{
global $vbulletin;
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
return $bbcode_parser->parse($bbcode, 'usernote', $smilies);
}
示例3: vB_SignatureParser
/**
* Constructor. Sets up the tag permissions list.
*
* @param vB_Registry Reference to registry object
* @param array The tag_list array for the parent class parser
* @param integer The permssions number for the user from their usergroup i.e. $vbulletin->userinfo['permissions']
* @param integer The user this signature belongs to. Required
* @param boolean Whether to append custom tags (they will not be parsed anyway)
*/
function vB_SignatureParser(&$registry, $tag_list, $usergroup_signature_permission, $userid, $append_custom_tags = true)
{
parent::vB_BbCodeParser($registry, $tag_list, false);
$this->userid = intval($userid);
if (!$this->userid) {
trigger_error("User ID is 0. A signature cannot be parsed unless it belongs to a user.", E_USER_ERROR);
}
$this->permissions =& $usergroup_signature_permission;
$this->tag_groups = array('b' => 'basic', 'i' => 'basic', 'u' => 'basic', 'color' => 'color', 'size' => 'size', 'font' => 'font', 'left' => 'align', 'center' => 'align', 'right' => 'align', 'indent' => 'align', 'list' => 'list', 'url' => 'link', 'email' => 'link', 'thread' => 'link', 'post' => 'link', 'code' => 'code', 'php' => 'php', 'html' => 'html', 'quote' => 'quote');
// General, allowed or not
foreach ($this->tag_groups as $tag => $tag_group) {
if (isset($this->tag_list['no_option']["{$tag}"])) {
$this->tag_list['no_option']["{$tag}"]['callback'] = 'check_bbcode_general';
unset($this->tag_list['no_option']["{$tag}"]['html']);
}
if (isset($this->tag_list['option']["{$tag}"])) {
$this->tag_list['option']["{$tag}"]['callback'] = 'check_bbcode_general';
unset($this->tag_list['option']["{$tag}"]['html']);
}
}
// Specific functions
$this->tag_list['option']['size']['callback'] = 'check_bbcode_size';
$this->tag_list['no_option']['img']['callback'] = 'check_bbcode_img';
// needs to parse sig pics like any other bb code
$this->tag_list['no_option']['sigpic'] = array('strip_empty' => false, 'callback' => 'check_bbcode_sigpic');
if ($append_custom_tags) {
$this->append_custom_tags();
}
}
示例4: handle_bbcode_goldbrick
/**
* Handles BBCode [media] (or whatever $tag is)
*
* @param object vB_BbCodeParser
* @param string Media URL or attachment ID
* @param string Custom media options
*
* @return string Rendered media HTML
*/
function handle_bbcode_goldbrick(vB_BbCodeParser $parser, $text, $options = '')
{
global $vbphrase, $vbulletin;
if ($parser->registry->userinfo['permissions']['gb_permissions'] & $parser->registry->bf_ugp['gb_permissions']['canuse']) {
$text = str_replace(array('[', ']'), array('[', ']'), $text);
$text = strip_bbcode($text, true, true, false);
if ($parser->is_wysiwyg()) {
return sprintf('[%1$s%2$s]%3$s[/%1$s]', $parser->registry->options['gb_tag'], $options ? ""{$options}"" : '', $text);
}
require_once DIR . '/goldbrick/includes/functions_public.php';
//$goldbrick = new goldbrick_media($vbulletin);
$media = goldbrick_start_delivery($text, $options);
if ($media) {
return $media;
} else {
$media = goldbrick_process_bbcode($text, $options);
$info = goldbrick_start_delivery($text, $options);
return $info;
}
}
return $vbphrase['gb_no_permissions'];
}
示例5: vB_SocialMessageParser
/**
* Constructor. Sets up the tag permissions list.
*
* @param vB_Registry Reference to registry object
* @param array The tag_list array for the parent class parser
* @param boolean Whether to append custom tags
*/
function vB_SocialMessageParser(&$registry, $tag_list, $append_custom_tags = true)
{
parent::vB_BbCodeParser($registry, $tag_list, false);
// Load the information regarding allowed tags from the options
$this->allow_bbcodes();
// General, whether allowed or not
foreach ($this->tag_groupings as $tag => $tag_group) {
if (isset($this->tag_list['no_option']["{$tag}"])) {
$this->tag_list['no_option']["{$tag}"]['callback'] = 'check_bbcode_general';
unset($this->tag_list['no_option']["{$tag}"]['html']);
}
if (isset($this->tag_list['option']["{$tag}"])) {
$this->tag_list['option']["{$tag}"]['callback'] = 'check_bbcode_general';
unset($this->tag_list['option']["{$tag}"]['html']);
}
}
// lets treat the image tag like a full tag here
$this->tag_list['no_option']['img']['callback'] = 'check_bbcode_general';
if ($append_custom_tags) {
$this->append_custom_tags();
}
}
示例6: process_post_preview
/**
* Generates a Preview of a post
*
* @param array Information regarding the new post
* @param integer The User ID posting
* @param array Information regarding attachments
*
* @return string The Generated Preview
*
*/
function process_post_preview(&$newpost, $postuserid = 0, $attachment_bycontent = NULL, $attachment_byattachment = NULL)
{
global $vbphrase, $checked, $rate, $previewpost, $foruminfo, $threadinfo, $vbulletin, $show;
require_once DIR . '/includes/class_bbcode.php';
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
if ($attachment_byattachment) {
$bbcode_parser->attachments =& $attachment_byattachment;
$bbcode_parser->containerid = $newpost['postid'] ? $newpost['postid'] : 0;
}
$previewpost = 1;
$bbcode_parser->unsetattach = true;
$previewmessage = $bbcode_parser->parse($newpost['message'], $foruminfo['forumid'], $newpost['disablesmilies'] ? 0 : 1, false, '', 3, false, $newpost['htmlstate']);
$post = array('userid' => $postuserid ? $postuserid : $vbulletin->userinfo['userid']);
if (!empty($attachment_byattachment)) {
require_once DIR . '/includes/class_postbit.php';
$post['attachments'] = $attachment_byattachment;
$post['allattachments'] = $attachment_bycontent;
$postbit_factory = new vB_Postbit_Factory();
$postbit_factory->registry =& $vbulletin;
$postbit_factory->thread =& $threadinfo;
$postbit_factory->forum =& $foruminfo;
$postbit_obj =& $postbit_factory->fetch_postbit('post');
$postbit_obj->post =& $post;
$postbit_obj->process_attachments();
}
if ($post['userid'] != $vbulletin->userinfo['userid']) {
$fetchsignature = $vbulletin->db->query_first("\n\t\t\tSELECT signature\n\t\t\tFROM " . TABLE_PREFIX . "usertextfield\n\t\t\tWHERE userid = {$postuserid}\n\t\t");
$signature =& $fetchsignature['signature'];
} else {
$signature = $vbulletin->userinfo['signature'];
}
$show['signature'] = false;
if ($newpost['signature'] and trim($signature)) {
$userinfo = fetch_userinfo($post['userid'], FETCH_USERINFO_SIGPIC);
if ($post['userid'] != $vbulletin->userinfo['userid']) {
cache_permissions($userinfo, false);
} else {
$userinfo['permissions'] =& $vbulletin->userinfo['permissions'];
}
if ($userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canusesignature']) {
$bbcode_parser->set_parse_userinfo($userinfo);
$post['signature'] = $bbcode_parser->parse($signature, 'signature');
$bbcode_parser->set_parse_userinfo(array());
$show['signature'] = true;
}
}
if ($foruminfo['allowicons'] and $newpost['iconid']) {
if ($icon = $vbulletin->db->query_first_slave("\n\t\t\tSELECT title as title, iconpath\n\t\t\tFROM " . TABLE_PREFIX . "icon\n\t\t\tWHERE iconid = " . intval($newpost['iconid']) . "\n\t\t")) {
$newpost['iconpath'] = $icon['iconpath'];
$newpost['icontitle'] = $icon['title'];
}
} else {
if ($vbulletin->options['showdeficon'] != '') {
$newpost['iconpath'] = $vbulletin->options['showdeficon'];
$newpost['icontitle'] = $vbphrase['default'];
}
}
$show['messageicon'] = iif($newpost['iconpath'], true, false);
$show['errors'] = false;
($hook = vBulletinHook::fetch_hook('newpost_preview')) ? eval($hook) : false;
if ($previewmessage != '') {
$templater = vB_Template::create('newpost_preview');
$templater->register('errorlist', $errorlist);
$templater->register('newpost', $newpost);
$templater->register('post', $post);
$templater->register('previewmessage', $previewmessage);
$templater->register('content_type', 'forumcontent');
$postpreview = $templater->render();
} else {
$postpreview = '';
}
construct_checkboxes($newpost);
if ($newpost['rating']) {
$rate["{$newpost['rating']}"] = ' selected="selected"';
}
return $postpreview;
}
示例7: intval
// ############################### start reputation ###############################
$show['reputation'] = false;
if ($vbulletin->options['reputationenable']) {
$vbulletin->options['showuserrates'] = intval($vbulletin->options['showuserrates']);
$vbulletin->options['showuserraters'] = $permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseeownrep'];
$reputations = $db->query_read_slave("\r\n\t\tSELECT\r\n\t\t\treputation.whoadded, reputation.postid, reputation.reputation, reputation.reason, reputation.dateline,\r\n\t\t\tuser.userid, user.username, post.threadid, thread.title, thread.threadid\r\n\t\tFROM " . TABLE_PREFIX . "reputation AS reputation\r\n\t\tLEFT JOIN " . TABLE_PREFIX . "post AS post ON (reputation.postid = post.postid AND post.visible = 1)\r\n\t\tLEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (post.threadid = thread.threadid AND thread.visible = 1)\r\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = reputation.whoadded)\r\n\t\tWHERE reputation.userid = " . $vbulletin->userinfo['userid'] . "\r\n\t\t\t" . iif($vbulletin->options['showuserraters'] and trim($vbulletin->userinfo['ignorelist']), " AND reputation.whoadded NOT IN (0," . str_replace(' ', ',', trim($vbulletin->userinfo['ignorelist'])) . ")") . "\r\n\t\tORDER BY reputation.dateline DESC\r\n\t\tLIMIT 0, " . $vbulletin->options['showuserrates']);
$reputationcommentbits = '';
if ($vbulletin->options['showuserraters']) {
$reputationcolspan = 5;
$reputationbgclass = 'alt2';
} else {
$reputationcolspan = 4;
$reputationbgclass = 'alt1';
}
require_once DIR . '/includes/class_bbcode.php';
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
while ($reputation = $db->fetch_array($reputations)) {
if ($reputation['reputation'] > 0) {
$posneg = 'pos';
} else {
if ($reputation['reputation'] < 0) {
$posneg = 'neg';
} else {
$posneg = 'balance';
}
}
$reputation['timeline'] = vbdate($vbulletin->options['timeformat'], $reputation['dateline']);
$reputation['dateline'] = vbdate($vbulletin->options['dateformat'], $reputation['dateline']);
$reputation['reason'] = $bbcode_parser->parse($reputation['reason']);
$threadinfo = array('threadid' => $reputation['threadid'], 'title' => $reputation['title']);
if (vbstrlen($reputation['title']) > 25) {
示例8: parse_post
function parse_post($text, $allowsmilie = false)
{
global $nuke_quotes, $fr_platform, $images;
$images = array();
if (is_ipb()) {
// Replace <br.*/> with \n
$text = preg_replace('#<br.*?/>#is', "\n", $text);
}
$smilies = false;
$v = process_input(array('smilies' => BOOLEAN));
if (isset($v['smilies'])) {
$smilies = $v['smilies'] === true;
}
// Trim each line
$lines = preg_split("/\n/", $text);
for ($i = 0; $i < count($lines); $i++) {
$lines[$i] = trim($lines[$i]);
}
$text = join("\n", $lines);
$text = prepare_utf8_string($text, false);
$bbcode = new StringParser_BBCode();
$bbcode->setGlobalCaseSensitive(false);
// Handle default BBCode
$bbcode->addCode('quote', 'callback_replace', 'handle_quotes', array(), 'inline', array('listitem', 'block', 'inline', 'link'), array(''));
$bbcode->addCode('url', 'usecontent?', 'handle_url', array('usecontent_param' => 'default'), 'link', array('listitem', 'block', 'inline'), array('link'));
$bbcode->addCode('source', 'usecontent?', 'handle_url', array('usecontent_param' => 'default'), 'link', array('listitem', 'block', 'inline'), array('link'));
if (!is_mybb()) {
// myBB wonky attachment codes are already handled
$bbcode->addCode('attach', 'callback_replace', 'handle_attach', array(), 'inline', array('listitem', 'block', 'inline', 'link'), array(''));
}
$bbcode->addCode('attach', 'callback_replace', 'handle_attach', array(), 'inline', array('listitem', 'block', 'inline', 'link'), array(''));
$bbcode->addCode('img', 'callback_replace', 'handle_image', array(), 'inline', array('listitem', 'block', 'inline', 'link'), array(''));
$bbcode->addCode('imgl', 'callback_replace', 'handle_image', array(), 'inline', array('listitem', 'block', 'inline', 'link'), array(''));
$bbcode->addCode('imgr', 'callback_replace', 'handle_image', array(), 'inline', array('listitem', 'block', 'inline', 'link'), array(''));
//$bbcode->addCode('spoiler', 'callback_replace', 'handle_spoiler', array(), 'inline',
//array('listitem', 'block', 'inline', 'link'), array(''));
$bbcode->addCode('b', 'callback_replace', 'handle_bbcode_bold', array('usecontent_param' => array('default')), 'inline', array('listitem', 'block', 'inline', 'link'), array());
$bbcode->addCode('i', 'callback_replace', 'handle_bbcode_italic', array('usecontent_param' => array('default')), 'inline', array('listitem', 'block', 'inline', 'link'), array());
$bbcode->addCode('color', 'callback_replace', 'handle_bbcode_color', array('usecontent_param' => array('default')), 'inline', array('listitem', 'block', 'inline', 'link'), array());
$bbcode->setCodeFlag('color', 'closetag', BBCODE_CLOSETAG_MUSTEXIST);
// Video Link BBCode
$bbcode->addCode('yt', 'callback_replace', 'fr_handle_youtube', array(), 'inline', array('listitem', 'block', 'inline', 'link'), array(''));
$bbcode->addCode('youtube', 'callback_replace', 'fr_handle_youtube', array(), 'inline', array('listitem', 'block', 'inline', 'link'), array(''));
$bbcode->addCode('video', 'callback_replace', 'handle_video', array(), 'inline', array('listitem', 'block', 'inline', 'link'), array(''));
$bbcode->addCode('ame', 'callback_replace', 'handle_video', array(), 'inline', array('listitem', 'block', 'inline', 'link'), array(''));
$bbcode->addCode('media', 'callback_replace', is_xen() ? 'handle_xen_media' : 'handle_video', array(), 'inline', array('listitem', 'block', 'inline', 'link'), array(''));
$bbcode->addCode('tex', 'callback_replace', 'fr_handle_tex', array(), 'inline', array('listitem', 'block', 'inline', 'link'), array(''));
if (function_exists('fr_branded_bbcode_handler')) {
@fr_branded_bbcode_handler($bbcode);
}
if (is_mybb()) {
$bbcode->setMixedAttributeTypes(true);
}
$nuked_quotes = $text;
$text = htmlspecialchars_uni($text);
$nuke_quotes = true;
$nuked_quotes = $bbcode->parse($nuked_quotes);
if (is_ipb()) {
$nuked_quotes = ipb_handle_attachments($nuked_quotes);
}
$nuke_quotes = false;
$text = $bbcode->parse($text);
if (is_ipb()) {
$text = ipb_handle_attachments($text);
}
// Snag out images
preg_match_all('#\\[IMG\\](.*?)\\[/IMG\\]#is', $text, $matches);
$text = preg_replace("#\\[IMG\\](.*?)\\[/IMG\\]#is", '', $text);
$nuked_quotes = preg_replace("#\\[IMG\\](.*?)\\[/IMG\\]#is", '', $nuked_quotes);
if ($smilies) {
if (is_vb()) {
global $vbulletin;
$parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$text = $parser->parse_smilies($text, false);
$text = preg_replace_callback('#img src="(.*?)"#is', parse_post_callback, $text);
}
}
$text = preg_replace("#\n\n\n+#", "\n\n", $text);
$text = preg_replace("#\n#", "<br/>", $text);
$text = remove_bbcode($text);
$nuked_quotes = preg_replace("#\n\n\n+#", "\n\n", $nuked_quotes);
$nuked_quotes = remove_bbcode($nuked_quotes);
return array($text, $nuked_quotes, $images);
}
示例9: vb_number_format
$show['allowratefile'] = true;
}
}
if ($file['size'] == 0) {
$file['size'] = $vbphrase['dl2_unknown_size'];
} else {
$file['size'] = vb_number_format($file['size'], 0, true);
}
$file['totaldownloads'] = vb_number_format($file['totaldownloads']);
if ($file['link']) {
$show['newwindow'] = true;
} else {
$show['newwindow'] = $file['newwindow'] ? true : false;
}
require_once DIR . '/includes/class_bbcode.php';
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$file['description'] = $bbcode_parser->do_parse($file['description'], false, true, true, true, true, $cachable);
if ($vbulletin->options['dl2allowimages']) {
$result = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "dl2_images WHERE `file` = {$file['id']}");
while ($image = $db->fetch_array($result)) {
$show['controls'] = false;
if ($permissions['downloads2permissions'] & $vbulletin->bf_ugp['downloads2permissions']['caneditallfiles'] or $permissions['downloads2permissions'] & $vbulletin->bf_ugp['downloads2permissions']['caneditownfiles'] and ($image['uploaderid'] == $vbulletin->userinfo['userid'] and $file['uploaderid'] == $vbulletin->userinfo['userid'])) {
$show['controls'] = true;
}
$image['name'] = $dl->url . $image['name'];
if (file_exists($dl->url . $image['thumb'])) {
$image['thumb'] = $dl->url . $image['thumb'];
} else {
$image['thumb'] = false;
}
$templater = vB_Template::create('downloads2_file_imagebit');
示例10: define
$donetest = 1;
$_REQUEST['do'] = 'modify';
}
// ########################################################################
if ($_REQUEST['do'] == 'previewbbcode') {
define('NO_CP_COPYRIGHT', true);
$vbulletin->input->clean_array_gpc('r', array('bbcodeid' => TYPE_UINT));
if ($bbcode = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "bbcode WHERE bbcodeid = " . $vbulletin->GPC['bbcodeid'])) {
$parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$parsed_code = $parser->do_parse($bbcode['bbcodeexample'], false, false, true, false, true);
echo $parsed_code;
}
}
// ####################################### MODIFY #####################################
if ($_REQUEST['do'] == 'modify') {
$parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$bbcodes = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "bbcode");
print_form_header('bbcode', 'add');
print_table_header($vbphrase['bb_code_manager'], 6);
print_cells_row(array($vbphrase['title'], $vbphrase['bb_code'], $vbphrase['html'], $vbphrase['replacement'], $vbphrase['button_image'], $vbphrase['controls']), 1, '', -5);
while ($bbcode = $db->fetch_array($bbcodes)) {
$class = fetch_row_bgclass();
$altclass = iif($class == 'alt1', 'alt2', 'alt1');
$parsed_code = $parser->do_parse($bbcode['bbcodeexample'], false, false, true, false, true);
$cell = array("<b>{$bbcode['title']}</b>", "<div class=\"{$altclass}\" style=\"padding:2px; border:solid 1px; width:200px; height:75px; overflow:auto\"><span class=\"smallfont\">" . htmlspecialchars_uni($bbcode['bbcodeexample']) . '</span></div>', "<div class=\"{$altclass}\" style=\"padding:2px; border:solid 1px; width:200px; height:75px; overflow:auto\"><span class=\"smallfont\">" . htmlspecialchars_uni($parsed_code) . '</span></div>', '<iframe src="bbcode.php?do=previewbbcode&bbcodeid=' . $bbcode['bbcodeid'] . '" style="width:200px; height:75px;"></iframe>');
if ($bbcode['buttonimage']) {
$src = $bbcode['buttonimage'];
if (!preg_match('#^[a-z]+://#i', $src) and $src[0] != '/') {
$src = "../{$src}";
}
$cell[] = "<img style=\"background:buttonface; border:solid 1px highlight\" src=\"{$src}\" alt=\"\" />";
示例11: vB_RSS_Poster
}
// #############################################################################
if ($_POST['do'] == 'preview') {
require_once DIR . '/includes/class_rss_poster.php';
require_once DIR . '/includes/functions_wysiwyg.php';
$xml = new vB_RSS_Poster($vbulletin);
$xml->fetch_xml($vbulletin->GPC['url']);
if (empty($xml->xml_string)) {
print_stop_message('unable_to_open_url');
} else {
if ($xml->parse_xml() === false) {
print_stop_message('xml_error_x_at_line_y', $xml->feedtype == 'unknown' ? 'Unknown Feed Type' : $xml->xml_object->error_string(), $xml->xml_object->error_line());
}
}
require_once DIR . '/includes/class_bbcode.php';
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$output = '';
$count = 0;
foreach ($xml->fetch_items() as $item) {
if ($vbulletin->GPC['maxresults'] and $count++ >= $vbulletin->GPC['maxresults']) {
break;
}
if (!empty($item['content:encoded'])) {
$content_encoded = true;
}
$title = $bbcode_parser->parse(strip_bbcode(convert_wysiwyg_html_to_bbcode($xml->parse_template($vbulletin->GPC['titletemplate'], $item))), 0, false);
if ($vbulletin->GPC['options']['html2bbcode']) {
$body_template = nl2br($vbulletin->GPC['bodytemplate']);
} else {
$body_template = $vbulletin->GPC['bodytemplate'];
}
示例12: vB_BbCodeParser_PlainText
/**
* Constructor. Sets up the tag list.
*
* @param vB_Registry Reference to registry object
* @param array List of tags to parse
* @param boolean Whether to append custom tags (they will not be parsed anyway)
*/
function vB_BbCodeParser_PlainText(&$registry, $tag_list = array(), $append_custom_tags = true)
{
parent::vB_BbCodeParser($registry, $tag_list, $append_custom_tags);
// add thread and post tags as parsed -- this can't be done above
// because I need to use a variable in $registry
$this->plaintext_tags['option']['thread'] = array('html' => '%1$s (' . $registry->options['bburl'] . '/showthread.php?t=%2$s)', 'option_regex' => '#^\\d+$#', 'strip_empty' => true);
$this->plaintext_tags['no_option']['thread'] = array('html' => $registry->options['bburl'] . '/showthread.php?t=%1$s', 'data_regex' => '#^\\d+$#', 'strip_empty' => true);
$this->plaintext_tags['option']['post'] = array('html' => '%1$s (' . $registry->options['bburl'] . '/showthread.php?p=%2$s#post%2$s)', 'option_regex' => '#^\\d+$#', 'strip_empty' => true);
$this->plaintext_tags['no_option']['post'] = array('html' => $registry->options['bburl'] . '/showthread.php?p=%1$s#post%1$s', 'data_regex' => '#^\\d+$#', 'strip_empty' => true);
// update all parsable tags to their new value and make unparsable tags disappear
foreach ($this->tag_list['option'] as $tagname => $info) {
if (!isset($this->plaintext_tags['option']["{$tagname}"])) {
$this->tag_list['option']["{$tagname}"]['html'] = '%1$s';
unset($this->tag_list['option']["{$tagname}"]['callback']);
} else {
if ($this->plaintext_tags['option']["{$tagname}"] !== false) {
$this->tag_list['option']["{$tagname}"] = $this->plaintext_tags['option']["{$tagname}"];
}
}
}
foreach ($this->tag_list['no_option'] as $tagname => $info) {
if (!isset($this->plaintext_tags['no_option']["{$tagname}"])) {
$this->tag_list['no_option']["{$tagname}"]['html'] = '%1$s';
unset($this->tag_list['no_option']["{$tagname}"]['callback']);
} else {
if ($this->plaintext_tags['no_option']["{$tagname}"] !== false) {
$this->tag_list['no_option']["{$tagname}"] = $this->plaintext_tags['no_option']["{$tagname}"];
}
}
}
}
示例13: eval
{ // is this your own post?
($hook = vBulletinHook::fetch_hook('reputation_viewown_start')) ? eval($hook) : false;
$postreputations = $db->query_read_slave("
SELECT reputation, reason
FROM " . TABLE_PREFIX . "reputation
WHERE postid = $postid
ORDER BY dateline DESC
");
if ($db->num_rows($postreputations) > 0)
{
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
while ($postreputation = $db->fetch_array($postreputations))
{
$total += $postreputation['reputation'];
if ($postreputation['reputation'] > 0)
{
$posneg = 'pos';
}
else if ($postreputation['reputation'] < 0)
{
$posneg = 'neg';
}
else
{
$posneg = 'balance';
示例14: print_no_permission
if ($_REQUEST['do'] == 'managepost') {
if ($postinfo['postid'] == $threadinfo['firstpostid']) {
// first post
// redirect to edit thread
$_REQUEST['do'] = 'editthread';
} else {
if (!can_moderate($threadinfo['forumid'], 'candeleteposts')) {
print_no_permission();
}
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
$show['undeleteoption'] = iif($postinfo['isdeleted'] and (can_moderate($threadinfo['forumid'], 'canremoveposts') or can_moderate($threadinfo['forumid'], 'candeleteposts')), true, false);
if (!$show['undeleteoption']) {
standard_error(fetch_error('invalidid', $vbphrase['post'], $vbulletin->options['contactuslink']));
}
require_once DIR . '/includes/class_bbcode.php';
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$postinfo['pagetext'] = $bbcode_parser->parse($postinfo['pagetext'], $forumid);
$postinfo['postdate'] = vbdate($vbulletin->options['dateformat'], $postinfo['dateline'], 1);
$postinfo['posttime'] = vbdate($vbulletin->options['timeformat'], $postinfo['dateline']);
$visiblechecked = iif($postinfo['visible'], 'checked="checked"');
// draw nav bar
$navbits = construct_postings_nav($foruminfo, $threadinfo);
}
($hook = vBulletinHook::fetch_hook('threadmanage_managepost')) ? eval($hook) : false;
$page_templater = vB_Template::create('threadadmin_managepost');
$page_templater->register('postid', $postid);
$page_templater->register('postinfo', $postinfo);
$page_templater->register('threadid', $threadid);
$remove_temp_render = $page_templater->render();
}
// ############################### start edit thread ###############################
示例15: IN
if (($vbulletin->userinfo['maxposts'] != -1) AND ($vbulletin->userinfo['maxposts']))
{
$vbulletin->options['maxposts'] = $vbulletin->userinfo['maxposts'];
}
if ($Coventry = fetch_coventry('string'))
{
$globalignore = "AND post.userid NOT IN ($Coventry) ";
}
else
{
$globalignore = '';
}
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$posts = $db->query_read_slave("
SELECT post.*, IF(post.userid = 0, post.username, user.username) AS username
FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = post.userid)
WHERE post.visible = 1
$globalignore
AND post.threadid = $threadinfo[threadid]
ORDER BY dateline DESC, postid DESC
LIMIT " . ($vbulletin->options['maxposts'] + 1)
);
while ($post = $db->fetch_array($posts))
{
if ($postcounter++ < $vbulletin->options['maxposts'])