本文整理汇总了PHP中XenForo_Template_Abstract::setParam方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Template_Abstract::setParam方法的具体用法?PHP XenForo_Template_Abstract::setParam怎么用?PHP XenForo_Template_Abstract::setParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Template_Abstract
的用法示例。
在下文中一共展示了XenForo_Template_Abstract::setParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
$visitor = XenForo_Visitor::getInstance();
if (XenForo_Permission::hasPermission($visitor['permissions'], 'moturdrn_gw2api', 'verified')) {
require_once "library/Moturdrn/TS3GW2Auth/Includes/TeamSpeak3/ts3admin.class.php";
$tsAdmin = new ts3admin(XenForo_Application::getOptions()->ts3gw2auth_ts3server, XenForo_Application::getOptions()->ts3gw2auth_ts3sqport);
if ($tsAdmin->getElement('success', $tsAdmin->connect())) {
$tsAdmin->login(XenForo_Application::getOptions()->ts3gw2auth_ts3username, XenForo_Application::getOptions()->ts3gw2auth_ts3password);
$tsAdmin->selectServer(XenForo_Application::getOptions()->ts3gw2auth_ts3port);
}
$ts3server = array();
$serverinfo = $tsAdmin->serverInfo();
$ts3server['server_name'] = $serverinfo['data']['virtualserver_name'];
$ts3server['connected_clients'] = $serverinfo['data']['virtualserver_clientsonline'];
$channellist = $tsAdmin->channelList("-topic -flags -voice -limits -icon");
$clientlist = $tsAdmin->clientList("-uid -away -voice -times -groups -info -country -icon -ip -badges");
foreach ($channellist['data'] as $channelInfo) {
$ts3server['channellist'][$channelInfo['cid']] = $channelInfo;
}
foreach ($clientlist['data'] as $clientInfo) {
if ($clientInfo['client_type'] == 1) {
$this->subtractClient($ts3server['channellist'], $clientInfo['cid']);
} else {
$ts3server['clientlist'][] = $clientInfo;
}
}
$ts3server['channellist'] = $this->buildTree($ts3server['channellist']);
$ts3server['clientlist'] = $this->array_orderby($ts3server['clientlist'], 'client_talk_power', SORT_DESC, 'client_nickname', SORT_ASC);
$output = "";
foreach ($ts3server['channellist'] as $channel) {
$output .= $this->outputChannel($channel, $ts3server['clientlist']);
}
$tsOutput = <<<HTML
<b><a href="https://www.gunnars-hold.eu/resources/gunnars-hold-ts-information.10/" class='tschannellink'>* Connection & Server Details</a></b><br />
<b><a href='ts3server://ts3.gunnars-hold.eu/?port=9987' class='tschannellink'>* Or Click Here To Connect Now!</a></b><br /><br />
{$output}
HTML;
} else {
$tsOutput = 'You cannot view this item';
}
$renderTemplateObject->setParam('tsOutput', $tsOutput);
return $renderTemplateObject->render();
}
示例2: _render
/**
* Renders the widget.
* Add variables to the template obj: $renderTemplateObject->setParam('users', $users);
* @param array $widget
* @param string $positionCode
* @param array $params
* @param XenForo_Template_Abstract $renderTemplateObject
* @return string
*/
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
$carouselModel = $this->_getCarouselModel();
// Get posts and attachments.
$posts = $carouselModel->getThreadAndPostDataFromWidgetId($widget['widget_id'], 0);
$renderTemplateObject->setParam('posts', $posts);
$renderTemplateObject->setParam('widget_id', $widget['widget_id']);
return $renderTemplateObject->render();
}
示例3: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
$limit = XenForo_Application::getOptions()->get('xengalleryShowRecentComments', 'limit');
if (!empty($widget['options']['limit'])) {
$limit = $widget['options']['limit'];
}
$renderTemplateObject->setParam('limit', $limit);
$renderTemplateObject->setParam('title', $this->extraPrepareTitle($widget));
return $renderTemplateObject->render();
}
示例4: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
if ('forum_list' == $positionCode) {
$renderTemplateObject->setParam('boardTotals', $params['boardTotals']);
} else {
$core = WidgetFramework_Core::getInstance();
$boardTotals = $core->getModelFromCache('XenForo_Model_DataRegistry')->get('boardTotals');
if (!$boardTotals) {
$boardTotals = $core->getModelFromCache('XenForo_Model_Counters')->rebuildBoardTotalsCounter();
}
$renderTemplateObject->setParam('boardTotals', $boardTotals);
}
return $renderTemplateObject->render();
}
示例5: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
if ('forum_list' === $positionCode and !empty($params['onlineUsers'])) {
$renderTemplateObject->setParam('onlineUsers', $params['onlineUsers']);
} else {
if (empty($GLOBALS['WidgetFramework_onlineUsers'])) {
$visitor = XenForo_Visitor::getInstance();
$sessionModel = WidgetFramework_Core::getInstance()->getModelFromCache('XenForo_Model_Session');
$GLOBALS['WidgetFramework_onlineUsers'] = $sessionModel->getSessionActivityQuickList($visitor->toArray(), array('cutOff' => array('>', $sessionModel->getOnlineStatusTimeout())), $visitor['user_id'] ? $visitor->toArray() : null);
}
$renderTemplateObject->setParam('onlineUsers', $GLOBALS['WidgetFramework_onlineUsers']);
}
return $renderTemplateObject->render();
}
示例6: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
if ('forum_list' === $positionCode and !empty($params['onlineUsers']) and !empty($params['visitor'])) {
$renderTemplateObject->setParam('onlineUsers', $params['onlineUsers']);
$renderTemplateObject->setParam('visitor', $params['visitor']);
XenForo_Application::set(self::APPLICATION_KEY, $params['onlineUsers']);
} else {
$visitor = XenForo_Visitor::getInstance();
$onlineUsers = $this->_getOnlineUsers();
$renderTemplateObject->setParam('onlineUsers', $onlineUsers);
$renderTemplateObject->setParam('visitor', $visitor);
}
return $renderTemplateObject->render();
}
示例7: _render
/**
* Renders the widget.
* Add variables to the template obj: $renderTemplateObject->setParam('users', $users);
* @param array $widget
* @param string $positionCode
* @param array $params
* @param XenForo_Template_Abstract $renderTemplateObject
* @return string
*/
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
/* Widget Info */
$widgets = array();
/* Carousel Info */
if ($canEditCarousel = WidgetPortal_Helper_Permission_Carousel::canEditCarousel()) {
$widgetModel = $this->_getWidgetModel();
$widgets['carousel'] = $widgetModel->getAllFrontendEditableWidgets();
}
/* TODO add future editable widgets here */
/* Permissions */
$renderTemplateObject->setParam('canEditCarousel', $canEditCarousel);
$renderTemplateObject->setParam('widgets', $widgets);
return $renderTemplateObject->render();
}
示例8: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
$order = 'new';
if (!empty($widget['options']['order']) && in_array($widget['options']['order'], array('new', 'rand'), true)) {
$order = $widget['options']['order'];
}
$limit = XenForo_Application::getOptions()->get('xengalleryRecentMediaLimit');
if (!empty($widget['options']['limit'])) {
$limit = $widget['options']['limit'];
}
$renderTemplateObject->setParam('order', $order);
$renderTemplateObject->setParam('limit', $limit);
$renderTemplateObject->setParam('blockPhrase', $this->extraPrepareTitle($widget));
$renderTemplateObject->setParam('isSidebarBlock', strpos($positionCode, 'hook:') !== 0);
return $renderTemplateObject->render();
}
示例9: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $template)
{
$core = WidgetFramework_Core::getInstance();
/** @var Tinhte_XenTag_XenForo_Model_Tag $tagModel */
$tagModel = $core->getModelFromCache('XenForo_Model_Tag');
if (!empty($widget['options']['limit'])) {
$limit = $widget['options']['limit'];
} else {
$limit = XenForo_Application::getOptions()->get('tagCloud', 'count');
}
$tags = $tagModel->getTagsForCloud($limit);
$tagsLevels = $tagModel->getTagCloudLevels($tags);
$template->setParam('tags', $tags);
$template->setParam('tagsLevels', $tagsLevels);
return $template->render();
}
示例10: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
if (!XenForo_Visitor::getInstance()->hasPermission('modm_ajaxchat', 'ajax_chat_view')) {
return "";
}
/* @var $ajaxChatModel MODM_AJAXChat_Model_Chat */
$ajaxChatModel = XenForo_Model::create("MODM_AJAXChat_Model_Chat");
// Removes inactive users
$ajaxChatModel->checkAndRemoveInactive();
// Get online users for all accessible channels:
$channels = $ajaxChatModel->getChannels();
// Add the own private channel if allowed:
if ($ajaxChatModel->isAllowedToCreatePrivateChannel()) {
array_push($channels, $ajaxChat->getPrivateChannelID());
}
// Add the invitation channels:
foreach ($ajaxChatModel->getInvitations() as $channelID) {
if (!in_array($channelID, $channels)) {
array_push($channels, $channelID);
}
}
$userNames = $ajaxChatModel->getOnlineUsers($channels);
/* @var $userModel XenForo_Model_User */
$userModel = XenForo_Model::create("XenForo_Model_User");
$guestUsers = array();
$ajaxChat['onlineUsers'] = $userModel->getUsersByNames($userNames, array(), $guestUsers);
$ajaxChat['members'] = count($ajaxChat['onlineUsers']);
$ajaxChat['guests'] = XenForo_Application::getOptions()->get('modm_ajaxchat_options_allowguests') != "0" ? count($guestUsers) : null;
$ajaxChat['total'] = $ajaxChat['members'] + $ajaxChat['guests'];
$ajaxChat['limit'] = $ajaxChat['members'] < 10 ? $ajaxChat['members'] : 10;
$ajaxChat['recordsUnseen'] = $ajaxChat['members'] > $ajaxChat['limit'] ? true : false;
$renderTemplateObject->setParam('AjaxChat', $ajaxChat);
return $renderTemplateObject->render();
}
示例11: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
if (empty($widget['options']['limit'])) {
$widget['options']['limit'] = 5;
}
if (empty($widget['options']['order'])) {
$widget['options']['order'] = 'register_date';
}
if (empty($widget['options']['direction'])) {
$widget['options']['direction'] = 'DESC';
}
$users = false;
// try to be smart and get the users data if they happen to be available
if ($positionCode == 'member_list') {
if ($widget['options']['limit'] == 12 && $widget['options']['order'] == 'message_count' and !empty($params['activeUsers'])) {
$users = $params['activeUsers'];
}
if ($widget['options']['limit'] == 8 && $widget['options']['order'] == 'register_date' and !empty($params['latestUsers'])) {
$users = $params['latestUsers'];
}
}
if ($users === false) {
/** @var XenForo_Model_User $userModel */
$userModel = WidgetFramework_Core::getInstance()->getModelFromCache('XenForo_Model_User');
$conditions = array('user_state' => 'valid', 'is_banned' => 0);
$fetchOptions = array('limit' => $widget['options']['limit'], 'order' => $widget['options']['order'], 'direction' => $widget['options']['direction']);
$users = $userModel->getUsers($conditions, $fetchOptions);
}
$renderTemplateObject->setParam('users', $users);
return $renderTemplateObject->render();
}
示例12: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
$renderTemplateObject->setParams($params);
if (!isset($params['url'])) {
// try to detect the correct url for different templates
$autoDetectedUrl = false;
switch ($positionCode) {
case 'forum_list':
$autoDetectedUrl = XenForo_Link::buildPublicLink('canonical:forums');
break;
case 'forum_view':
$autoDetectedUrl = XenForo_Link::buildPublicLink('canonical:forums', $params['forum']);
break;
case 'member_view':
// this widget on member_view, seriously?
$autoDetectedUrl = XenForo_Link::buildPublicLink('canonical:members', $params['user']);
break;
case 'resource_author_view':
$autoDetectedUrl = XenForo_Link::buildPublicLink('canonical:resources/authors', $params['user']);
break;
case 'resource_view':
$autoDetectedUrl = XenForo_Link::buildPublicLink('canonical:resources', $params['resource']);
break;
case 'thread_view':
$autoDetectedUrl = XenForo_Link::buildPublicLink('canonical:threads', $params['thread']);
break;
}
if ($autoDetectedUrl !== false) {
$renderTemplateObject->setParam('url', $autoDetectedUrl);
}
}
return $renderTemplateObject->render();
}
示例13: _render
/**
* Required method: prepare data or whatever to get the render template ready to
* be rendered.
*
* @param array $widget
* @param string $positionCode
* @param array $params
* @param XenForo_Template_Abstract $renderTemplateObject
*/
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
$minecraftServerModel = $this->_getMinecraftServerModel();
//Get all active minecraft servers from the database
$minecraftServers = $minecraftServerModel->prepareMinecraftServers($minecraftServerModel->getAllActiveMinecraftServers());
$renderTemplateObject->setParam('minecraftServers', $minecraftServers);
return $renderTemplateObject->render();
}
示例14: _render
protected function _render(array $widget, $templateName, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
$userModel = WidgetFramework_Core::getInstance()->getModelFromCache('XenForo_Model_User');
$fetchOptions = array();
$users = $userModel->getTopUsers($widget['options']);
$renderTemplateObject->setParam('users', $users);
return $renderTemplateObject->render();
}
示例15: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
$options = XenForo_Application::get('options');
if ($options->dark_taigachat_sidebar) {
$taigamodel = XenForo_Model::create('Dark_TaigaChat_Model_TaigaChat');
$onlineUsersTaiga = $taigamodel->getActivityUserList();
$renderTemplateObject->setParam('taigachat', array('online' => $onlineUsersTaiga));
}
return $renderTemplateObject->render();
}