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


PHP XenForo_Template_Abstract::getparams方法代码示例

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


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

示例1: template_hook

 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     $options = XenForo_Application::get('options');
     $enableadvxenforo = $options->enableadvxenforo;
     $thread_id = $hookParams['thread']['thread_id'];
     if ($enableadvxenforo) {
         $PermissionEnable = XenForo_Visitor::getInstance()->hasPermission('adv_xenforo', 'adv_xenforo_enable_adv') ? TRUE : FALSE;
         if ($hookName == 'account_preferences_options' && $PermissionEnable) {
             $ourTemplate = $template->create('adv_xenforo_account_options', $template->getparams());
             $rendered = $ourTemplate->render();
             $contents = $contents . $rendered;
         }
         $hasPermission = XenForo_Visitor::getInstance()->hasPermission('adv_xenforo', 'adv_xenforo_show') ? TRUE : FALSE;
         $advs = XenForo_Application::getSimpleCacheData('adv_xenforo');
         $user = XenForo_Visitor::getInstance()->toArray();
         $enable_adv = $PermissionEnable === TRUE ? $user['enable_adv'] : TRUE;
         $containerData = self::$containerData;
         if (empty(self::$containerData)) {
             $containerData = XenForo_Template_Public::getExtraContainerData();
         }
         if ($enable_adv) {
             if ($hasPermission === TRUE && $advs["AdvsHook"]) {
                 $isMobile = XenForo_Visitor::isBrowsingWith('mobile');
                 switch (TRUE) {
                     case $isMobile == TRUE:
                         $adv_adv = 'adv_small';
                         break;
                     default:
                         $adv_adv = 'adv_large';
                         break;
                 }
                 foreach ($advs["AdvsHook"] as $_asv) {
                     if ($_asv['active'] && XenForo_Helper_Criteria::userMatchesCriteria($_asv['user_criteria'], TRUE, $user) && XenForo_Helper_Criteria::pageMatchesCriteria($_asv['page_criteria'], TRUE, $template->getParams(), $containerData)) {
                         $ourTemplate = $template->create('ads_xf_ar_xenforo', array('advanced' => $_asv[$adv_adv]));
                         $rendered = $ourTemplate->render();
                         if ($hookName == 'message_content' && Turki_Adv_Helper_Criteria::postCriteria($_asv['post_criteria'], TRUE) === FALSE) {
                             if ($hookParams['message']['thread_id']) {
                                 $decode = XenForo_Helper_Criteria::prepareCriteriaForSelection($_asv['post_criteria']);
                                 $position = $decode['active']['page'] ? $hookParams['message']['position'] % $options->messagesPerPage : $hookParams['message']['position'];
                                 if ($position == $decode['active']['post_id'] - 1) {
                                     $contents = $decode['active']['position'] ? Turki_Adv_Helper_Helpers::advhtml($contents, $rendered) : $contents . $rendered;
                                 }
                             }
                         } else {
                             if ($hookName == $_asv['adv_hook_name'] && Turki_Adv_Helper_Criteria::postCriteria($_asv['post_criteria'], TRUE)) {
                                 $contents = $_asv['display'] == 'top' ? $rendered . $contents : $contents . $rendered;
                             }
                         }
                     }
                 }
             }
         }
         self::_templateHook($hookName, $contents, $hookParams, $template);
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:55,代码来源:Listener.php


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