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


PHP vB_Template类代码示例

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


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


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