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


PHP XenForo_Template_Abstract::addRequiredExternal方法代码示例

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


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

示例1: rrssbExtFiles

 public static function rrssbExtFiles(&$templateName, array &$params, XenForo_Template_Abstract $template)
 {
     if ($templateName == 'thread_view') {
         $template->addRequiredExternal('css', 'SV_rrssbDefault');
         $template->preloadTemplate('SV_rrssbShares');
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:7,代码来源:Listener.php

示例2: template_create

 public static function template_create($templateName, array &$params, XenForo_Template_Abstract $template)
 {
     switch ($templateName) {
         case 'thread_online':
         case 'thread_view':
             $visitor = XenForo_Visitor::getInstance();
             $options = XenForo_Application::get('options');
             $livedNodes = $options->sonnb_LiveThread_EnabledNodes;
             $hasViewPermission = $visitor->hasPermission('sonnb_LiveThread', 'sonnb_LiveThread_Use') || $visitor->hasPermission('sonnb_LiveThread', 'sonnb_LiveThread_Manage');
             if (isset($params['thread']) && ($params['thread']['sonnb_live_thread'] || in_array($params['thread']['node_id'], $livedNodes)) && $hasViewPermission) {
                 $template->addRequiredExternal('js', 'js/sonnb/LiveThread/LiveThread.js');
                 $template->addRequiredExternal('css', 'thread_view_live');
             }
             break;
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:16,代码来源:Listener.php

示例3: templateCreate

 public static function templateCreate(&$templateName, array &$params, XenForo_Template_Abstract $template)
 {
     if ($templateName == 'PAGE_CONTAINER' && $template instanceof XenForo_Template_Admin) {
         $template->addRequiredExternal('css', 'devkit');
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:6,代码来源:Listener.php

示例4: template_post_render

 public static function template_post_render($templateName, &$content, array &$containerData, XenForo_Template_Abstract $template)
 {
     if ($template instanceof XenForo_Template_Admin || !self::$_hasPerm) {
         return;
     }
     $xenOptions = XenForo_Application::get('options');
     $visitor = XenForo_Visitor::getInstance();
     $params = $template->getParams();
     /** @var sonnbUpThread_Model_Log $upModel */
     $upModel = XenForo_Model::create('sonnbUpThread_Model_Log');
     if (!empty($params['forum']['node_id']) && in_array($params['forum']['node_id'], $xenOptions->sonnbUpThread_allowedNodes)) {
         switch ($templateName) {
             case 'forum_view':
                 if (!$xenOptions->SUT_showInThreadList) {
                     return;
                 }
                 if (preg_match_all('#<li[^>]*?\\bid="thread-([0-9]+)"[^>]*+>(.*)<\\/li>#Usi', $content, $matchThreads)) {
                     $template->addRequiredExternal('js', 'js/sonnb/UpThread/threadlist.js');
                     foreach ($matchThreads[1] as $index => $threadId) {
                         $thread = false;
                         if (isset($params['threads'][$threadId])) {
                             $thread = $params['threads'][$threadId];
                         } else {
                             if (isset($params['stickyThreads'][$threadId])) {
                                 $thread = $params['stickyThreads'][$threadId];
                             }
                         }
                         if (!$upModel->canUpThread($thread)) {
                             continue;
                         }
                         $params['canAutoUp'] = $upModel->canScheduleThread($thread);
                         if ($thread && $thread['discussion_state'] == 'visible' && ($thread['discussion_open'] || !$thread['discussion_open'] && !$xenOptions->sonnbUpThread_disableOnClosed)) {
                             if (preg_match('#<div[^>]*?\\bclass="controls(.*)"[^>]*+>(.*)<\\/div>#Usi', $matchThreads[0][$index], $matchCtrl)) {
                                 $params['thread'] = $thread;
                                 $btnHtml = $template->create('sonnb_up_thread_list', $params);
                                 $matchCtrlNew = str_replace($matchCtrl[2], $matchCtrl[2] . $btnHtml, $matchCtrl[0]);
                                 $matchThreadNew = str_replace($matchCtrl[0], $matchCtrlNew, $matchThreads[0][$index]);
                                 $content = str_replace($matchThreads[0][$index], $matchThreadNew, $content);
                             }
                         }
                     }
                 }
                 break;
             case 'thread_view':
                 $thread = $params['thread'];
                 if (!$upModel->canUpThread($thread)) {
                     return;
                 }
                 $params['canAutoUp'] = $upModel->canScheduleThread($thread);
                 if ($thread['discussion_state'] == 'visible' && ($thread['discussion_open'] || !$thread['discussion_open'] && !$xenOptions->sonnbUpThread_disableOnClosed)) {
                     $template->addRequiredExternal('js', 'js/sonnb/UpThread/threadlist.js');
                     if ($xenOptions->sonnbUpThread_enableLimit && ($xenOptions->SUT_countdown || $xenOptions->SUT_countdown_top)) {
                         $requireWait = $xenOptions->sonnbUpThread_requireDelay;
                         $delayThread = $upModel->getPermission('SUT_upDelayThread');
                         $delayGlobal = $upModel->getPermission('SUT_upDelayGlobal');
                         $duration = $lastThreadUpTime = $lastGlobalUpTime = 0;
                         if ($delayThread > 0) {
                             $lastThreadUpTime = $upModel->getLastUptime($visitor['user_id'], $thread['thread_id']);
                             if (!$lastThreadUpTime && $requireWait) {
                                 $lastThreadUpTime = $thread['post_date'];
                             }
                         }
                         if ($delayGlobal > 0) {
                             $lastGlobalUpTime = $upModel->getLastUptime($visitor['user_id']);
                         }
                         if ($lastThreadUpTime > 0 || $lastGlobalUpTime > 0) {
                             if ($lastThreadUpTime + $delayThread > $lastGlobalUpTime + $delayGlobal) {
                                 $duration = $lastThreadUpTime + $delayThread;
                             } else {
                                 $duration = $lastGlobalUpTime + $delayGlobal;
                             }
                         }
                         $now = XenForo_Application::$time;
                         if ($duration > $now) {
                             $params['upCountDown'] = $duration;
                             $countdown = $params['upCountDown'] - $now;
                             if ($countdown > 1000) {
                                 $params['upCountDownFormat'] = 'owdhMS';
                                 $params['upCountDownLayout'] = '{o<}{onn}m {o>}{w<}{wnn}w {w>}{d<}{dnn}d {d>}{h<}{hnn}:{h>}{mnn}:{snn}';
                             } else {
                                 $params['upCountDownFormat'] = 'S';
                                 $params['upCountDownLayout'] = '{snn} ' . new XenForo_Phrase('SUT_seconds');
                             }
                         }
                     }
                     if (preg_match('#<div[^>]*?\\bclass="linkGroup\\s*SelectionCountContainer"[^>]*+>(.*)<\\/div>#Usi', $content, $matchCtrl)) {
                         if ($xenOptions->SUT_singleUpButton) {
                             $_templateName = 'sonnb_up_thread_view_single';
                         } else {
                             $_templateName = 'sonnb_up_thread_view';
                         }
                         $btnHtml = $template->create($_templateName, $params);
                         $matchCtrlNew = str_replace($matchCtrl[1], $btnHtml . $matchCtrl[1], $matchCtrl[0]);
                         $content = str_replace($matchCtrl[0], $matchCtrlNew, $content);
                     }
                     if (preg_match('#<div[^>]*?\\bclass="submitUnit"[^>]*+>.*<input[^>]*?\\btype="submit"\\s*\\bclass="button\\s*primary"[^>]*+>#Usi', $content, $matchSubmit)) {
                         $btnHtml = $template->create('sonnb_up_thread_reply_up', $params);
                         $content = str_replace($matchSubmit[0], $matchSubmit[0] . $btnHtml, $content);
                     }
                 }
//.........这里部分代码省略.........
开发者ID:darkearl,项目名称:projectT122015,代码行数:101,代码来源:Listener.php

示例5: template_hook

 /**
  * @param $hookName
  * @param $contents
  * @param array $hookParams
  * @param XenForo_Template_Abstract $template
  */
 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     if (!self::canViewGallery()) {
         return;
     }
     if ($template instanceof XenForo_Template_Admin) {
         return;
     }
     $params = array_merge($template->getParams(), $hookParams);
     switch ($hookName) {
         case 'account_wrapper_sidebar':
             $contents .= $template->create('sonnb_xengallery_account_nav', $params);
             break;
         case 'navigation_visitor_tab_links2':
             $contents .= $template->create('sonnb_xengallery_nav_visitor', $params);
             break;
         case 'member_card_stats':
             $contents .= $template->create('sonnb_xengallery_member_card', $params);
             break;
         case 'member_view_info_block':
             $contents .= $template->create('sonnb_xengallery_member_view_info', $params);
             break;
         case 'member_card_links':
             $contents .= $template->create('sonnb_xengallery_member_card_links', $params);
             break;
         case 'member_view_tabs_heading':
             $contents .= $template->create('sonnb_xengallery_member_view_tabs_heading', $params);
             break;
         case 'member_view_tabs_content':
             $contents .= $template->create('sonnb_xengallery_member_view_tabs_content', $params);
             break;
         case 'search_form_tabs':
             $contents .= $template->create('sonnb_xengallery_search_form_tabs_album', $params);
             $contents .= $template->create('sonnb_xengallery_search_form_tabs_photo', $params);
             $contents .= $template->create('sonnb_xengallery_search_form_tabs_video', $params);
             break;
         case 'sonnb_cr_information':
             if ($tos = XenForo_Application::getOptions()->sonnbXG_copyright) {
                 $contents .= $template->create('sonnb_xengallery_option_copyright', array('tos' => $tos));
             }
             if (XenForo_Application::getConfig()->get('sonnbXengalleryCopyrightRemoved') !== true) {
                 $contents .= $template->create('sonnb_xengallery_copyright');
             }
             break;
         case 'editor':
             if (XenForo_Application::$versionId > 1020000 && XenForo_Application::getOptions()->sonnbXG_editorButtons) {
                 $template->addRequiredExternal('js', 'js/sonnb/XenGallery/gallery.editor.js');
             }
             break;
         case 'xengallery_quick_navigation_menu':
             $contents .= $template->create('sonnb_xengallery_quick_navigation_menu_gallery');
             break;
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:60,代码来源:Listener.php


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