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


PHP WCF::getTPL方法代码示例

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


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

示例1: __construct

 public function __construct($data, $boxname = "")
 {
     $this->TopData['templatename'] = "topthanksgivinguser";
     $this->getBoxStatus($data);
     $this->TopData['boxID'] = $data['boxID'];
     if (!defined('TOPTHANKSGIVINGUSER_COUNT_ACP')) {
         define('TOPTHANKSGIVINGUSER_COUNT_ACP', 10);
     }
     if (!defined('TOPTHANKSGIVINGUSER_TITLELENGTH_ACP')) {
         define('TOPTHANKSGIVINGUSER_TITLELENGTH_ACP', 28);
     }
     if (!defined('TOPTHANKSGIVINGUSER_SBCOLOR_ACP')) {
         define('TOPTHANKSGIVINGUSER_SBCOLOR_ACP', 2);
     }
     if (!defined('TOPTHANKSGIVINGUSER_HITS_ACP')) {
         define('TOPTHANKSGIVINGUSER_HITS_ACP', true);
     }
     $sql = "SELECT wcf.userID, wcf.username, wbb.thanks_got" . "\n  FROM wcf" . WCF_N . "_user wcf" . "\n  LEFT JOIN wbb" . WBB_N . "_user wbb ON (wbb.userid = wcf.userid)" . "\n WHERE wbb.thanks_got > 0" . "\n ORDER BY wbb.thanks_got DESC, wcf.username" . "\n LIMIT 0, " . TOPTHANKSGIVINGUSER_COUNT_ACP;
     $result = WBBCore::getDB()->sendQuery($sql);
     while ($row = WBBCore::getDB()->fetchArray($result)) {
         $plainUser = $row['username'];
         $row['thanks_got'] = StringUtil::formatInteger($row['thanks_got']);
         if (TOPTHANKSGIVINGUSER_TITLELENGTH_ACP != 0 && strlen($plainUser) > TOPTHANKSGIVINGUSER_TITLELENGTH_ACP) {
             $row['username'] = StringUtil::substring($plainUser, 0, TOPTHANKSGIVINGUSER_TITLELENGTH_ACP - 3) . '...';
         }
         $row['username'] = StringUtil::encodeHTML($row['username']);
         $this->TopData['thanksgivinguser'][] = $row;
     }
     WCF::getTPL()->assign('TOPTHANKSGIVINGUSER_SBCOLOR_ACP', intval(TOPTHANKSGIVINGUSER_SBCOLOR_ACP));
     WCF::getTPL()->assign('TOPTHANKSGIVINGUSER_HITS_ACP', TOPTHANKSGIVINGUSER_HITS_ACP);
 }
开发者ID:Maggan22,项目名称:wbb3addons,代码行数:31,代码来源:TopThanksgivingUser.class.php

示例2: execute

 /**
  * @see EventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     if (MODULE_USERS_ONLINE == 1) {
         if ($eventObj->activeCategory == 'profile') {
             if ($eventName == 'validate') {
                 if (WCF::getUser()->getPermission('user.profile.rank.canSelectOnlineMarking')) {
                     if (isset($_POST['userOnlineGroupID'])) {
                         $this->userOnlineGroupID = intval($_POST['userOnlineGroupID']);
                     }
                     // validate user online group id
                     if ($this->userOnlineGroupID) {
                         try {
                             $sql = "SELECT\t\tgroupID\n\t\t\t\t\t\t\t\t\tFROM\t\twcf" . WCF_N . "_group\n\t\t\t\t\t\t\t\t\tWHERE\t\tgroupID = " . $this->userOnlineGroupID . "\n\t\t\t\t\t\t\t\t\t\t\tAND groupID IN (" . implode(',', WCF::getUser()->getGroupIDs()) . ")";
                             $row = WCF::getDB()->getFirstRow($sql);
                             if (!isset($row['groupID'])) {
                                 throw new UserInputException('userOnlineGroupID');
                             }
                             // save rankid
                             $eventObj->additionalFields['userOnlineGroupID'] = $this->userOnlineGroupID;
                         } catch (UserInputException $e) {
                             $eventObj->errorType[$e->getField()] = $e->getType();
                         }
                     }
                 }
             } else {
                 if ($eventName == 'assignVariables') {
                     if (!count($_POST)) {
                         // get current values
                         $this->userOnlineGroupID = WCF::getUser()->userOnlineGroupID;
                     }
                     $fields = array();
                     // get user online markings
                     if (WCF::getUser()->getPermission('user.profile.rank.canSelectOnlineMarking')) {
                         $markings = array();
                         $sql = "SELECT\t\tgroupID, groupName, userOnlineMarking\n\t\t\t\t\t\t\tFROM\t\twcf" . WCF_N . "_group\n\t\t\t\t\t\t\tWHERE\t\tgroupID IN (" . implode(',', WCF::getUser()->getGroupIDs()) . ")\n\t\t\t\t\t\t\tORDER BY\tgroupID ASC";
                         $result = WCF::getDB()->sendQuery($sql);
                         while ($row = WCF::getDB()->fetchArray($result)) {
                             $row['userOnlineMarking'] = sprintf($row['userOnlineMarking'], StringUtil::encodeHTML(WCF::getUser()->username));
                             $markings[] = $row;
                         }
                         if (count($markings) > 1) {
                             WCF::getTPL()->assign(array('markings' => $markings, 'userOnlineGroupID' => $this->userOnlineGroupID));
                             $fields[] = array('optionName' => 'userOnlineGroupID', 'divClass' => 'formRadio', 'beforeLabel' => false, 'isOptionGroup' => true, 'html' => WCF::getTPL()->fetch('userProfileEditOnlineMarkingSelect'));
                         }
                     }
                     // add fields
                     if (count($fields) > 0) {
                         foreach ($eventObj->options as $key => $category) {
                             if ($category['categoryName'] == 'profile.rank') {
                                 $eventObj->options[$key]['options'] = array_merge($category['options'], $fields);
                                 return;
                             }
                         }
                         $eventObj->options[] = array('categoryName' => 'profile.rank', 'categoryIconM' => '', 'options' => $fields);
                     }
                 }
             }
         }
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:63,代码来源:UserProfileEditFormOnlineMarkingListener.class.php

示例3: execute

 /**
  * @see EventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     if ($eventName == 'assignVariables') {
         WCF::getTPL()->assign(array('user' => $eventObj->user, 'url' => $eventObj->url));
         WCF::getTPL()->append('additionalUserOptions', WCF::getTPL()->fetch('userEditAdvancedUserOptions'));
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:10,代码来源:UserEditFormAdvancedUserOptionsListener.class.php

示例4: __construct

 public function __construct($data, $boxname = "")
 {
     $this->BoardlistData['templatename'] = "listboards";
     $this->getBoxStatus($data);
     $this->BoardlistData['boxID'] = $data['boxID'];
     // DEFAULTS
     $lbLength = 24;
     $lbLevelCut = 3;
     $lbMaxHeight = 0;
     $lbSBColor = 2;
     $lbFontsize = '1.2em';
     $lbSpacer = 5;
     $lbIndent = ' » ';
     $lbIndentNewPosts = '<span style="font-weight:bold; color:Red;">&nbsp;&raquo;&nbsp;</span>';
     $lbShowNewPosts = true;
     // ACP Konstanten...
     if (!defined('LISTBOARDS_LENGTH_ACP')) {
         define('LISTBOARDS_LENGTH_ACP', $lbLength);
     }
     if (!defined('LISTBOARDS_LEVELCUT_ACP')) {
         define('LISTBOARDS_LEVELCUT_ACP', $lbLevelCut);
     }
     if (!defined('LISTBOARDS_MAXHEIGHT_ACP')) {
         define('LISTBOARDS_MAXHEIGHT_ACP', $lbMaxHeight);
     }
     if (!defined('LISTBOARDSBOX_SBCOLOR_ACP')) {
         define('LISTBOARDSBOX_SBCOLOR_ACP', $lbSBColor);
     }
     if (!defined('LISTBOARDS_MAINBOARD_FONTSIZE_ACP')) {
         define('LISTBOARDS_MAINBOARD_FONTSIZE_ACP', $lbFontsize);
     }
     if (!defined('LISTBOARDS_MAINBOARD_SPACER_ACP')) {
         define('LISTBOARDS_MAINBOARD_SPACER_ACP', $lbSpacer);
     }
     if (!defined('LISTBOARDS_SUBBOARD_INDENT_ACP')) {
         define('LISTBOARDS_SUBBOARD_INDENT_ACP', $lbIndent);
     }
     if (!defined('LISTBOARDS_NEWPOST_INDENT_ACP')) {
         define('LISTBOARDS_NEWPOST_INDENT_ACP', $lbIndentNewPosts);
     }
     if (!defined('LISTBOARDS_SHOW_NEWPOSTS_ACP')) {
         define('LISTBOARDS_SHOW_NEWPOSTS_ACP', $lbShowNewPosts);
     }
     // Boxen Hoehe
     if (WCF::getUser()->userID) {
         if (WCF::getUser()->listboards_maxheight >= 100) {
             $lbMaxHeight = intval(WCF::getUser()->listboards_maxheight);
         } else {
             if (WCF::getUser()->listboards_maxheight == 0 && LISTBOARDS_MAXHEIGHT_ACP >= 100) {
                 $lbMaxHeight = LISTBOARDS_MAXHEIGHT_ACP;
             }
         }
     }
     // Template Variablen zuordnen...
     WCF::getTPL()->assign(array('lbFontsize' => LISTBOARDS_MAINBOARD_FONTSIZE_ACP == '' ? $lbFontsize : LISTBOARDS_MAINBOARD_FONTSIZE_ACP, 'lbSpacer' => intval(LISTBOARDS_MAINBOARD_SPACER_ACP), 'lbIndent' => LISTBOARDS_SUBBOARD_INDENT_ACP, 'lbIndentNewPosts' => LISTBOARDS_NEWPOST_INDENT_ACP, 'lbSBColor' => intval(LISTBOARDSBOX_SBCOLOR_ACP), 'lbLength' => intval(LISTBOARDS_LENGTH_ACP), 'lbLevelCut' => intval(LISTBOARDS_LEVELCUT_ACP), 'lbShowNewPosts' => LISTBOARDS_SHOW_NEWPOSTS_ACP, 'lbMaxHeight' => $lbMaxHeight));
     // Forenliste
     require_once WBB_DIR . 'lib/data/board/BoardList.class.php';
     $boardList = new BoardList();
     $boardList->renderBoards();
 }
开发者ID:Maggan22,项目名称:wbb3addons,代码行数:60,代码来源:ListBoardsBox.class.php

示例5: execute

    /**
     * @see EventListener::execute()
     */
    public function execute($eventObj, $className, $eventName)
    {
        if ($eventName == 'init') {
            $eventObj->sqlSelects .= 'wbb_user.posts,';
            $eventObj->sqlJoins .= ' LEFT JOIN wbb' . WBB_N . '_user wbb_user
						ON (wbb_user.userID = user.userID) ';
        } else {
            if ($eventName == 'assignVariables') {
                $user = $eventObj->frame->getUser();
                $eventObj->generalInformation[] = array('icon' => StyleManager::getStyle()->getIconPath('postM.png'), 'title' => WCF::getLanguage()->get('wcf.user.posts'), 'value' => '<a href="index.php?form=Search&amp;types[]=post&amp;userID=' . $user->userID . SID_ARG_2ND . '" title="' . WCF::getLanguage()->get('wcf.user.profile.search', array('$username' => StringUtil::encodeHTML($user->username))) . '">' . StringUtil::formatInteger(intval($user->posts)) . ($user->getProfileAge() > 1 ? ' ' . WCF::getLanguage()->get('wcf.user.postsPerDay', array('$posts' => StringUtil::formatDouble($user->posts / $user->getProfileAge()))) : '') . '</a>');
                // show last 5 posts
                if (PROFILE_SHOW_LAST_POSTS) {
                    require_once WBB_DIR . 'lib/data/post/ViewablePost.class.php';
                    require_once WBB_DIR . 'lib/data/board/Board.class.php';
                    $boardIDArray = Board::getAccessibleBoardIDArray(array('canViewBoard', 'canEnterBoard', 'canReadThread'));
                    if (count($boardIDArray)) {
                        $posts = array();
                        $sql = "SELECT\t\tpost.postID, post.time,\n\t\t\t\t\t\t\t\tCASE WHEN post.subject <> '' THEN post.subject ELSE thread.topic END AS subject\n\t\t\t\t\t\tFROM\t\twbb" . WBB_N . "_user_last_post user_last_post\n\t\t\t\t\t\tLEFT JOIN\twbb" . WBB_N . "_post post\n\t\t\t\t\t\tON\t\t(post.postID = user_last_post.postID)\n\t\t\t\t\t\tLEFT JOIN\twbb" . WBB_N . "_thread thread\n\t\t\t\t\t\tON\t\t(thread.threadID = post.threadID)\n\t\t\t\t\t\tWHERE\t\tuser_last_post.userID = " . $user->userID . "\n\t\t\t\t\t\t\t\tAND post.isDeleted = 0\n\t\t\t\t\t\t\t\tAND post.isDisabled = 0\n\t\t\t\t\t\t\t\tAND thread.boardID IN (" . implode(',', $boardIDArray) . ")\n\t\t\t\t\t\t\t\t" . (count(WCF::getSession()->getVisibleLanguageIDArray()) ? "AND thread.languageID IN (" . implode(',', WCF::getSession()->getVisibleLanguageIDArray()) . ")" : "") . "\n\t\t\t\t\t\tORDER BY\tuser_last_post.time DESC";
                        $result = WCF::getDB()->sendQuery($sql, 5);
                        while ($row = WCF::getDB()->fetchArray($result)) {
                            $posts[] = new ViewablePost(null, $row);
                        }
                        if (count($posts)) {
                            WCF::getTPL()->assign(array('posts' => $posts, 'user' => $user));
                            WCF::getTPL()->append('additionalContent2', WCF::getTPL()->fetch('userProfileLastPosts'));
                        }
                    }
                }
            }
        }
    }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:34,代码来源:UserPagePostsListener.class.php

示例6: install

 /**
  * Installs the templates of this package.
  */
 public function install()
 {
     parent::install();
     // extract files.tar to temp folder
     $tag = $this->installation->getXMLTag('templates');
     $sourceFile = $this->installation->getArchive()->extractTar($tag['cdata'], 'templates_');
     // create file handler
     $fileHandler = new TemplatesFileHandler($this->installation);
     // extract content of files.tar
     $packageDir = FileUtil::addTrailingSlash(FileUtil::getRealPath(WCF_DIR . $this->installation->getPackage()->getDir()));
     try {
         $fileInstaller = $this->installation->extractFiles($packageDir . 'templates/', $sourceFile, $fileHandler);
     } catch (SystemException $e) {
         if (!@file_exists(WCF_DIR . 'acp/templates/packageInstallationFileInstallationFailed.tpl')) {
             // workaround for wcf 1.0 to 1.1 update
             throw $e;
         } else {
             WCF::getTPL()->assign(array('exception' => $e));
             WCF::getTPL()->display('packageInstallationFileInstallationFailed');
             exit;
         }
     }
     // look if tpl files are to be overwritten by this update,
     // and if so, check if these files have been patched before ...
     require_once WCF_DIR . 'lib/acp/package/plugin/TemplatePatchPackageInstallationPlugin.class.php';
     $tar = new Tar($sourceFile);
     $files = $tar->getContentList();
     $templatePatch = new TemplatePatchPackageInstallationPlugin($this->installation);
     $templatePatch->repatch($files);
     // delete temporary sourceArchive
     @unlink($sourceFile);
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:35,代码来源:TemplatesPackageInstallationPlugin.class.php

示例7: execute

 public function execute($eventObj, $className, $eventName)
 {
     if (!defined('THREAD_SHOW_CLOSED_MESSAGE_ALL')) {
         define('THREAD_SHOW_CLOSED_MESSAGE_ALL', false);
     }
     if (isset($eventObj->thread) && $eventObj->thread->isDeleted == 1) {
         WCF::getTPL()->append('userMessages', '<p class="error">' . WCF::getLanguage()->get('wbb.thread.inactiveTopic.deleted') . '</p>');
     } else {
         if (isset($eventObj->thread) && $eventObj->thread->isDisabled == 1) {
             WCF::getTPL()->append('userMessages', '<p class="warning">' . WCF::getLanguage()->get('wbb.thread.inactiveTopic.disabled') . '</p>');
         } else {
             if (isset($eventObj->thread) && $eventObj->thread->isClosed == 1 && (WCF::getUser()->getPermission('mod.board.canReplyClosedThread') || THREAD_SHOW_CLOSED_MESSAGE_ALL)) {
                 WCF::getTPL()->append('userMessages', '<p class="warning">' . WCF::getLanguage()->get('wbb.thread.inactiveTopic.closed') . '</p>');
             } else {
                 if (isset($eventObj->post) && $eventObj->post->isDeleted == 1) {
                     WCF::getTPL()->append('userMessages', '<p class="error">' . WCF::getLanguage()->get('wbb.thread.inactiveTopic.deleted') . '</p>');
                 } else {
                     if (isset($eventObj->post) && $eventObj->post->isDisabled == 1) {
                         WCF::getTPL()->append('userMessages', '<p class="warning">' . WCF::getLanguage()->get('wbb.thread.inactiveTopic.disabled') . '</p>');
                     } else {
                         if (isset($eventObj->post) && $eventObj->post->isClosed == 1 && (WCF::getUser()->getPermission('mod.board.canReplyClosedThread') || THREAD_SHOW_CLOSED_MESSAGE_ALL)) {
                             WCF::getTPL()->append('userMessages', '<p class="warning">' . WCF::getLanguage()->get('wbb.thread.inactiveTopic.closed') . '</p>');
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:Maggan22,项目名称:wbb3addons,代码行数:29,代码来源:InactiveTopicInfoListener.class.php

示例8: execute

 /**
  * @see EventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     if ($eventName == 'readData') {
         if ($eventObj->action == 'notActivated') {
             if (!empty($eventObj->sqlConditions)) {
                 $this->sqlConditions .= ' AND ';
             }
             $eventObj->sqlConditions .= "user_table.activationCode <> 0";
         } else {
             if ($eventObj->action == 'new') {
                 if (!empty($eventObj->sqlConditions)) {
                     $this->sqlConditions .= ' AND ';
                 }
                 $eventObj->sqlConditions .= "user_table.registrationDate > " . (TIME_NOW - 3600 * 24);
             } else {
                 if ($eventObj->action == 'banned') {
                     if (!empty($eventObj->sqlConditions)) {
                         $this->sqlConditions .= ' AND ';
                     }
                     $eventObj->sqlConditions .= "user_table.banned = 1";
                 }
             }
         }
     }
     if ($eventName == 'assignVariables') {
         WCF::getTPL()->assign('action', $eventObj->action);
         WCF::getTPL()->append('additionalUserListOptions', WCF::getTPL()->fetch('userSearchUserListOptions'));
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:32,代码来源:UserListPageUserListOptionsListener.class.php

示例9: assignVariables

 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // get phpinfo() output
     ob_start();
     phpinfo();
     $info = ob_get_contents();
     ob_end_clean();
     // parse output
     $info = preg_replace('%^.*<body>(.*)</body>.*$%s', '$1', $info);
     // style fixes
     // remove first table
     $info = preg_replace('%<table.*?</table><br />%s', '', $info, 1);
     // fix tables
     $info = preg_replace('%<h2>(.*?)</h2>\\s*<table border="0" cellpadding="3" width="600">%', '<div class="border titleBarPanel"><div class="containerHead"><h3>\\1</h3></div></div><div class="border borderMarginRemove"><table class="tableList">', $info);
     $info = preg_replace('%<table border="0" cellpadding="3" width="600">%', '<div class="border titleBarPanel"><table class="tableList">', $info);
     $info = str_replace('</table>', '</table></div>', $info);
     $info = str_replace('<tr class="h">', '<thead><tr class="tableHead">', $info);
     $info = str_replace('</th></tr>', '</th></tr></thead>', $info);
     $info = preg_replace('%</td></tr>%', '</th></tr></thead>', $info, 1);
     $info = str_replace('<tr class="tableHead"><td>', '<tr class="tableHead"><th>', $info);
     $info = preg_replace('%<th(\\s+.*?)?>%', '<th\\1><div><span class="emptyHead">', $info);
     $info = str_replace('</th>', '</span></div></th>', $info);
     // fix row colors
     $info = preg_replace_callback('%<tr>%', array($this, 'insertRowColorsCallback'), $info);
     // h1, h2 fixes
     $info = str_replace('</h2>', '</h3>', $info);
     $info = str_replace('<h2>', '<h3>', $info);
     $info = str_replace('</h1>', '</h2>', $info);
     $info = str_replace('<h1', '<h2', $info);
     WCF::getTPL()->assign(array('phpInfo' => $info));
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:35,代码来源:PHPInfoPage.class.php

示例10: execute

 /**
  * @see EventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     if ($eventObj->poll->messageType == 'post') {
         // check permissions
         require_once WBB_DIR . 'lib/data/post/Post.class.php';
         $post = new Post($eventObj->poll->messageID);
         if (!$post->postID) {
             throw new IllegalLinkException();
         }
         require_once WBB_DIR . 'lib/data/thread/Thread.class.php';
         $thread = new Thread($post->threadID);
         $thread->enter();
         require_once WBB_DIR . 'lib/data/board/Board.class.php';
         $board = new Board($thread->boardID);
         $eventObj->canVotePoll = $board->getPermission('canVotePoll');
         // plug in breadcrumbs
         WCF::getTPL()->assign(array('board' => $board, 'thread' => $thread, 'showThread' => true));
         WCF::getTPL()->append('specialBreadCrumbs', WCF::getTPL()->fetch('navigation'));
         // get other polls from this thread
         if ($thread->polls > 1) {
             require_once WCF_DIR . 'lib/data/message/poll/Poll.class.php';
             $polls = array();
             $sql = "SELECT \t\tpoll_vote.pollID AS voted,\n\t\t\t\t\t\t\tpoll_vote.isChangeable,\n\t\t\t\t\t\t\tpoll.*\n\t\t\t\t\tFROM \t\twcf" . WCF_N . "_poll poll\n\t\t\t\t\tLEFT JOIN \twcf" . WCF_N . "_poll_vote poll_vote\n\t\t\t\t\tON \t\t(poll_vote.pollID = poll.pollID\n\t\t\t\t\t\t\t" . (!WCF::getUser()->userID ? "AND poll_vote.ipAddress = '" . escapeString(WCF::getSession()->ipAddress) . "'" : '') . "\n\t\t\t\t\t\t\tAND poll_vote.userID = " . WCF::getUser()->userID . ")\n\t\t\t\t\tWHERE \t\tpoll.pollID IN (\n\t\t\t\t\t\t\t\tSELECT\tpollID\n\t\t\t\t\t\t\t\tFROM\twbb" . WBB_N . "_post\n\t\t\t\t\t\t\t\tWHERE\tthreadID = " . $thread->threadID . "\n\t\t\t\t\t\t\t\t\tAND isDeleted = 0\n\t\t\t\t\t\t\t\t\tAND isDisabled = 0\n\t\t\t\t\t\t\t\t\tAND pollID <> 0\n\t\t\t\t\t\t\t)\n\t\t\t\t\tORDER BY\tpoll.question";
             $result = WCF::getDB()->sendQuery($sql);
             while ($row = WCF::getDB()->fetchArray($result)) {
                 $polls[] = new Poll(null, $row, $eventObj->canVotePoll);
             }
             if (count($polls) > 1) {
                 WCF::getTPL()->assign(array('polls' => $polls, 'pollID' => $eventObj->pollID));
                 WCF::getTPL()->append('additionalSidebarContent', WCF::getTPL()->fetch('pollOverviewSidebar'));
             }
         }
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:37,代码来源:PollOverviewPagePostsListener.class.php

示例11: execute

 /**
  * @see EventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     if ($eventName == 'readParameters') {
         // read parameters
         if (isset($_REQUEST['boardID'])) {
             $this->boardID = intval($_REQUEST['boardID']);
         }
         if (isset($_REQUEST['threadID'])) {
             $this->threadID = intval($_REQUEST['threadID']);
         }
         // append sql condition
         if ($this->threadID) {
             $eventObj->usersOnlineSortedList->sqlConditions .= " AND session.threadID = " . $this->threadID . " ";
         } else {
             if ($this->boardID) {
                 $eventObj->usersOnlineSortedList->sqlConditions .= " AND session.boardID = " . $this->boardID . " ";
             }
         }
     } else {
         if ($eventName == 'assignVariables') {
             if ($this->threadID) {
                 WCF::getTPL()->append('additionalParameters', '&amp;threadID=' . $this->threadID);
             } else {
                 if ($this->boardID) {
                     WCF::getTPL()->append('additionalParameters', '&amp;boardID=' . $this->boardID);
                 }
             }
         }
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:33,代码来源:UsersOnlinePageParameterListener.class.php

示例12: execute

 /**
  * @see Action::execute()
  */
 public function execute()
 {
     AbstractAction::execute();
     // check permission
     WCF::getUser()->checkPermission('admin.user.canBanUser');
     if (count($this->userIDs) > 0) {
         // check permission
         $sql = "SELECT\tDISTINCT groupID\n\t\t\t\tFROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\tWHERE\tuserID IN (" . implode(',', $this->userIDs) . ")";
         $result = WCF::getDB()->sendQuery($sql);
         while ($row = WCF::getDB()->fetchArray($result)) {
             if (!Group::isAccessibleGroup($row['groupID'])) {
                 throw new PermissionDeniedException();
             }
         }
         // update user
         $sql = "UPDATE\twcf" . WCF_N . "_user\n\t\t\t\tSET\tbanned = 0\n\t\t\t\tWHERE\tuserID IN (" . implode(',', $this->userIDs) . ")";
         WCF::getDB()->sendQuery($sql);
         // unmark users
         UserEditor::unmarkAll();
         // reset sessions
         Session::resetSessions($this->userIDs);
     }
     $this->executed();
     if (!empty($this->url)) {
         HeaderUtil::redirect($this->url);
     } else {
         // set active menu item
         WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.user.management');
         // show succes message
         WCF::getTPL()->assign('message', 'wcf.acp.user.unban.success');
         WCF::getTPL()->display('success');
     }
     exit;
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:37,代码来源:UserUnbanAction.class.php

示例13: execute

 /**
  * @see EventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     if ($eventName == 'readFormParameters') {
         if (isset($_POST['usedQuotes']) && is_array($_POST['usedQuotes'])) {
             $this->usedQuotes = $_POST['usedQuotes'];
         }
     } else {
         if ($eventName == 'saved') {
             if (count($this->usedQuotes) > 0) {
                 require_once WCF_DIR . 'lib/data/message/multiQuote/MultiQuoteManager.class.php';
                 foreach ($this->usedQuotes as $quoteID) {
                     MultiQuoteManager::removeQuote($quoteID);
                 }
                 MultiQuoteManager::saveStorage();
             }
         } else {
             if ($eventName == 'assignVariables') {
                 require_once WCF_DIR . 'lib/data/message/multiQuote/MultiQuoteManager.class.php';
                 $quotes = MultiQuoteManager::getStorage();
                 $usedQuotes = array_flip($this->usedQuotes);
                 foreach ($quotes as $quoteID => $quote) {
                     $quote['used'] = isset($usedQuotes[$quoteID]) ? 1 : 0;
                     $quotes[$quoteID] = $quote;
                 }
                 WCF::getTPL()->assign('quotes', $quotes);
                 WCF::getTPL()->append(array('additionalTabs' => '<li id="multiQuoteTab"><a onclick="tabbedPane.openTab(\'multiQuote\');"><span>' . WCF::getLanguage()->get('wcf.multiQuote.title') . '</span></a></li>', 'additionalSubTabs' => WCF::getTPL()->fetch('messageFormMultiQuote')));
             }
         }
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:33,代码来源:MessageFormMultiQuoteListener.class.php

示例14: execute

 /**
  * @see EventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     if (MODULE_TEAM_LIST) {
         if ($eventName == 'readFormParameters') {
             if (isset($_POST['showOnTeamPage'])) {
                 $this->showOnTeamPage = intval($_POST['showOnTeamPage']);
             }
             if (isset($_POST['teamPagePosition'])) {
                 $this->teamPagePosition = intval($_POST['teamPagePosition']);
             }
         } else {
             if ($eventName == 'save') {
                 $eventObj->additionalFields['showOnTeamPage'] = $this->showOnTeamPage;
                 $eventObj->additionalFields['teamPagePosition'] = $this->teamPagePosition;
                 if (!$eventObj instanceof GroupEditForm) {
                     $this->showOnTeamPage = $this->teamPagePosition = 0;
                 }
                 // clear cache
                 WCF::getCache()->clear(WCF_DIR . 'cache', 'cache.teamCount.php');
             } else {
                 if ($eventName == 'assignVariables') {
                     if (!count($_POST) && $eventObj instanceof GroupEditForm) {
                         $this->showOnTeamPage = $eventObj->group->showOnTeamPage;
                         $this->teamPagePosition = $eventObj->group->teamPagePosition;
                     }
                     WCF::getTPL()->assign(array('showOnTeamPage' => $this->showOnTeamPage, 'teamPagePosition' => $this->teamPagePosition));
                     WCF::getTPL()->append('additionalFields', WCF::getTPL()->fetch('groupAddShowOnTeamPage'));
                 }
             }
         }
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:35,代码来源:GroupAddFormShowOnTeamPageListener.class.php

示例15: execute

    /**
     * @see	EventListener::execute()
     */
    public function execute($eventObj, $className, $eventName)
    {
        WCF::getTPL()->append('additionalCSS', '
			<link rel="stylesheet" type="text/css" href="' . RELATIVE_WCF_DIR . 'style/containers.css" />
			<link rel="stylesheet" type="text/css" href="' . RELATIVE_WCF_DIR . 'style/forms.css" />
		');
    }
开发者ID:ZerGabriel,项目名称:PackageBuilder,代码行数:10,代码来源:UserLoginFormListener.class.php


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