当前位置: 首页>>代码示例>>PHP>>正文


PHP vB_BbCodeParser::set_parse_userinfo方法代码示例

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


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

示例1: 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

示例2: trim

	function process_signature()
	{
		if ($this->post['showsignature']
			AND trim($this->post['signature']) != ''
			AND (!$this->registry->userinfo['userid'] OR $this->registry->userinfo['showsignatures'])
			AND $this->cache['perms'][$this->post['userid']]['genericpermissions'] & $this->registry->bf_ugp_genericpermissions['canusesignature']
		)
		{
			if (isset($this->cache['sig'][$this->post['userid']]))
			{
				// already fully parsed
				$this->post['signature'] = $this->cache['sig'][$this->post['userid']];
			}
			else
			{
				// have a mostly parsed version or no parsed version
				$this->bbcode_parser->set_parse_userinfo($this->post, $this->cache['perms'][$this->post['userid']]);
				$this->post['signature'] = $this->bbcode_parser->parse(
					$this->post['signature'],
					'signature',
					true,
					false,
					$this->post['signatureparsed'],
					$this->post['sighasimages'],
					true
				);
				$this->bbcode_parser->set_parse_userinfo(array());
				if ($this->post['signatureparsed'] === null)
				{
					$this->sig_cache = $this->bbcode_parser->cached;
				}

				$this->cache['sig'][$this->post['userid']] = $this->post['signature'];
			}
		}
		else
		{
			$this->post['signature'] = '';
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:40,代码来源:class_postbit.php

示例3:

		$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,代码行数:30,代码来源:profile.php

示例4: fr_post_to_bbcode

function fr_post_to_bbcode($node)
{
    require_once DIR . '/includes/class_core.php';
    require_once DIR . '/includes/class_bbcode.php';
    $post = array();
    $bbcode_parser = new vB_BbCodeParser(vB::get_registry(), fetch_tag_list());
    $post['signature'] = '';
    if (!empty($node['content']['signature']['raw'])) {
        $bbcode_parser->set_parse_userinfo($node['content']['userinfo']);
        $post['signature'] = $bbcode_parser->parse($node['content']['signature']['raw'], 'signature', true, false, '', $node['content']['signaturepic'], true);
        $sig = trim(remove_bbcode(strip_tags($post['signature']), true, true), '<a>');
        $sig = str_replace(array("\t", "\r"), array('', ''), $sig);
        $sig = str_replace("\n\n", "\n", $sig);
        $post['signature'] = $sig;
    }
    list($text, , $images) = parse_post($node['content']['rawtext']);
    $post['html'] = $text;
    $post['images'] = $images;
    return $post;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:20,代码来源:general_vb.php

示例5:

 /**
  * Prepares the User's Signature
  *
  */
 function prepare_signature()
 {
     global $show;
     if ($this->userinfo['signature'] and $this->userinfo['permissions']['genericpermissions'] & $this->registry->bf_ugp_genericpermissions['canusesignature']) {
         require_once DIR . '/includes/class_bbcode.php';
         $bbcode_parser = new vB_BbCodeParser($this->registry, fetch_tag_list());
         $bbcode_parser->set_parse_userinfo($this->userinfo, $this->userinfo['permissions']);
         $this->prepared['signature'] = $bbcode_parser->parse($this->userinfo['signature'], 'signature');
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:14,代码来源:class_userprofile.php

示例6:

	/**
	* Prepare the text for display
	*/
	function process_text()
	{
		global $vbphrase;

		$this->bbcode->attachments =& $this->attachments;
		$this->bbcode->unsetattach = true;
		$this->bbcode->set_parse_userinfo($this->blog, $this->factory->perm_cache["{$this->blog['userid']}"]);
		$this->bbcode->containerid = $this->blog['blogid'];
		$this->blog['message'] = $this->bbcode->parse(
			$this->blog['pagetext'],
			'blog_entry',
			$this->blog['allowsmilie'],
			false,
			$this->blog['pagetexthtml'], // fix
			$this->blog['hasimages'], // fix
			$this->cachable,
			$this->blog['htmlstate']
		);
		if ($this->bbcode->createdsnippet !== true)
		{
			$this->parsed_cache =& $this->bbcode->cached;
		}
		$this->readmore = ($this->bbcode->createdsnippet);
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:27,代码来源:class_blog_entry.php

示例7:

	/**
	* Prepare the text for display
	*/
	function process_text()
	{
		$this->bbcode->set_parse_userinfo($this->response, $this->factory->perm_cache["{$this->response['userid']}"]);
		$this->response['message'] = $this->bbcode->parse(
			$this->response['pagetext'],
			($this->bloginfo['firstblogtextid'] == $this->response['blogtextid']) ? 'blog_entry' : 'blog_comment',
			$this->response['allowsmilie'], // fix
			false,
			$this->response['pagetexthtml'], // fix
			$this->response['hasimages'], // fix
			$this->cachable
		);
		$this->parsed_cache =& $this->bbcode->cached;
		$this->readmore = ($this->bbcode->createdsnippet);
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:18,代码来源:class_blog_response.php


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