本文整理汇总了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);
}
}