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


PHP Board::getAccessibleBoards方法代码示例

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


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

示例1: __construct

 public function __construct($data, $boxname = "")
 {
     $this->TopData['templatename'] = "topthreads";
     $this->getBoxStatus($data);
     $this->TopData['boxID'] = $data['boxID'];
     if (!defined('TOPTHREADS_COUNT')) {
         define('TOPTHREADS_COUNT', 10);
     }
     if (!defined('TOPTHREADS_TITLELENGTH')) {
         define('TOPTHREADS_TITLELENGTH', 25);
     }
     if (!defined('TOPTHREADS_SBCOLOR_ACP')) {
         define('TOPTHREADS_SBCOLOR_ACP', 2);
     }
     require_once WBB_DIR . 'lib/data/board/Board.class.php';
     $boardIDs = Board::getAccessibleBoards();
     if (!empty($boardIDs)) {
         $sql = "SELECT thread.*" . "\n  FROM wbb" . WBB_N . "_thread thread" . "\n WHERE thread.boardID IN (0" . $boardIDs . ")" . "\n ORDER BY thread.replies DESC" . "\n LIMIT 0, " . TOPTHREADS_COUNT;
         $result = WBBCore::getDB()->sendQuery($sql);
         while ($row = WBBCore::getDB()->fetchArray($result)) {
             $row['replies'] = StringUtil::formatInteger($row['replies']);
             $row['title'] = StringUtil::encodeHTML($row['topic']) . ' - ' . $row['replies'];
             if (TOPTHREADS_TITLELENGTH != 0 && strlen($row['topic']) > TOPTHREADS_TITLELENGTH) {
                 $row['topic'] = StringUtil::substring($row['topic'], 0, TOPTHREADS_TITLELENGTH - 3) . '...';
             }
             $row['topic'] = StringUtil::encodeHTML($row['topic']);
             $this->TopData['threads'][] = $row;
         }
     }
 }
开发者ID:Maggan22,项目名称:wbb3addons,代码行数:30,代码来源:TopThreads.class.php

示例2: execute

 /**
  * @see EventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     if (empty(URLParser::$text)) {
         return;
     }
     // reset data
     $this->postIDToThreadID = $this->threads = array();
     $threadIDs = $postIDs = array();
     // get page urls
     $pageURLs = URLBBCode::getPageURLs();
     $pageURLs = '(?:' . implode('|', array_map(create_function('$a', 'return preg_quote($a, \'~\');'), $pageURLs)) . ')';
     // build search pattern
     $threadIDPattern = "~\\[url\\](" . $pageURLs . "/?" . $this->threadURLPattern . ".*?)\\[/url\\]~i";
     $postIDPattern = "~\\[url\\](" . $pageURLs . "/?" . $this->postURLPattern . ".*?)\\[/url\\]~i";
     // find thread ids
     if (preg_match_all($threadIDPattern, URLParser::$text, $matches)) {
         $threadIDs = $matches[2];
     }
     // find post ids
     if (preg_match_all($postIDPattern, URLParser::$text, $matches)) {
         $postIDs = $matches[2];
     }
     if (count($threadIDs) > 0 || count($postIDs) > 0) {
         // get thread ids
         if (count($postIDs)) {
             $sql = "SELECT\tpostID, threadID\n\t\t\t\t\tFROM \twbb" . WBB_N . "_post\n\t\t\t\t\tWHERE \tpostID IN (" . implode(",", $postIDs) . ")";
             $result = WCF::getDB()->sendQuery($sql);
             while ($row = WCF::getDB()->fetchArray($result)) {
                 $this->postIDToThreadID[$row['postID']] = $row['threadID'];
                 $threadIDs[] = $row['threadID'];
             }
         }
         // get accessible boards
         require_once WBB_DIR . 'lib/data/board/Board.class.php';
         $boardIDs = Board::getAccessibleBoards();
         if (empty($boardIDs)) {
             return;
         }
         // get topics and prefixes :)
         if (count($threadIDs)) {
             // remove duplicates
             $threadIDs = array_unique($threadIDs);
             $sql = "SELECT\tthreadID, prefix, topic\n\t\t\t\t\tFROM \twbb" . WBB_N . "_thread\n\t\t\t\t\tWHERE \tthreadID IN (" . implode(",", $threadIDs) . ")\n\t\t\t\t \t\tAND boardid IN (0" . $boardIDs . ")";
             $result = WCF::getDB()->sendQuery($sql);
             while ($row = WCF::getDB()->fetchArray($result)) {
                 $this->threads[$row['threadID']] = $row;
             }
         }
         if (count($this->threads) > 0) {
             // insert topics
             URLParser::$text = preg_replace_callback($threadIDPattern, array($this, 'buildThreadURLCallback'), URLParser::$text);
             URLParser::$text = preg_replace_callback($postIDPattern, array($this, 'buildPostURLCallback'), URLParser::$text);
         }
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:58,代码来源:URLParserThreadURLListener.class.php

示例3: readThreads

 /**
  * Gets threads.
  */
 protected function readThreads()
 {
     $this->threads = array();
     if (!count($this->cachedThreadIDs)) {
         return;
     }
     // get accessible boards
     $boardIDs = Board::getAccessibleBoards();
     if (empty($boardIDs)) {
         return;
     }
     $sql = "SELECT\tthreadID, topic\r\n\t\t\tFROM\twbb" . WBB_N . "_thread\r\n\t\t\tWHERE\tthreadID IN (" . implode(',', $this->cachedThreadIDs) . ")\r\n\t\t\t\tAND boardID IN (" . $boardIDs . ")\r\n\t\t\t\tAND isDeleted = 0\r\n\t\t\t\tAND isDisabled = 0";
     $result = WCF::getDB()->sendQuery($sql);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->threads[$row['threadID']] = $row['topic'];
     }
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:20,代码来源:ThreadLocation.class.php

示例4: readThreads

 /**
  * Gets threads.
  */
 protected function readThreads()
 {
     $this->threads = array();
     if (!count($this->cachedPostIDs)) {
         return;
     }
     // get accessible boards
     $boardIDs = Board::getAccessibleBoards();
     if (empty($boardIDs)) {
         return;
     }
     $sql = "SELECT\t\tpost.postID, thread.topic, thread.prefix\n\t\t\tFROM\t\twbb" . WBB_N . "_post post\n\t\t\tLEFT JOIN\twbb" . WBB_N . "_thread thread\n\t\t\tON\t\t(thread.threadID = post.threadID)\n\t\t\tWHERE\t\tpost.postID IN (" . implode(',', $this->cachedPostIDs) . ")\n\t\t\t\t\tAND post.isDeleted = 0\n\t\t\t\t\tAND post.isDisabled = 0\n\t\t\t\t\tAND thread.boardID IN (" . $boardIDs . ")\n\t\t\t\t\tAND thread.isDeleted = 0\n\t\t\t\t\tAND thread.isDisabled = 0";
     $result = WCF::getDB()->sendQuery($sql);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->threads[$row['postID']] = $row;
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:20,代码来源:PostLocation.class.php

示例5: readData

 /**
  * @see StandardPortalBox::readData()
  */
 public function readData()
 {
     $this->data['topics'] = array();
     $boardIDs = Board::getAccessibleBoards();
     if (!empty($boardIDs)) {
         $boardIDs = explode(',', $boardIDs);
         foreach ($this->cacheData as $key => $item) {
             if (isset($item['boardID']) && in_array($item['boardID'], $boardIDs)) {
                 $this->data['topics'][] = $item;
             }
         }
     }
     // save memory
     $this->cacheData = array();
     unset($boardIDs);
     if (!count($this->data['topics'])) {
         $this->empty = true;
     }
 }
开发者ID:Maggan22,项目名称:wbb3addons,代码行数:22,代码来源:StickyTopicsBox.class.php

示例6: __construct

 public function __construct($data, $boxname = "")
 {
     $this->threadLastPostsBoxData['templatename'] = "threadlastpostsbox";
     $this->getBoxStatus($data);
     $this->threadLastPostsBoxData['boxID'] = $data['boxID'];
     $cntPosts = 0;
     if (!defined('THREADLASTPOSTSBOX_THREADID')) {
         define('THREADLASTPOSTSBOX_THREADID', 0);
     }
     if (!defined('THREADLASTPOSTSBOX_LIMIT')) {
         define('THREADLASTPOSTSBOX_LIMIT', 10);
     }
     if (!defined('THREADLASTPOSTSBOX_TITLELENGTH')) {
         define('THREADLASTPOSTSBOX_TITLELENGTH', 28);
     }
     if (!defined('THREADLASTPOSTSBOX_SBCOLOR')) {
         define('THREADLASTPOSTSBOX_SBCOLOR', 2);
     }
     require_once WBB_DIR . 'lib/data/board/Board.class.php';
     $boardIDs = Board::getAccessibleBoards();
     if (!empty($boardIDs) && THREADLASTPOSTSBOX_THREADID) {
         $sql = "SELECT wp.postID, wp.threadID, wp.userID, wp.subject, wp.message, wp.time" . "\n  FROM wbb1_1_post wp" . "\n  JOIN wbb1_1_thread wt ON (wt.threadID = wp.threadID)" . "\n WHERE wp.threadID = " . THREADLASTPOSTSBOX_THREADID . "\n   AND wp.isDeleted = 0" . "\n   AND wp.isDisabled = 0" . "\n   AND wt.isDeleted = 0" . "\n   AND wt.isDisabled = 0" . "\n   AND wt.boardID IN (" . $boardIDs . ")" . "\n ORDER BY wp.postID DESC" . "\n  LIMIT 0, " . THREADLASTPOSTSBOX_LIMIT;
         $result = WBBCore::getDB()->sendQuery($sql);
         while ($row = WBBCore::getDB()->fetchArray($result)) {
             if (!empty($row['subject'])) {
                 $title = $row['subject'];
             } else {
                 $title = preg_replace('/\\[/', '<', $row['message']);
                 $title = preg_replace('/\\]/', '>', $title);
                 $title = strip_tags($title);
                 //StringUtil::stripHTML($title);
             }
             if (THREADLASTPOSTSBOX_TITLELENGTH != 0 && StringUtil::length($title) > THREADLASTPOSTSBOX_TITLELENGTH) {
                 $title = StringUtil::substring($title, 0, THREADLASTPOSTSBOX_TITLELENGTH - 3) . '...';
             }
             $row['title'] = StringUtil::encodeHTML($title);
             $this->threadLastPostsBoxData['box'][] = $row;
             $cntPosts++;
         }
     }
     WCF::getTPL()->assign(array('THREADLASTPOSTSBOX_SBCOLOR' => intval(THREADLASTPOSTSBOX_SBCOLOR), 'threadLastPostBoxCnt' => $cntPosts));
 }
开发者ID:Maggan22,项目名称:wbb3addons,代码行数:42,代码来源:ThreadLastPostsBox.class.php

示例7: getData

 /**
  * @see CacheBuilder::getData()
  */
 public function getData($cacheResource)
 {
     $data = array();
     $boardIDs = STICKYTOPICSBOX_BOARDIDS;
     $limit = STICKYTOPICSBOX_NUMOFENTRIES;
     $showClosed = STICKYTOPICSBOX_SHOWCLOSED;
     $sortField = STICKYTOPICSBOX_SORTFIELD;
     $permBoardIDs = Board::getAccessibleBoards();
     if (empty($boardIDs) || empty($permBoardIDs)) {
         return $data;
     }
     $sql = "SELECT *" . "\n  FROM wbb" . WBB_N . "_thread" . "\n WHERE isSticky = 1" . "\n   AND boardID IN(" . $boardIDs . ")" . "\n   AND boardID IN(" . $permBoardIDs . ")" . "\n   AND isDeleted = 0" . "\n   AND isDisabled = 0" . "\n   AND movedThreadID = 0";
     if (empty($showClosed)) {
         $sql .= "\n   AND isClosed = 0";
     }
     $sql .= " ORDER BY " . $sortField . " DESC" . "\n LIMIT " . $limit;
     $result = WBBCore::getDB()->sendQuery($sql);
     while ($row = WBBCore::getDB()->fetchArray($result)) {
         $data[] = $row;
     }
     return $data;
 }
开发者ID:Maggan22,项目名称:wbb3addons,代码行数:25,代码来源:CacheBuilderStickyTopicsBox.class.php

示例8: __construct

 public function __construct($data, $boxname = "")
 {
     $this->TopData['templatename'] = "topthanksgivingposts";
     $this->getBoxStatus($data);
     $this->TopData['boxID'] = $data['boxID'];
     if (!defined('TOPTHANKSGIVING_COUNT_ACP')) {
         define('TOPTHANKSGIVING_COUNT_ACP', 10);
     }
     if (!defined('TOPTHANKSGIVING_TITLELENGTH_ACP')) {
         define('TOPTHANKSGIVING_TITLELENGTH_ACP', 28);
     }
     if (!defined('TOPTHANKSGIVING_SBCOLOR_ACP')) {
         define('TOPTHANKSGIVING_SBCOLOR_ACP', 2);
     }
     if (!defined('TOPTHANKSGIVING_HITS_ACP')) {
         define('TOPTHANKSGIVING_HITS_ACP', true);
     }
     require_once WBB_DIR . 'lib/data/board/Board.class.php';
     $boardIDs = Board::getAccessibleBoards();
     if (!empty($boardIDs)) {
         $sql = "SELECT thread.topic AS subject, MIN(post.postID) AS postID, COUNT(*) AS cnt" . "\n  FROM wbb" . WBB_N . "_thread thread" . "\n  LEFT JOIN (wbb" . WBB_N . "_post post, wbb" . WBB_N . "_thank_guests tg, wbb" . WBB_N . "_thank_user tu)" . "\n  ON (post.threadID = thread.threadID AND (post.postID = tu.postID OR post.postID = tg.postID))" . "\n  WHERE thread.isDisabled = 0" . "\n  AND thread.isDeleted = 0" . "\n  AND thread.boardID IN (" . $boardIDs . ")" . "\n  AND post.isDeleted = 0" . "\n  AND post.isDisabled = 0" . "\n  GROUP BY thread.threadID" . "\n  ORDER BY cnt DESC" . "\n  LIMIT 0, " . TOPTHANKSGIVING_COUNT_ACP;
         $result = WBBCore::getDB()->sendQuery($sql);
         while ($row = WBBCore::getDB()->fetchArray($result)) {
             $plainSubject = $row['subject'];
             $row['thanks'] = StringUtil::formatInteger($row['cnt']);
             $row['title'] = StringUtil::encodeHTML($plainSubject) . ' - ' . $row['thanks'];
             if (TOPTHANKSGIVING_TITLELENGTH_ACP != 0 && strlen($plainSubject) > TOPTHANKSGIVING_TITLELENGTH_ACP) {
                 $row['subject'] = StringUtil::substring($plainSubject, 0, TOPTHANKSGIVING_TITLELENGTH_ACP - 3) . '...';
             }
             $row['subject'] = StringUtil::encodeHTML($row['subject']);
             $this->TopData['thanksgiving'][] = $row;
         }
     }
     WCF::getTPL()->assign('TOPTHANKSGIVING_SBCOLOR_ACP', intval(TOPTHANKSGIVING_SBCOLOR_ACP));
     WCF::getTPL()->assign('TOPTHANKSGIVING_HITS_ACP', TOPTHANKSGIVING_HITS_ACP);
 }
开发者ID:Maggan22,项目名称:wbb3addons,代码行数:36,代码来源:TopThanksgivingPosts.class.php

示例9: __construct


//.........这里部分代码省略.........
         } else {
             $bgColor = strtoupper(WBBCore::getStyle()->getVariable('container1.background.color'));
             $bgColor = preg_replace("/\\#/", "", $bgColor);
             if (strlen($bgColor) < 6 && strlen($bgColor) > 0) {
                 $bgColor = str_pad($bgColor, 6, substr($bgColor, -1, 1));
             }
         }
         // Rahmenfarbe fuer Donnerwetter...
         if (preg_match("/^[a-f0-9]{6}\$/i", PERSONALBOX_WEATHER_BOCOLOR_ACP)) {
             $boColor = strtoupper(PERSONALBOX_WEATHER_BOCOLOR_ACP);
         } else {
             $boColor = $bgColor;
         }
         // Textfarbe fuer Donnerwetter...
         if (preg_match("/^[a-f0-9]{6}\$/i", PERSONALBOX_WEATHER_TEXTCOLOR_ACP)) {
             $textColor = strtoupper(PERSONALBOX_WEATHER_TEXTCOLOR_ACP);
         } else {
             $textColor = strtoupper(WBBCore::getStyle()->getVariable('container1.font.color'));
             $textColor = preg_replace("/\\#/", "", $textColor);
             if (strlen($textColor) < 6 && strlen($textColor) > 0) {
                 $textColor = str_pad($textColor, 6, substr($textColor, -1, 1));
             }
         }
         // Standardfarben, falls bis hierhin keine zugeordnet...
         if (empty($bgColor)) {
             $bgColor = 'FFFFFF';
         }
         if (empty($boColor)) {
             $boColor = 'FFFFFF';
         }
         if (empty($textColor)) {
             $textColor = '000000';
         }
         $boardIDs = Board::getAccessibleBoards();
         $user = new UserProfile(WCF::getUser()->userID);
         // RANK
         if ($user->rankImage) {
             if (PERSONALBOX_REPEATRANKIMAGE_ACP && $user->repeatImage) {
                 $pbRankImage = '';
                 for ($i = 0; $i < $user->repeatImage; $i++) {
                     $pbRankImage .= '<img src="' . RELATIVE_WCF_DIR . $user->rankImage . '" alt="" title="' . WCF::getLanguage()->get($user->rankTitle) . '" />';
                 }
             } else {
                 $pbRankImage = '<img src="' . RELATIVE_WCF_DIR . $user->rankImage . '" alt="" title="' . WCF::getLanguage()->get($user->rankTitle) . '" />';
             }
         }
         $user->username = StringUtil::encodeHTML(WCF::getUser()->username);
         $user->searchTime = $searchTime;
         $user->bgColor = $bgColor;
         $user->boColor = $boColor;
         $user->textColor = $textColor;
         $user->posts = 0;
         $user->cntNewPosts = 0;
         $user->cntLastPosts = 0;
         $user->cntReported = 0;
         $user->cntSub = 0;
         if (WCF::getUser()->getPermission('user.profile.personalbox.cntOwnPosts')) {
             // Anzahl Postings...
             $sql = "SELECT wbu.posts" . "\n  FROM wbb" . WBB_N . "_user wbu" . "\n WHERE wbu.userid = " . WCF::getUser()->userID;
             $result = WBBCore::getDB()->getFirstRow($sql);
             $user->posts = StringUtil::formatInteger($result['posts']);
         }
         // Instant Messenger by Tatzelwurm
         if (INSTANTMESSENGER_AKTIV && (WCF::getUser()->getPermission('user.board.instantmessenger.canUseInstantMessenger') || WCF::getUser()->getPermission('user.instantmessenger.canUseInstantMessenger'))) {
             if (@(require_once WCF_DIR . 'lib/data/InstantMessage/IM.class.php')) {
                 if (WCF::getUser()->getPermission('user.profile.personalbox.canSetIM') && WCF::getUser()->personalbox_show_im == 'enabled') {
开发者ID:Maggan22,项目名称:wbb3addons,代码行数:67,代码来源:PersonalBox.class.php

示例10: clearSubscriptions

 /**
  * Removes inaccessible boards and threads from user subscriptions.
  */
 public static function clearSubscriptions()
 {
     $boardIDs = Board::getAccessibleBoards();
     // clear board subscriptions
     $sql = "DELETE FROM\twbb" . WBB_N . "_board_subscription\n\t\t\tWHERE\t\tuserID = " . WCF::getUser()->userID . "\n\t\t\t\t\t" . (!empty($boardIDs) ? "AND boardID NOT IN (" . $boardIDs . ")" : "");
     WCF::getDB()->sendQuery($sql);
     // clear thread subscriptions
     $sql = "DELETE FROM\twbb" . WBB_N . "_thread_subscription\n\t\t\tWHERE\t\tuserID = " . WCF::getUser()->userID . "\n\t\t\t\t\t" . (!empty($boardIDs) ? "AND threadID IN (\n\t\t\t\t\t\tSELECT\tthreadID\n\t\t\t\t\t\tFROM\twbb" . WBB_N . "_thread\n\t\t\t\t\t\tWHERE\tboardID NOT IN (" . $boardIDs . ")\n\t\t\t\t\t)" : "");
     WCF::getDB()->sendQuery($sql);
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:13,代码来源:SubscribedThread.class.php

示例11: __construct

 public function __construct($data, $boxname = "")
 {
     $this->spnrbData['templatename'] = "simplePieNewsreaderBox";
     $this->getBoxStatus($data);
     $this->spnrbData['boxID'] = $data['boxID'];
     if (SPNRBOX_BOXOPENED == true) {
         $this->spnrbData['Status'] = 1;
     }
     if (WBBCore::getUser()->getPermission('user.board.canViewSimplePieNewsreaderBox')) {
         require_once WBB_DIR . 'lib/data/boxes/SimplePieNewsReader/simplepie.inc';
         require_once WBB_DIR . 'lib/data/boxes/SimplePieNewsReader/idna_convert.class.php';
         // FILTER?
         if (SPNRBOX_FILTER && strlen(SPNRBOX_FILTERWORDS) >= 3) {
             require_once WBB_DIR . 'lib/data/boxes/SimplePieNewsReader/simplepie_filter.php';
             $feed = new SimplePie_Filter();
             if (!defined('SPNRBOX_FILTERCLASS')) {
                 define('SPNRBOX_FILTERCLASS', 'hightlight');
             }
             define('SPNRBOX_FILTERON', 1);
         } else {
             $feed = new SimplePie();
             define('SPNRBOX_FILTERON', 0);
         }
         // CACHE
         if (SPNRBOX_CACHEMAX != 0 && SPNRBOX_CACHEMIN != 0) {
             $feed->set_autodiscovery_cache_duration(SPNRBOX_CACHEMAX);
             $feed->set_cache_duration(SPNRBOX_CACHEMIN);
         } else {
             $feed->set_autodiscovery_cache_duration(9999999999);
             $feed->set_cache_duration(9999999999);
         }
         // CHARSET
         if (!defined('CHARSET')) {
             define('CHARSET', 'UTF-8');
         }
         if (!defined('SPNRBOX_CHARSET')) {
             define('SPNRBOX_CHARSET', 'UTF-8');
         }
         if (SPNRBOX_CHARSET == 'default') {
             $charset = CHARSET;
         } else {
             $charset = SPNRBOX_CHARSET;
         }
         $feed->set_cache_location(WBB_DIR . 'lib/data/boxes/SimplePieNewsReader/cache');
         $feed->set_favicon_handler(RELATIVE_WBB_DIR . 'lib/data/boxes/SimplePieNewsReader/handler_image.php');
         $feed->set_image_handler(RELATIVE_WBB_DIR . 'lib/data/boxes/SimplePieNewsReader/handler_image.php');
         $feed->set_output_encoding($charset);
         // BOOKMARKS
         $bookmarks = array();
         if (SPNRBOX_SHOWSOCIALBOOKMARKS) {
             $socialBookmarks = preg_split("/\r?\n/", SPNRBOX_SOCIALBOOKMARKS);
             $cntBookmark = 0;
             foreach ($socialBookmarks as $row) {
                 $row = trim($row);
                 if (preg_match("/\\|/", $row)) {
                     list($bookmarkTitle, $bookmarkUrl, $bookmarkImg, $bookmarkEncodeTitle, $bookmarkEncodeUrl) = preg_split("/\\|/", $row, 5);
                     $bookmarkTitle = trim($bookmarkTitle);
                     $bookmarkUrl = trim($bookmarkUrl);
                     $bookmarkImg = trim($bookmarkImg);
                     $bookmarkEncodeTitle = trim($bookmarkEncodeTitle);
                     $bookmarkEncodeUrl = trim($bookmarkEncodeUrl);
                     if (!empty($bookmarkTitle) && !empty($bookmarkUrl) && !empty($bookmarkImg) && isset($bookmarkEncodeTitle) && isset($bookmarkEncodeUrl)) {
                         $bookmarks[$cntBookmark]['bookmarkTitle'] = $bookmarkTitle;
                         $bookmarks[$cntBookmark]['bookmarkUrl'] = $bookmarkUrl;
                         $bookmarks[$cntBookmark]['bookmarkImg'] = $bookmarkImg;
                         $bookmarks[$cntBookmark]['bookmarkEncodeTitle'] = $bookmarkEncodeTitle == 1 ? 1 : 0;
                         $bookmarks[$cntBookmark]['bookmarkEncodeUrl'] = $bookmarkEncodeUrl == 1 ? 1 : 0;
                         $cntBookmark++;
                     }
                 }
             }
         }
         // THEMA ZUM FEED
         if (WCF::getUser()->getPermission('user.board.canViewThreadToFeed') && SPNRBOX_FEEDTOTHREAD) {
             require_once WBB_DIR . 'lib/data/board/Board.class.php';
             $accessibleBoards = explode(',', Board::getAccessibleBoards());
             $selectiveBoards = explode(',', SPNRBOX_FEEDTOTHREADBOARDID);
             $boardStructur = WCF::getCache()->get('board', 'boardStructure');
             if (count($selectiveBoards) != 0) {
                 $this->spnrbData['boardsForm'] = count($selectiveBoards) == 1 ? 'button' : 'list';
                 $cntBoards = 0;
                 $prefix = '';
                 foreach ($selectiveBoards as $k => $v) {
                     $tmp = Board::getBoard($v);
                     if ($tmp->boardType < 2 && in_array($v, $accessibleBoards)) {
                         $this->spnrbData['boards'][$cntBoards]['id'] = $tmp->boardID;
                         $this->spnrbData['boards'][$cntBoards]['type'] = $tmp->boardType;
                         $prefix = '';
                         foreach ($boardStructur as $boardDepth => $boardKey) {
                             if (in_array($this->spnrbData['boards'][$cntBoards]['id'], $boardKey)) {
                                 $prefix = str_repeat('--', $boardDepth);
                                 break;
                             }
                         }
                         $this->spnrbData['boards'][$cntBoards]['title'] = ($prefix != '' ? $prefix : '') . ' ' . $tmp->title;
                         $cntBoards++;
                     }
                 }
             } else {
                 $this->spnrbData['boardsForm'] = '';
//.........这里部分代码省略.........
开发者ID:Maggan22,项目名称:wbb3addons,代码行数:101,代码来源:SimplePieNewsreaderBox.class.php

示例12: readSimilarThreads

 /**
  * Reads the similar threads of this thread.
  */
 protected function readSimilarThreads()
 {
     if (!THREAD_ENABLE_SIMILAR_THREADS) {
         return;
     }
     // get accessible boards
     $boardIDs = Board::getAccessibleBoards(array('canViewBoard', 'canEnterBoard', 'canReadThread'));
     if (empty($boardIDs)) {
         return;
     }
     // get similar threads
     $sql = "SELECT \t\tthread.*, board.title\n\t\t\tFROM \t\twbb" . WBB_N . "_thread_similar similar\n\t\t\tLEFT JOIN\twbb" . WBB_N . "_thread thread\n\t\t\tON\t\t(thread.threadID = similar.similarThreadID)\n\t\t\tLEFT JOIN \twbb" . WBB_N . "_board board\n\t\t\tON \t\t(board.boardID = thread.boardID)\n\t\t\tWHERE \t\tsimilar.threadID = " . $this->threadID . "\n\t\t\t\t\tAND thread.isDeleted = 0\n\t\t\t\t\tAND thread.isDisabled = 0\n\t\t\t\t\tAND thread.boardID IN (" . $boardIDs . ")\n\t\t\tORDER BY \tthread.lastPostTime DESC";
     $result = WCF::getDB()->sendQuery($sql);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->similarThreads[] = new ViewableThread(null, $row);
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:20,代码来源:ThreadPage.class.php


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