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

PHP vB_Template类代码示例

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

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



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

示例1: fetchTemplate

 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $commentinfo =& $this->content['album_picturecomment'][$activity['contentid']];
     $albuminfo =& $this->content['album'][$commentinfo['albumid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $preview = strip_quotes($commentinfo['pagetext']);
     $commentinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     $userinfo = $this->fetchUser($activity['userid'], $commentinfo['postusername']);
     $userinfo2 = $this->fetchUser($albuminfo['userid']);
     if ($fetchphrase) {
         if ($userinfo['userid']) {
             $phrase = construct_phrase($this->vbphrase['x_commented_on_a_photo_in_album_y'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('member', $userinfo2), $userinfo2['username'], vB::$vbulletin->session->vars['sessionurl'], $albuminfo['albumid'], $albuminfo['title']);
         } else {
             $phrase = construct_phrase($this->vbphrase['guest_x_commented_on_a_photo_in_album_y'], $userinfo['username'], fetch_seo_url('member', $userinfo2), $userinfo2['username'], vB::$vbulletin->session->vars['sessionurl'], $albuminfo['albumid'], $albuminfo['title']);
         }
         return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('userinfo2', $userinfo2);
         $templater->register('activity', $activity);
         $templater->register('commentinfo', $commentinfo);
         $templater->register('albuminfo', $albuminfo);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:27,代码来源:comment.php


示例2: handle_bbcode_quote

	/**
	* Handles a [quote] tag. Displays a string in an area indicating it was quoted from someone/somewhere else.
	*
	* @param	string	The body of the quote.
	* @param	string	If tag has option, the original user to post.
	*
	* @return	string	HTML representation of the tag.
	*/
	function handle_bbcode_quote($message, $username = '')
	{
		global $vbulletin, $vbphrase, $show;

		// remove smilies from username
		$username = $this->strip_smilies($username);
		$postid = $blogtextid = 0;
		if (preg_match('/^(.+)(?<!&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5});\s*(bt)?(\d+)\s*$/U', $username, $match))
		{
			$username = $match[1];
			if ($match[2] == 'bt')
			{
				$blogtextid = $match[3];
			}
			else
			{
				$postid = $match[3];
			}
		}

		$username = $this->do_word_wrap($username);

		$show['username'] = iif($username != '', true, false);
		$message = $this->strip_front_back_whitespace($message, 1);

		$templater = vB_Template::create($this->printable ? 'bbcode_quote_printable' : 'bbcode_quote');
			$templater->register('message', $message);
			$templater->register('postid', $postid);
			$templater->register('username', $username);
		return $templater->render();
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:39,代码来源:class_bbcode_blog.php


示例3: construct_faq_item

function construct_faq_item($faq, $find = '')
{
    global $vbulletin, $ifaqcache, $faqbits, $faqlinks, $show, $vbphrase;
    $faq['text'] = trim($faq['text']);
    if (is_array($find) and !empty($find)) {
        $faq['title'] = preg_replace('#(^|>)([^<]+)(?=<|$)#sUe', "process_highlight_faq('\\2', \$find, '\\1', '<u>\\\\1</u>')", $faq['title']);
        $faq['text'] = preg_replace('#(^|>)([^<]+)(?=<|$)#sUe', "process_highlight_faq('\\2', \$find, '\\1', '<span class=\"highlight\">\\\\1</span>')", $faq['text']);
    }
    $faqsublinks = '';
    if (is_array($ifaqcache["{$faq['faqname']}"])) {
        foreach ($ifaqcache["{$faq['faqname']}"] as $subfaq) {
            if ($subfaq['displayorder'] > 0) {
                $templater = vB_Template::create('faqbit_link');
                $templater->register('faq', $faq);
                $templater->register('subfaq', $subfaq);
                $faqsublinks .= $templater->render();
            }
        }
    }
    $show['faqsublinks'] = iif($faqsublinks, true, false);
    $show['faqtext'] = iif($faq['text'], true, false);
    ($hook = vBulletinHook::fetch_hook('faq_item_display')) ? eval($hook) : false;
    $templater = vB_Template::create('faqbit');
    $templater->register('faq', $faq);
    $templater->register('faqsublinks', $faqsublinks);
    $faqbits .= $templater->render();
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:27,代码来源:functions_faq.php


示例4: fetchTemplate

 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $messageinfo =& $this->content['visitormessage'][$activity['contentid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $userinfo2 =& $this->content['user'][$messageinfo['userid']];
     $messageinfo['preview'] = strip_quotes($messageinfo['pagetext']);
     $messageinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($messageinfo['preview'], false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     $userinfo = $this->fetchUser($activity['userid'], $messageinfo['postusername']);
     if ($fetchphrase) {
         if ($userinfo['userid']) {
             $phrase = construct_phrase($this->vbphrase['x_created_a_visitormessage_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('member', $userinfo2, $linkinfo), $messageinfo['vmid'], fetch_seo_url('member', $userinfo2), $userinfo2['username']);
         } else {
             $phrase = construct_phrase($this->vbphrase['guest_x_created_a_visitormessage_y_in_z'], $userinfo['username'], fetch_seo_url('member', $userinfo2, $linkinfo), $messageinfo['vmid'], fetch_seo_url('member', $userinfo2), $userinfo2['username']);
         }
         return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('userinfo2', $userinfo2);
         $templater->register('linkinfo', array('vmid' => $messageinfo['vmid']));
         $templater->register('linkinfo2', array('tab' => 'visitor_messaging'));
         $templater->register('activity', $activity);
         $templater->register('messageinfo', $messageinfo);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:27,代码来源:visitormessage.php


示例5: __construct

 /**
  * Constructor
  * @param $results : a results object, normally from vb/search/results
  */
 public function __construct($results, $template = null)
 {
     $this->results = $results;
     if (!$template) {
         $this->template = vB_Template::create('search_resultlist');
     } else {
         $this->template = vB_Template::create($template);
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:13,代码来源:resultsview.php


示例6: output_token

 /**
  * Returns the HTML to be displayed to the user for Human Verification
  *
  * @param	string	Passed to template
  *
  * @return 	string	HTML to output
  *
  */
 function output_token($var_prefix = 'humanverify')
 {
     global $vbphrase, $show;
     $vbulletin =& $this->registry;
     $humanverify = $this->generate_token();
     $templater = vB_Template::create('humanverify_image');
     $templater->register('humanverify', $humanverify);
     $templater->register('var_prefix', $var_prefix);
     $output = $templater->render();
     return $output;
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:19,代码来源:class_humanverify_image.php


示例7: render

 public function render($current_user, $criteria, $template = '')
 {
     $template = vB_Template::create('search_results_announcement');
     $template->register('announcecolspan', 6);
     $template->register('announcement', $this->record);
     $template->register('announcementidlink', '&amp;a=' . $this->record['announcementid']);
     //this is actually how the legacy search code does it, since the foruminfo
     //value it passes isn't set properly.  Its only used to set the forum id
     //on the link which is ignored if the announcementid is also set
     $template->register('foruminfo', array());
     return $template->render();
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:12,代码来源:announcement.php


示例8: getHTML

 public function getHTML($content = false)
 {
     if (!$content) {
         $content = $this->getData();
     }
     if ($content) {
         $templater = vB_Template::create($this->config['html_template']);
         $templater->register('blockinfo', $this->blockinfo);
         $templater->register('content', $content);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:12,代码来源:html.php


示例9: render

 /**
  * Performs the actual rendering of the view.
  *
  * @param vB_View $view						- The view to render
  * @return string							- The rendering result
  */
 protected function render(vB_View $view)
 {
     // Set up the style info
     $this->bootstrap->force_styleid($this->styleid);
     $this->bootstrap->load_style();
     // Create a template
     $template = vB_Template::create($view->getResult());
     // Register the view data
     $template->quickRegister($view->getViewData());
     // Return the output
     return $template->render();
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:18,代码来源:vb.php


示例10: getHTML

 public function getHTML($streamdata = false)
 {
     if (!$streamdata) {
         $streamdata = $this->getData();
     }
     if ($streamdata) {
         $templater = vB_Template::create('block_activitystream');
         $templater->register('blockinfo', $this->blockinfo);
         $templater->register('stream', $streamdata);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:12,代码来源:activitystream.php


示例11: render

 public function render($current_user, $criteria, $template_name = '')
 {
     global $vbulletin;
     if ('' == $template_name) {
         $template_name = 'search_results_forum';
     }
     $template = vB_Template::create($template_name);
     $template->register('forum', $this->forum->get_record());
     $template->register('dateformat', $vbulletin->options['dateformat']);
     $template->register('timeformat', $vbulletin->options['timeformat']);
     return $template->render();
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:12,代码来源:forum.php


示例12: output_token

 /**
  * Returns the HTML to be displayed to the user for Human Verification
  *
  * @param	string	Passed to template
  *
  * @return 	string	HTML to output
  *
  */
 function output_token($var_prefix = 'humanverify')
 {
     global $vbphrase, $show;
     $vbulletin =& $this->registry;
     $humanverify = $this->generate_token();
     require_once DIR . '/includes/functions_misc.php';
     $humanverify['question'] = fetch_phrase('question' . $humanverify['answer'], 'hvquestion', '', false, true, $this->registry->userinfo['languageid'], false);
     $templater = vB_Template::create('humanverify_question');
     $templater->register('humanverify', $humanverify);
     $templater->register('var_prefix', $var_prefix);
     $output = $templater->render();
     return $output;
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:21,代码来源:class_humanverify_question.php


示例13: output_token

 /**
  * Returns the HTML to be displayed to the user for Human Verification
  *
  * @param	string	Passed to template
  *
  * @return 	string	HTML to output
  *
  */
 function output_token($var_prefix = 'humanverify')
 {
     global $vbphrase, $show;
     $vbulletin =& $this->registry;
     $humanverify = $this->generate_token();
     $phraseAux = vB_Api::instanceInternal('phrase')->fetch(array('question' . $humanverify['answer']));
     $humanverify['question'] = $phraseAux['question' . $humanverify['answer']];
     $templater = vB_Template::create('humanverify_question');
     $templater->register('humanverify', $humanverify);
     $templater->register('var_prefix', $var_prefix);
     $output = $templater->render();
     return $output;
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:21,代码来源:class_humanverify_question.php


示例14: fetchTemplate

 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $groupinfo =& $this->content['socialgroup'][$activity['contentid']];
     $userinfo =& $this->content['user'][$activity['userid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     if ($fetchphrase) {
         return array('phrase' => construct_phrase($this->vbphrase['x_created_a_group_y'], fetch_seo_url('member', $userinfo), $userinfo['username'], vB::$vbulletin->session->vars['sessionurl'], $groupinfo['groupid'], $groupinfo['name']), 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('activity', $activity);
         $templater->register('groupinfo', $groupinfo);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:16,代码来源:group.php


示例15: getHTML

 public function getHTML($tag_cloud = false)
 {
     if (!$tag_cloud) {
         $tag_cloud = $this->getData();
     }
     if ($tag_cloud) {
         foreach ($tag_cloud['tags'] as $thistag) {
             $templater = vB_Template::create('tag_cloud_link');
             $templater->register('thistag', $thistag);
             $tag_cloud['links'] .= $templater->render();
         }
         $templater = vB_Template::create('block_tagcloud');
         $templater->register('blockinfo', $this->blockinfo);
         $templater->register('tagcloud', $tag_cloud['links']);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:17,代码来源:tagcloud.php


示例16: fetchTemplate

 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $userinfo =& $this->content['user'][$activity['userid']];
     $bloginfo =& $this->content['blog'][$activity['contentid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $preview = strip_quotes($bloginfo['pagetext']);
     $bloginfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     if ($fetchphrase) {
         return array('phrase' => construct_phrase($this->vbphrase['x_created_a_blog_entry_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('entry', $bloginfo), $bloginfo['title'], fetch_seo_url('blog', $bloginfo), $bloginfo['blog_title']), 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('activity', $activity);
         $templater->register('bloginfo', $bloginfo);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:18,代码来源:entry.php


示例17: listUi

	public function listUi($prefs)
	{
		$phrase = new vB_Legacy_Phrase();
		$phrase->add_phrase_groups(array('vbblogglobal', 'vbblogcat'));

		global $vbulletin;
		$template = vB_Template::create('search_input_blogcomment');
		$template->register('securitytoken', $vbulletin->userinfo['securitytoken']);
		$template->register('contenttypeid', $this->get_contenttypeid());

		$prefsettings = array(
			'select'=> array('searchdate', 'beforeafter', 'sortby',
				'titleonly', 'sortorder', 'starteronly'),
			'cb' => array('nocache', 'exactname'),
		 	'value' => array('query', 'searchuser')
		);

		$this->setPrefs($template, $prefs, $prefsettings);
		vB_Search_Searchtools::searchIntroRegisterHumanVerify($template);
		return $template->render();	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:20,代码来源:blogcomment.php


示例18: construct_postbit

 /**
  * Template method. Calls all the appropriate methods to build a post and then evaluates the template.
  *
  * @param	array	Post information
  *
  * @return	string	HTML for the post
  */
 function construct_postbit(&$post)
 {
     $this->post =& $post;
     global $show, $vbphrase, $stylevar, $template_hook;
     $tmp_show = $show;
     $tmp_stylevar = $stylevar;
     $tmp_vbcms = $this->registry->products['vbcms'];
     $this->registry->products['vbcms'] = false;
     $session_url = $vbulletin->session->vars['sessionurl'];
     $vbulletin->session->vars['sessionurl'] = '';
     $this->parse_bbcode();
     $this->process_attachments();
     $templater = vB_Template::create($this->template_prefix . $this->templatename);
     $templater->register('template_hook', $template_hook);
     $templater->register('post', $post);
     $result = $templater->render();
     $this->registry->products['vbcms'] = $tmp_vbcms;
     $show = $tmp_show;
     $stylevar = $tmp_stylevar;
     $vbulletin->session->vars['sessionurl'] = $session_url;
     return $result;
 }
开发者ID:rcdesign-cemetery,项目名称:vb-nntp,代码行数:29,代码来源:class_postbit_post_nntp.php


示例19: fetch_entry_tagbits

/**
* Fetches the tagbits for display in an entry
*
* @param	array	Blog info
*
* @return	string	Tag bits
*/
function fetch_entry_tagbits($bloginfo, &$userinfo)
{
	global $vbulletin, $vbphrase, $show, $template_hook;

	if ($bloginfo['taglist'])
	{
		$tag_array = explode(',', $bloginfo['taglist']);

		$tag_list = array();
		foreach ($tag_array AS $tag)
		{
			$tag = trim($tag);
			if ($tag === '')
			{
				continue;
			}
			$tag_url = urlencode(unhtmlspecialchars($tag));
			$tag = fetch_word_wrapped_string($tag);

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

			$templater = vB_Template::create('blog_tagbit');
				$templater->register('tag', $tag);
				$templater->register('tag_url', $tag_url);
				$templater->register('userinfo', $userinfo);
				$templater->register('pageinfo', array('tag' => $tag_url));
			$tag_list[] = trim($templater->render());
		}
	}
	else
	{
		$tag_list = array();
	}

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

	return implode(", ", $tag_list);
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:45,代码来源:blog_functions_tag.php


示例20: fetchTemplate

 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     global $show;
     $threadinfo =& $this->content['thread'][$activity['contentid']];
     $foruminfo =& vB::$vbulletin->forumcache[$threadinfo['forumid']];
     $threadinfo['prefix_plain_html'] = htmlspecialchars_uni($this->vbphrase["prefix_{$threadinfo['prefixid']}_title_plain"]);
     $threadinfo['prefix_rich'] = $this->vbphrase["prefix_{$threadinfo['prefixid']}_title_rich"];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $threadinfo['preview'] = strip_quotes($threadinfo['pagetext']);
     $threadinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($threadinfo['preview'], false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     $forumperms = fetch_permissions($threadinfo['forumid']);
     $show['threadcontent'] = $forumperms & vB::$vbulletin->bf_ugp_forumpermissions['canviewthreads'] ? true : false;
     $userinfo = $this->fetchUser($activity['userid'], $threadinfo['postusername']);
     if ($fetchphrase) {
         if ($threadinfo['pollid']) {
             if ($userinfo['userid']) {
                 $phrase = construct_phrase($this->vbphrase['x_started_a_poll_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
             } else {
                 $phrase = construct_phrase($this->vbphrase['guest_x_started_a_poll_y_in_z'], $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
             }
         } else {
             if ($userinfo['userid']) {
                 $phrase = construct_phrase($this->vbphrase['x_started_a_thread_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
             } else {
                 $phrase = construct_phrase($this->vbphrase['guest_x_started_a_thread_y_in_z'], $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
             }
         }
         return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('activity', $activity);
         $templater->register('threadinfo', $threadinfo);
         $templater->register('foruminfo', $foruminfo);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:38,代码来源:thread.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP vB_Template_Runtime类代码示例发布时间:2022-05-23
下一篇:
PHP vB_Search_Core类代码示例发布时间: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