示例#1
0
文件: Public.php 项目: Sywooch/forums
 public static function hooks($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     if (self::$class_check === null) {
         self::$class_check = class_exists('KingK_BbCodeManager_BbCodeManager');
     }
     if (self::$class_check === false) {
         switch ($hookName) {
             case 'editor':
                 $options = XenForo_Application::get('options');
                 $visitor = XenForo_Visitor::getInstance();
                 if ($options->Bbm_Bm_ShowControllerInfo && $visitor['is_admin']) {
                     $contents .= $template->create('bbm_editor_extra_info', $template->getParams());
                 }
                 break;
             case 'help_bb_codes':
                 $contents .= $template->create('help_bbm_bbcodes', $template->getParams());
                 break;
             case 'page_container_head':
                 if ($template instanceof XenForo_Template_Admin && !$options->Bbm_Bm_SetInAdmin) {
                     break;
                 }
                 //Extra css
                 $contents .= $template->create('bbm_js', $template->getParams());
                 break;
         }
     }
 }
示例#2
0
    public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
    {
        $listModel = XenForo_Model::create('EWRmedio_Model_Lists');
        switch ($hookName) {
            case 'account_alerts_extra':
                $contents .= $template->create('EWRmedio_AlertPreferences');
                break;
            case 'account_preferences_options':
                $params = $template->getParams();
                $hookParams['media'] = $params['media'];
                $contents = $template->create('EWRmedio_AccountPreferences', $hookParams) . $contents;
                break;
            case 'account_wrapper_sidebar_your_account':
                $contents .= $template->create('EWRmedio_Watch_Wrapper');
                break;
            case 'member_view_tabs_heading':
                if ($listModel->getMediaCount('user', $hookParams['user']['user_id'])) {
                    $contents .= $template->create('EWRmedio_Profile_Heading', $hookParams);
                }
                break;
            case 'member_view_tabs_content':
                if ($listModel->getMediaCount('user', $hookParams['user']['user_id'])) {
                    $contents .= $template->create('EWRmedio_Profile_Content', $hookParams);
                }
                break;
            case 'navigation_visitor_tab_links2':
                $contents = str_replace(new XenForo_Phrase('watched_threads') . '</a></li>', new XenForo_Phrase('watched_threads') . '</a></li>
						<li><a href="' . new XenForo_Link('watched/media') . '">' . new XenForo_Phrase('watched_media') . '</a></li>', $contents);
                break;
            case 'search_form_tabs':
                $contents .= $template->create('EWRmedio_Search_Tab', $template->getParams());
                break;
        }
    }
示例#3
0
 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     //Swiiitch!
     switch ($hookName) {
         //first template hook
         case 'member_view_tabs_heading':
             //Get our template!
             $ourTemplate = $template->create('autocraft_GameProfilesTab', $template->getParams());
             //Render
             $rendered = $ourTemplate->render();
             //Put the rendered template in the contents.
             $contents .= $rendered;
             break;
             //second template hook
         //second template hook
         case 'member_view_tabs_content':
             //Get our template!
             $ourTemplate = $template->create('autocraft_GameProfiles', $template->getParams());
             //Render
             $rendered = $ourTemplate->render();
             //Put the rendered template in the contents.
             $contents .= $rendered;
             break;
     }
 }
示例#4
0
 public static function templatePostRender($templateName, &$content, array &$containerData, XenForo_Template_Abstract $template)
 {
     switch ($templateName) {
         case 'template_list':
             $params = $template->getParams();
             $params['type'] = 'public';
             $replace = $template->create('template_list_addon_filter', $params);
             $content = preg_replace('/<div class="Popup">(.*?<\\/div>){3}/is', "\\0 {$replace}", $content);
             break;
         case 'template_search':
             $params = $template->getParams();
             $replace = $template->create('template_search_addon_filter', $params);
             $content = preg_replace('/<dl class="ctrlUnit">(.*?<\\/dl>){1}/is', "\\0 {$replace}", $content, 1);
             break;
         case 'template_search_results':
             $params = $template->getParams();
             if (!empty($params['addOn'])) {
                 $containerData['title'] .= '<br />' . new XenForo_Phrase('add_on') . ': ' . $params['addOn']['title'];
             }
             break;
         case 'admin_template_list':
             $params = $template->getParams();
             $params['type'] = 'admin';
             $replace = $template->create('template_list_addon_filter', $params);
             $content = preg_replace('/<form action="[^\\>]*>(.*?)<\\/form>/is', "{$replace} \\0", $content);
             break;
     }
 }
示例#5
0
 public static function listenhooks($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'account_privacy_top':
             $options = XenForo_Application::get('options');
             if (!$options->sedo_at_preventracing) {
                 break;
             }
             $mergedParams = array_merge($template->getParams(), $hookParams);
             $contents = $template->create('sedo_agent_account', $mergedParams) . $contents;
             break;
         case 'message_content':
             $options = XenForo_Application::get('options');
             $src = $template->getTemplateName();
             //Check which kind of integration is activated
             if ($src == 'conversation_view' && (!$options->sedo_at_auto_conversation || $options->sedo_at_auto_conversation_style != 'graphic') or $src == 'thread_view' && (!$options->sedo_at_auto_thread || $options->sedo_at_auto_thread_style != 'graphic')) {
                 break;
             }
             if ($options->sedo_at_auto_thread_style == 'graphic' || $options->sedo_at_auto_thread_style == 'graphic') {
                 $mergedParams = array_merge($template->getParams(), $hookParams);
                 $contents .= $template->create('sedo_agent', $mergedParams);
             }
             break;
     }
 }
 public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'user_criteria_extra':
             $s = new Steam_Helper_Steam();
             $contents .= $template->create('steam_helper_criteria_privs', array_merge($hookParams, $template->getParams(), array_merge($hookParams, $template->getParams(), array("steam_games" => $s->getAvailableGames()))));
             break;
     }
 }
示例#7
0
 public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     $modernStatisticModel = XenForo_Model::create('Brivium_ModernStatistic_Model_ModernStatistic');
     if (is_null(self::$_dismissed)) {
         self::$_dismissed = true;
         if (!$modernStatisticModel->checkExclude()) {
             self::$_dismissed = false;
         }
     }
     if (!self::$_dismissed) {
         $options = XenForo_Application::get('options');
         $position = $options->BRMS_position;
         if ($position != 'other') {
             if ($hookName == $position) {
                 $ourTemplate = $template->create('BRMS_ModernStatistic', $template->getParams());
                 $contents .= $ourTemplate->render();
             }
         }
         if ($options->BRMS_loadFirstTab) {
             switch ($hookName) {
                 case 'brms_modern_statistic_first_tabs':
                     if (!empty($options->BRMS_tabsSelector)) {
                         $tabId = -1;
                         $xenAddons = XenForo_Application::get('addOns');
                         $userId = XenForo_Visitor::getUserId();
                         foreach ($options->BRMS_tabsSelector as $key => $tab) {
                             if (!empty($tab['active']) && ($tab['kind'] != 'resource' || $modernStatisticModel->checkXenForoResourceAddon()) && ($tab['type'] != 'my_threads' || !empty($userId))) {
                                 $tabId = $key;
                                 break;
                             }
                         }
                         if ($tabId != -1) {
                             $limit = 0;
                             $limitOptions = $options->BRMS_itemLimit;
                             if (!empty($limitOptions['enabled'])) {
                                 $request = new Zend_Controller_Request_Http();
                                 $limit = $request->getCookie('brmsNumberEntry');
                             }
                             $viewParams = $modernStatisticModel->getStatistics($tabId, $limit ? $limit : 0);
                             $newTemplate = $template->create($viewParams['template'], $template->getParams());
                             $newTemplate->setParams($viewParams);
                             $contents = $newTemplate->render();
                         }
                     }
                     break;
             }
         }
     }
     // NO!
     self::_templateHook($hookName, $contents, $hookParams, $template);
 }
示例#8
0
 public static function templateHookListener($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'account_wrapper_sidebar_settings':
             $contents .= $template->create('discordauth_account_wrapper_sidebar', $template->getParams())->render();
             break;
         case 'member_view_tabs_content':
             $contents .= $template->create('discordauth_profile_tab_content', $template->getParams())->render();
             break;
         case 'navigation_visitor_tab_links1':
             $contents .= $template->create('discordauth_navigation_tab_link', $template->getParams())->render();
             break;
     }
 }
示例#9
0
文件: Listener.php 项目: burtay/bdApi
 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'account_wrapper_sidebar_settings':
             $ourTemplate = $template->create('bdapi_account_wrapper_sidebar', $template->getParams());
             $ourHtml = $ourTemplate->render();
             $contents .= $ourHtml;
             break;
         case 'navigation_visitor_tab_links1':
             $ourTemplate = $template->create('bdapi_navigation_visitor_tab', $template->getParams());
             $ourHtml = $ourTemplate->render();
             $contents .= $ourHtml;
             break;
     }
 }
示例#10
0
 public static function TemplateHook($hookName, &$content, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'dark_taigachat':
         case 'dark_taigachat_alt':
             $params = $template->getParams();
             if ($hookName == 'dark_taigachat_alt') {
                 $params['taigachat']['alt'] = true;
             }
             $params['taigachat']['room'] = 1;
             if (isset($hookParams['room'])) {
                 $params['taigachat']['room'] = $hookParams['room'];
             }
             $content .= $template->create('dark_taigachat', $params)->render();
             break;
         case 'dark_taigachat_online_users':
             $params = $template->getParams();
             $content .= $template->create('dark_taigachat_widget_online', $params)->render();
             break;
         case 'dark_taigachat_fake':
             $params = $template->getParams();
             $content .= $template->create('dark_taigachat_fake', $params)->render();
             break;
         case 'dark_taigachat_full':
             $params = $template->getParams();
             $params['taigachat']['room'] = 1;
             if (isset($hookParams['room'])) {
                 $params['taigachat']['room'] = $hookParams['room'];
             }
             $visitor = XenForo_Visitor::getInstance();
             $sessionModel = XenForo_Model::create('Dark_TaigaChat_Model_Session');
             $taigamodel = XenForo_Model::create("Dark_TaigaChat_Model_TaigaChat");
             $taigamodel->updateActivity($visitor['user_id'], false);
             $onlineUsers = $sessionModel->getSessionActivityQuickList($visitor->toArray(), array('cutOff' => array('>', $sessionModel->getOnlineStatusTimeout())), $visitor['user_id'] ? $visitor->toArray() : null);
             $onlineUsersTaiga = array();
             if ($options->dark_taigachat_sidebar) {
                 $onlineUsersTaiga = $taigamodel->getActivityUserList($visitor->toArray());
             }
             $params += array('taigachat' => array('onlineUsers' => $onlineUsers, 'sidebar_enabled' => true, 'online' => $onlineUsersTaiga));
             $response = new stdClass();
             $response->viewName = "Dark_TaigaChat_ViewPublic_TaigaChat_Index";
             $response->params = array();
             Dark_TaigaChat_Helper_Global::getTaigaChatStuff($response, "");
             $params = array_merge_recursive($params, $response->params);
             $content .= $template->create('dark_taigachat_full', $params)->render();
             break;
     }
 }
 protected function _renderOptions(XenForo_Template_Abstract $template)
 {
     $params = $template->getParams();
     /** @var XenForo_Model_UserGroup $userGroupModel */
     $userGroupModel = WidgetFramework_Core::getInstance()->getModelFromCache('XenForo_Model_UserGroup');
     $userGroups = $userGroupModel->getAllUserGroupTitles();
     $whitelistUserGroups = array();
     $blacklistUserGroups = array();
     $optionWhitelist = array();
     if (!empty($params['options']['whitelist_user_groups'])) {
         $optionWhitelist = $params['options']['whitelist_user_groups'];
     }
     $optionBlacklist = array();
     if (!empty($params['options']['blacklist_user_groups'])) {
         $optionBlacklist = $params['options']['blacklist_user_groups'];
     }
     foreach ($userGroups as $userGroupId => $title) {
         $whitelistSelected = in_array($userGroupId, $optionWhitelist);
         $whitelistUserGroups[] = array('value' => $userGroupId, 'label' => $title, 'selected' => $whitelistSelected);
         $blacklistSelected = in_array($userGroupId, $optionBlacklist);
         $blacklistUserGroups[] = array('value' => $userGroupId, 'label' => $title, 'selected' => $blacklistSelected);
     }
     $template->setParam('whitelistUserGroups', $whitelistUserGroups);
     $template->setParam('blacklistUserGroups', $blacklistUserGroups);
     return parent::_renderOptions($template);
 }
示例#12
0
 public static function listen($hookName, &$content, array $hookParams, XenForo_Template_Abstract $template)
 {
     if ($hookName == 'ad_below_content') {
         $params = $template->getParams();
         $content .= $template->create('dark_azucloud', $params);
     }
 }
示例#13
0
 public static function listen($hookName, &$content, array $hookParams, XenForo_Template_Abstract $template)
 {
     if ($hookName == 'editor') {
         $params = $template->getParams();
         $options = XenForo_Application::get('options');
         if ($options->dark_minorin_enabled) {
             $smilies = array();
             $toolbar_bbcode = array();
             $toolbar_bbcode_temp = explode("\n", str_replace("\r", "", trim($options->dark_minorin_bbcode)));
             foreach ($toolbar_bbcode_temp as $bbcode) {
                 $bbcode = explode(":", trim($bbcode));
                 $toolbar_bbcode[$bbcode[0]] = $bbcode[1];
             }
             if (XenForo_Application::isRegistered('smilies')) {
                 $smilies = XenForo_Application::get('smilies');
             } else {
                 $smilies = XenForo_Model::create('XenForo_Model_Smilie')->getAllSmiliesForCache();
                 XenForo_Application::set('smilies', $smilies);
             }
             foreach ($smilies as &$smilie) {
                 $smilie['text'] = $smilie['smilieText'][0];
                 $smilie['sprite_mode'] = array_key_exists('sprite_params', $smilie);
             }
             $params += array('minorin' => array("toolbar_bbcode" => $toolbar_bbcode, "toolbar_smilies" => $smilies, "enabled" => $options->dark_minorin_enabled, "js_modification" => filemtime("js/dark/minorin.js")));
         }
         $content .= $template->create('dark_minorin_toolbar', $params);
     }
 }
示例#14
0
 public static function templatePostRender($templateName, &$content, array &$containerData, XenForo_Template_Abstract $template)
 {
     $param = array();
     switch ($templateName) {
         case 'node_list.css':
             $cacheDataForum = XenForo_Application::isRegistered('brcnsCacheDataForum') ? XenForo_Application::get('brcnsCacheDataForum') : XenForo_Model::create('XenForo_Model_DataRegistry')->get('brcnsCacheDataForum');
             $cacheDataPage = XenForo_Application::isRegistered('brcnsCacheDataPage') ? XenForo_Application::get('brcnsCacheDataPage') : XenForo_Model::create('XenForo_Model_DataRegistry')->get('brcnsCacheDataPage');
             $cacheDataLink = XenForo_Application::isRegistered('brcnsCacheDataLink') ? XenForo_Application::get('brcnsCacheDataLink') : XenForo_Model::create('XenForo_Model_DataRegistry')->get('brcnsCacheDataLink');
             $cacheDataCategory = XenForo_Application::isRegistered('brcnsCacheDataCategory') ? XenForo_Application::get('brcnsCacheDataCategory') : XenForo_Model::create('XenForo_Model_DataRegistry')->get('brcnsCacheDataCategory');
             $cacheDataCategoryRoot = XenForo_Application::isRegistered('brcnsCacheDataCateRoot') ? XenForo_Application::get('brcnsCacheDataCateRoot') : XenForo_Model::create('XenForo_Model_DataRegistry')->get('brcnsCacheDataCateRoot');
             XenForo_Application::set('brcnsCustomNodeStylesForum', $cacheDataForum);
             XenForo_Application::set('brcnsCustomNodeStylesPage', $cacheDataPage);
             XenForo_Application::set('brcnsCustomNodeStylesLink', $cacheDataLink);
             XenForo_Application::set('brcnsCustomNodeStylesCategory', $cacheDataCategory);
             XenForo_Application::set('brcnsCustomNodeStylesCategoryRoot', $cacheDataCategoryRoot);
             $param['CustomNodeStylesForums'] = XenForo_Application::get('brcnsCustomNodeStylesForum');
             $param['CustomNodeStylesPages'] = XenForo_Application::get('brcnsCustomNodeStylesPage');
             $param['CustomNodeStylesLinks'] = XenForo_Application::get('brcnsCustomNodeStylesLink');
             $param['CustomNodeStylescategories'] = XenForo_Application::get('brcnsCustomNodeStylesCategory');
             $param['CustomNodeStylesCategoriesRoot'] = XenForo_Application::get('brcnsCustomNodeStylesCategoryRoot');
             $options = XenForo_Application::get('options');
             $param['size'] = $options->BRCNS_size_icon;
             $newTemplate = $template->create('BRCNS_custom_node_style.css', $template->getParams());
             $newTemplate->setParams($param);
             $content = $content . $newTemplate->render();
             break;
     }
 }
示例#15
0
 public static function template_post_render($templateName, &$content, array &$containerData, XenForo_Template_Abstract $template)
 {
     switch ($templateName) {
         case 'bb_code_tag_attach':
             $xenOptions = XenForo_Application::getOptions();
             $cdnEnable = $xenOptions->Tinhte_AIO_CDNEnable;
             $cdnDomain = $xenOptions->Tinhte_AIO_CDNDomain;
             $params = $template->getParams();
             if (isset($params['attachment']['thumbnailUrl'])) {
                 if ($cdnEnable) {
                     $params['attachment_link'] = XenForo_Link::buildPublicLink('attachments', $params['attachment']);
                     $params['attachment_thumbnail'] = $params['attachment']['thumbnailUrl'];
                     if (substr($params['attachment_link'], 0, 7) != 'http://' && substr($params['attachment_link'], 0, 8) != 'https://') {
                         $params['attachment_link'] = self::_getValidUrl($cdnDomain) . $params['attachment_link'];
                     }
                     if (substr($params['attachment_thumbnail'], 0, 7) != 'http://' && substr($params['attachment_thumbnail'], 0, 8) != 'https://') {
                         $params['attachment_thumbnail'] = self::_getValidUrl($cdnDomain) . $params['attachment_thumbnail'];
                     }
                     $params['cdnDomain'] = self::_getValidUrl($cdnDomain);
                 } else {
                     $params['attachment_link'] = XenForo_Link::buildPublicLink('full:attachments', $params['attachment']);
                     $params['attachment_thumbnail'] = $params['attachment']['thumbnailUrl'];
                 }
                 $hookTemplate = $template->create('TinhTe_AIO_Attach', $params);
                 $content = $hookTemplate->render();
             }
             break;
     }
 }
示例#16
0
 /**
  *
  * @return array
  */
 protected function _fetchViewParams()
 {
     if (!$this->_template) {
         return array();
     }
     return $this->_template->getParams();
 }
示例#17
0
 protected function _renderOptions(XenForo_Template_Abstract $template)
 {
     $params = $template->getParams();
     $forums = $this->_helperPrepareForumsOptionSource(empty($params['options']['forums']) ? array() : $params['options']['forums'], true);
     $template->setParam('forums', $forums);
     return parent::_renderOptions($template);
 }
示例#18
0
 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     if ($hookName == 'message_content') {
         $ourTemplate = $template->create('MoreThread_main', $template->getParams());
         $ourTemplate->setParam('message', $hookParams['message']);
         $contents .= $ourTemplate->render();
     }
 }
示例#19
0
 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     if ($hookName == 'forum_list_nodes') {
         $params = $template->getParams();
         if (isset($params['vnxf_stats_iscat'])) {
             $templater = $template->create('VNXF_Stats_Cat', $params + $hookParams);
         } else {
             $templater = $template->create('VNXF_Stats', $params + $hookParams);
         }
         $contents = $templater->render() . $contents;
     }
     if ($hookName == 'forum_view_pagenav_before') {
         $params = $template->getParams();
         $templater = $template->create('VNXF_Stats_Cat', $params + $hookParams);
         $contents = $templater->render() . $contents;
     }
 }
示例#20
0
 public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'page_container_sidebar':
             $contents .= $template->create('cta_countdown_main', $template->getParams());
             break;
     }
 }
示例#21
0
 protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
 {
     $params = $renderTemplateObject->getParams();
     $params['taigachat']['alt'] = true;
     $params['taigachat_alt'] = true;
     $renderTemplateObject->setParams($params);
     return $renderTemplateObject->render();
 }
 public static function sidebarTemplateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'account_wrapper_sidebar_settings':
         case 'navigation_visitor_tab_links1':
             $contents .= $template->create('silverpopintegration_sidebar_email_preferences', $template->getParams());
             break;
     }
 }
示例#23
0
 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'account_contact_details_messaging':
             $ourTemplate = $template->create('bdtagme_' . $hookName, $template->getParams());
             $contents .= $ourTemplate->render();
             break;
     }
 }
示例#24
0
 public static function template_post_render($templateName, &$content, array &$containerData, XenForo_Template_Abstract $template)
 {
     switch ($templateName) {
         case 'addon_edit':
             $ourTemplate = $template->create('devhelper_' . $templateName, $template->getParams());
             $rendered = $ourTemplate->render();
             self::_injectHtml($content, $rendered);
             break;
     }
 }
示例#25
0
 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'ad_message_below':
             $ourTemplate = $template->create('addthis_ajax_post', $template->getParams());
             $rendered = $ourTemplate->render();
             $contents .= $rendered;
             break;
     }
 }
示例#26
0
 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     if ($hookName == 'member_card_links') {
         $params = $template->getParams();
         $params += $hookParams;
         $userModel = XenForo_Model::create('XenForo_Model_User');
         $params += array('canPromote' => $userModel->canPromote($params['user']));
         $contents .= $template->create('member_promote_links', $params);
     }
 }
示例#27
0
 public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     // sonnn edit
     if ($hookName == 'thread_create_fields_extra') {
         $ourTemplate = $template->create('vtPhong_add_slide_show_template', $template->getParams());
         $rendered = $ourTemplate->render();
         $contents .= $rendered;
     }
     if ($hookName == 'post_edit_fields_extra') {
         $ourTemplate = $template->create('vtPhong_add_slide_show_template', $template->getParams('slides'));
         $rendered = $ourTemplate->render();
         $contents .= $rendered;
     }
     if ($hookName == 'admin_forum_edit_forum_options') {
         $ourTemplate = $template->create('vtPhong_forum_options_add_slide', $template->getParams());
         $rendered = $ourTemplate->render();
         $contents .= $rendered;
     }
 }
示例#28
0
 /**
  * // TODO method descr.
  * @static
  * @param  $name
  * @param  $contents
  * @param  $params
  * @param XenForo_Template_Abstract $template
  * @return void
  */
 public static function templateHooks($name, &$contents, array $params, XenForo_Template_Abstract $template)
 {
     if ($name == 'page_container_sidebar') {
         $search = '<!-- slot: forum_stats_extra -->';
         $params = $template->getParams();
         $most = $template->create('ragtek_sidebarBlock_mostOnlineUsers', $params)->render();
         $replace = $search . $most;
         $contents = preg_replace('#' . $search . '#', $replace, $contents, 1);
     }
 }
 public static function templateHookForumPageNavBefore($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     $templateParams = $template->getParams();
     if (isset($templateParams['forum']['node_id']) && in_array($templateParams['forum']['node_id'], XenForo_Application::get('options')->get('pfl_display_in_forums'))) {
         $viewParams = array_merge($templateParams, $hookParams);
         $ourTemplate = $template->create('pfl_prefixes_list', $viewParams);
         $rendered = $ourTemplate->render();
         $contents = $contents . $rendered;
     }
 }
示例#30
0
 public static function template_render($name, &$contents, $params, XenForo_Template_Abstract $template)
 {
     if ($name == 'page_container_head') {
         $addtemplate = $template->create('xenCODE_Meta_Keywords', $template->getParams());
         $rendered = $addtemplate->render();
         $needle = '<meta name="description"';
         $contents = str_replace($needle, $rendered . '	' . $needle, $contents);
         return $contents;
     }
 }