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


PHP XenForo_Template_Abstract::render方法代码示例

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


在下文中一共展示了XenForo_Template_Abstract::render方法的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();
    }
开发者ID:moturdrn,项目名称:TS3GW2Auth,代码行数:43,代码来源:Sidebar.php

示例2: _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();
 }
开发者ID:Sywooch,项目名称:forums,代码行数:34,代码来源:AjaxChatOnline.php

示例3: _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();
 }
开发者ID:maitandat1507,项目名称:bdWidgetFramework,代码行数:31,代码来源:Users.php

示例4: _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();
 }
开发者ID:Sywooch,项目名称:forums,代码行数:33,代码来源:ShareThisPage.php

示例5: render

 /**
  * Renders the specified template and returns the output.
  *
  * @return string
  */
 public function render()
 {
     if (!isset($this->_params['_styleId'])) {
         $this->_params['_styleId'] = self::$_styleId;
     }
     return parent::render();
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:12,代码来源:Public.php

示例6: _render

 protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
 {
     $mediaCloudModel = XenForo_Model::create('EWRmedio_Model_Keywords');
     //		$model = XenForo_Model::create('EWRporta_Model_Options');
     //		$option = $model->getOptionById('MediaCloud');
     $options = XenForo_Application::get('options');
     $sidebar['keywords'] = $mediaCloudModel->getKeywordCloud($options->EWRmedio_cloudcount, $options->EWRmedio_mincloud, $options->EWRmedio_maxcloud);
     if ($options->EWRmedio_animatedcloud && $sidebar['keywords']) {
         $sidebar['animated'] = $mediaCloudModel->getAnimatedCloud($sidebar['keywords']);
     }
     /*		$limit = $option['limit'];
     		$mincloud = $option['mincloud'];
     		$maxcloud = $option['maxcloud'];
     		$animated = $option['animated'];
     		
     		$cloud['keywords'] = $mediaCloudModel->getKeywordCloud($limit, $mincloud, $maxcloud);
     
     		if ($animated && $cloud['keywords'])
     		{
     			$cloud['animated'] = $mediaCloudModel->getAnimatedCloud($cloud['keywords']);
     		}*/
     $viewParams = array('MediaCloud' => $sidebar);
     $renderTemplateObject->setParams($viewParams);
     return $renderTemplateObject->render();
 }
开发者ID:Sywooch,项目名称:forums,代码行数:25,代码来源:MediaCloudWidget.php

示例7: _render

 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();
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:8,代码来源:Alt.php

示例8: _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();
 }
开发者ID:alexsatellite,项目名称:xenforo-minecraft-server-status,代码行数:17,代码来源:Status.php

示例9: _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();
 }
开发者ID:Sywooch,项目名称:forums,代码行数:8,代码来源:WidgetRenderer.php

示例10: _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();
 }
开发者ID:Sywooch,项目名称:forums,代码行数:18,代码来源:Carousel.php

示例11: _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();
 }
开发者ID:maitandat1507,项目名称:bdWidgetFramework,代码行数:10,代码来源:Comments.php

示例12: _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();
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:10,代码来源:Online.php

示例13: _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");
     $ajaxChat = $ajaxChatModel->getWidgetContent();
     $renderTemplateObject->setParam('AjaxChatShoutbox', $ajaxChat);
     return $renderTemplateObject->render();
 }
开发者ID:Sywooch,项目名称:forums,代码行数:11,代码来源:AjaxChatShoutbox.php

示例14: _render

 protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
 {
     $limit = XenForo_Application::getOptions()->get('xengalleryShowTopContributors', 'limit');
     if (!empty($widget['options']['limit'])) {
         $limit = $widget['options']['limit'];
     }
     /** @var XenGallery_Model_Media $mediaModel */
     $mediaModel = WidgetFramework_Core::getInstance()->getModelFromCache('XenGallery_Model_Media');
     $users = $mediaModel->getTopContributors($limit);
     $renderTemplateObject->setParam('users', $users);
     return $renderTemplateObject->render();
 }
开发者ID:maitandat1507,项目名称:bdWidgetFramework,代码行数:12,代码来源:Contributors.php

示例15: _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();
 }
开发者ID:Sywooch,项目名称:forums,代码行数:14,代码来源:OnlineStaff.php


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