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

PHP vB_BbCodeParser类代码示例

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

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



在下文中一共展示了vB_BbCodeParser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:7,代码来源:private.php


示例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);
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:8,代码来源:usernote.php


示例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();
     }
 }
开发者ID:holandacz,项目名称:nb4,代码行数:38,代码来源:class_sigparser.php


示例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'];
 }
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:bbcode_create.php


示例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();
     }
 }
开发者ID:holandacz,项目名称:nb4,代码行数:29,代码来源:class_socialmessageparser.php


示例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;
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:87,代码来源:functions_newpost.php


示例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) {
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:usercp.php


示例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);
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:84,代码来源:utils.php


示例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');
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:downloads.php


示例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&amp;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=\"\" />";
开发者ID:benyamin20,项目名称:vbregistration,代码行数:31,代码来源:bbcode.php


示例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'];
        }
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:rssposter.php


示例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}"];
             }
         }
     }
 }
开发者ID:benyamin20,项目名称:vbregistration,代码行数:38,代码来源:class_bbcode_alt.php


示例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';
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:reputation.php


示例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 ###############################
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:postings.php


示例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'])
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:newreply.php


示例16: array

		);

		$stylelist["$style[styleid]"]['idlist'] = array(
			'bbcode_code'  => intval($tlist['bbcode_code_styleid']),
			'bbcode_quote' => intval($tlist['bbcode_quote_styleid']),
			'bbcode_php'   => intval($tlist['bbcode_php_styleid']),
			'bbcode_html'  => intval($tlist['bbcode_html_styleid']),
			'bbcode_video' => intval($tlist['bbcode_video_styleid']),
		);

		$stylelist["$style[styleid]"]['newstylevars'] = unserialize($style['newstylevars']);
	}
	$stylelist["0"] =& $stylelist["{$vbulletin->options['styleid']}"];

	require_once(DIR . '/includes/class_bbcode.php');
	$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());

	if (empty($vbulletin->GPC['perpage']))
	{
		$vbulletin->GPC['perpage'] = 1000;
	}

	if ($vbulletin->GPC['startat'] == 0)
	{
		$db->query_write("TRUNCATE TABLE " . TABLE_PREFIX . "postparsed");
		$firstpost = $db->query_first("SELECT MIN(postid) AS min FROM " . TABLE_PREFIX . "post");
		$vbulletin->GPC['startat'] = intval($firstpost['min']);
	}

	echo '<p>' . $vbphrase['building_post_cache'] . '</p>';
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:misc.php


示例17: vB_BbCodeParser

	{
		$signature = $vbulletin->userinfo['signature'];
	}

	// Free the memory, unless we need it below.
	if (!$signature)
	{
		unset($sig_parser);
	}

	if ($signature)
	{
		if (!$previewmessage)
		{
			require_once(DIR . '/includes/class_bbcode.php');
			$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
			$bbcode_parser->set_parse_userinfo(fetch_userinfo($vbulletin->userinfo['userid'], FETCH_USERINFO_SIGPIC), $vbulletin->userinfo['permissions']);
			$previewmessage = $bbcode_parser->parse($signature, 'signature');
		}

		// save a conditional by just overwriting the phrase
		$vbphrase['submit_message'] =& $vbphrase['save_signature'];
		$templater = vB_Template::create('newpost_preview');
			$templater->register('errorlist', $errorlist);
			$templater->register('newpost', $newpost);
			$templater->register('post', $post);
			$templater->register('previewmessage', $previewmessage);
		$preview = $templater->render();
	}

	require_once(DIR . '/includes/functions_editor.php');
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:profile.php


示例18: _parseBB

 private function _parseBB($text, $type = 'pm')
 {
     include_once DIR . '/includes/class_dle_parse.php';
     $parse = new DLE_ParseFilter();
     $parse->safe_mode = true;
     //        $parse->allow_url = false;
     //        $parse->allow_image = false;
     $bbparser = new vB_BbCodeParser($this->vbulletin, fetch_tag_list());
     $this->_fetch_home_url();
     $text = $bbparser->parse_smilies($text);
     $text = preg_replace('#<img .*?src=[\'"]([^h].+?)[\'"] .*?/>#si', "[img]{$this->vbulletin->basepath}\\1[/img]", $text);
     $text = $parse->process($text);
     if ($type == 'pm') {
         $quote = 'Цитата';
         if (strtolower($this->vbulletin->userinfo['lang_charset']) != 'utf-8') {
             $quote = iconv('utf-8', $this->vbulletin->userinfo['lang_charset'], $quote);
         }
         $text = preg_replace('#\\[QUOTE\\]#si', "<!--QuoteBegin--><div class=\"quote\"><!--QuoteEBegin-->", $text);
         $text = preg_replace('#\\[quote=(.+?)\\]#si', "<!--QuoteBegin \\1 --><div class=\"title_quote\">{$quote}: \\1</div><div class=\"quote\"><!--QuoteEBegin-->", $text);
         $text = preg_replace('#\\[/quote\\]#si', "<!--QuoteEnd--></div><!--QuoteEEnd-->", $text);
         $text = preg_replace('#\\[post\\]([0-9]+)\\[/post\\]#si', "<a href='" . $this->vbulletin->basepath . "showthread.php?p=\\1#post\\1'>" . $this->vbulletin->basepath . "showthread.php?p=\\1</a>", $text);
     } else {
         if ($type == 'signature') {
             $text = strip_tags($text);
             if ($this->vbulletin->options['usefileavatar']) {
                 $sigpic_url = $this->vbulletin->options['sigpicurl'] . '/sigpic' . $this->vbulletin->userinfo['userid'] . '_' . $this->vbulletin->userinfo['sigpicrevision'] . '.gif';
             } else {
                 $sigpic_url = 'image.php?u=' . $this->vbulletin->userinfo['userid'] . "&amp;type=sigpic&amp;dateline=" . $userinfo_sigpic['sigpicdateline'];
             }
             $text = preg_replace('#\\[SIGPIC\\]\\[/SIGPIC\\]#si', "[img]{$this->vbulletin->basepath}{$sigpic_url}[/img]", $text);
             $text = preg_replace('#\\[SIGPIC\\](.+?)\\[/SIGPIC\\]#si', "[img=|\\1]{$this->vbulletin->basepath}{$sigpic_url}[/img]", $text);
         }
     }
     $text = preg_replace("#\\[size=&quot;([^&]+)&quot;\\]#is", "[size=\\1]", $text);
     $text = preg_replace("#\\[font=&quot;([^&]+)&quot;\\]#is", "[font=\\1]", $text);
     $text = $parse->BB_Parse($text, false);
     //        $text = preg_replace('#\[.+?\]#si', "", $text);
     return $text;
 }
开发者ID:dautushenka,项目名称:dle-vb,代码行数:39,代码来源:class_dle_integration.php


示例19: do_get_post

function do_get_post()
{
    global $vbulletin, $db, $foruminfo, $threadinfo, $postid, $postinfo;
    $vbulletin->input->clean_array_gpc('r', array('type' => TYPE_STR));
    $type = 'html';
    if ($vbulletin->GPC['type']) {
        $type = $vbulletin->GPC['type'];
    }
    if (!$postinfo['postid']) {
        standard_error(fetch_error('invalidid', $vbphrase['post'], $vbulletin->options['contactuslink']));
    }
    if ((!$postinfo['visible'] or $postinfo['isdeleted']) and !can_moderate($threadinfo['forumid'])) {
        standard_error(fetch_error('invalidid', $vbphrase['post'], $vbulletin->options['contactuslink']));
    }
    if ((!$threadinfo['visible'] or $threadinfo['isdeleted']) and !can_moderate($threadinfo['forumid'])) {
        standard_error(fetch_error('invalidid', $vbphrase['thread'], $vbulletin->options['contactuslink']));
    }
    $forumperms = fetch_permissions($threadinfo['forumid']);
    if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) or !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads'])) {
        json_error(ERR_NO_PERMISSION);
    }
    if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) and ($threadinfo['postuserid'] != $vbulletin->userinfo['userid'] or $vbulletin->userinfo['userid'] == 0)) {
        json_error(ERR_NO_PERMISSION);
    }
    // check if there is a forum password and if so, ensure the user has it set
    verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
    $postbit_factory = new vB_Postbit_Factory();
    $postbit_factory->registry =& $vbulletin;
    $postbit_factory->forum =& $foruminfo;
    $postbit_factory->cache = array();
    $postbit_factory->bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
    $post = $db->query_first_slave("\n\tSELECT\n\tpost.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,\n\t    user.*, userfield.*, usertextfield.*,\n\t    " . iif($foruminfo['allowicons'], 'icon.title as icontitle, icon.iconpath,') . "\n\t    IF(user.displaygroupid=0, user.usergroupid, user.displaygroupid) AS displaygroupid, infractiongroupid,\n\t\t" . iif($vbulletin->options['avatarenabled'], 'avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,customavatar.width AS avwidth,customavatar.height AS avheight,') . "\n\t\t" . ((can_moderate($threadinfo['forumid'], 'canmoderateposts') or can_moderate($threadinfo['forumid'], 'candeleteposts')) ? 'spamlog.postid AS spamlog_postid,' : '') . "\n\t\teditlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline, editlog.reason AS edit_reason, editlog.hashistory,\n\t\tpostparsed.pagetext_html, postparsed.hasimages,\n\t\tsigparsed.signatureparsed, sigparsed.hasimages AS sighasimages,\n\t\tsigpic.userid AS sigpic, sigpic.dateline AS si 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP vB_Bitfield_Builder类代码示例发布时间:2022-05-23
下一篇:
PHP vB_Api类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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