• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Board类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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


示例2: build

 /**
  * @param Board $board
  * @param int $depth
  */
 protected function build(Board $board, $depth)
 {
     $weight = $this->getPrecedence();
     $indent = $board->indent($depth);
     $operator = $this->getName();
     $index = 0;
     /* @var $child Node */
     foreach ($this->getChildren() as $child) {
         // Prep
         $wrap = $child->getPrecedence() < $weight;
         // Indent
         if ($this->isBlock()) {
             $index && $board->write("\n");
             $board->write($indent);
         }
         // Operator
         if ($index) {
             $board->write($this->isBlock() ? '' : ' ');
             $board->write($operator);
             $board->write($child->isBlock() && !$wrap ? '' : ' ');
         }
         // Child:
         $wrap && $board->write("(");
         $child->isBlock() && $board->write("\n");
         // ---
         $child->build($board, $depth + 1);
         // ---
         $wrap && $board->write(")");
         // ===
         $index++;
     }
 }
开发者ID:rakorium,项目名称:okapi,代码行数:36,代码来源:Operator.php


示例3: build

 /**
  * @param Board $board
  * @param int $depth
  */
 protected function build(Board $board, $depth)
 {
     $board->write('INSERT INTO ');
     $this->table->build($board, $depth + 1);
     $board->write(" (");
     $this->columns->build($board, $depth + 1);
     $board->write(")\n");
     $this->data->build($board, $depth + 1);
 }
开发者ID:rakorium,项目名称:okapi,代码行数:13,代码来源:Insert.php


示例4: build

 /**
  * @param Board $board
  * @param int $depth
  */
 protected function build(Board $board, $depth = 0)
 {
     $resolve = $board->getResolve();
     $sql = $resolve ? $this->toSql($board) : '?';
     $board->write($sql);
     if (!$resolve) {
         $board->add($this->getValue());
     }
 }
开发者ID:rakorium,项目名称:okapi,代码行数:13,代码来源:Value.php


示例5: IndexGuncelToHTML

 public function IndexGuncelToHTML()
 {
     $myDBConnector = new DBConnector();
     $dbARY = $myDBConnector->infos();
     $connection = new mysqli($dbARY[0], $dbARY[1], $dbARY[2], $dbARY[3]);
     $connection->set_charset("utf8");
     echo "<div style=\"margin:2%;background-color:#e6e6e6;border-bottom:1px solid #c7d0d5;\">";
     echo "<p style=\"font-size:20px;word-wrap:break-word;color:#cb7c7a;font-family: 'Josefin Sans', sans-serif;\">";
     echo "Güncel panolar";
     echo "</p>";
     echo "</div>";
     echo "<div style=\"\">";
     $results = $connection->query("SELECT * FROM boards ORDER BY boardID DESC LIMIT 6 OFFSET 0");
     while ($boardInfos = $results->fetch_assoc()) {
         $myBoard = new Board(array($boardInfos['boardID'], $boardInfos['boardName'], $boardInfos['boardCategory'], $boardInfos['boardCreator'], $boardInfos['boardImage'], $boardInfos['boardDate']));
         $myBoard->BoardToPetitHTML();
     }
     echo "</div>";
     echo "<div id=\"x\" style=\"margin:2%;background-color:#e6e6e6;border-bottom:1px solid #c7d0d5;\">";
     echo "<p style=\"font-size:20px;word-wrap:break-word;color:#cb7c7a;font-family: 'Josefin Sans', sans-serif;\">";
     echo "Güncel içerikler";
     echo "</p>";
     echo "</div>";
     echo "<div style=\"\">";
     if (!$connection->connect_error) {
         $results = $connection->query("SELECT * FROM threads ORDER BY threadID DESC LIMIT 12 OFFSET 0 ");
         while ($curres = $results->fetch_assoc()) {
             $threadID5 = $curres["threadID"];
             $threadDate5 = $curres["threadDate"];
             $threadWriter5 = $curres["threadWriter"];
             $threadCategory5 = $curres["threadCategory"];
             $threadPicture5 = $curres["threadPicture"];
             $stepCount5 = $curres["stepCount"];
             $threadName5 = $curres["threadName"];
             $threadPoint5 = $curres["threadPoint"];
             $myThread5 = new Thread(array($threadID5, $threadDate5, $threadWriter5, $threadCategory5, $threadPicture5, $stepCount5, $threadName5, $threadPoint5));
             $myThread5->ThreadToPetitHTML();
         }
         echo "<div id=\"moreBestDiv\"></div>";
         echo "<div style=\"\">";
         echo "<form id=\"loadMoreBestForm\" method=\"post\" action=\"loadMoreRecentIndex.php\">";
         echo "<input id=\"loadMoreBestOffset\" name=\"loadMoreBestOffset\" style=\"display:none;\" value=\"" . $results->num_rows . "\"/>";
         echo "<button id=\"loadMoreBestButton\" class=\"btn btn-block btn-success\">";
         echo "<i id=\"loadMoreBestSpinner\" style=\"display:none;\" class=\"fa fa-refresh fa-spin\"></i>";
         echo "<span id=\"loadMoreBestTXT\">";
         echo "Daha fazla göster";
         echo "</span>";
         echo "</button>";
         echo "</form>";
         echo "</div>";
     }
     echo "</div>";
     echo "<script type=\"text/javascript\">";
     echo "\n\t\t\t\$(window).scroll(function(){\n\t\t\t\tvar p = \$('#x');\n\t\t\t\tvar pos = p.position();\n\t\t\t\tvar windowpos = \$(window).scrollTop();\n\t\t\t\tif (windowpos >= pos.top) {\n\t\t\t\t\t\$('#indexStickyFooter').fadeIn(500);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t\$('#indexStickyFooter').fadeOut(500);\n\t\t\t});\n\t\t\t\$('#loadMoreBestButton').click(function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\t\$('#loadMoreBestTXT').hide();\n\t\t\t\t\$('#loadMoreBestSpinner').show();\n\t\t\t\t\$('#loadMoreBestForm').ajaxForm({\n\t\t\t\t\tsuccess : function(msg){\n\t\t\t\t\t\t\$('#loadMoreBestTXT').show();\n\t\t\t\t\t\t\$('#loadMoreBestSpinner').hide();\n\t\t\t\t\t\tnewoffset = msg.charAt(0);\n\t\t\t\t\t\toldoffset = \$('#loadMoreBestOffset').val();\n\t\t\t\t\t\toldint = parseInt(oldoffset);\n\t\t\t\t\t\tnewint = parseInt(newoffset);\n\t\t\t\t\t\tif (newint==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\$('#loadMoreBestTXT').html(\"Hepsi yüklendi\");\n\t\t\t\t\t\t\t\$('#loadMoreBestButton').attr(\"disabled\",true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\$('#loadMoreBestOffset').val(oldint+newint);\n\t\t\t\t\t\tmsg2 = msg.substring(1);\n\t\t\t\t\t\t\$('#moreBestDiv').append(msg2);\n\t\t\t\t\t},\n\t\t\t\t\terror : function(){\n\n\t\t\t\t\t}\n\t\t\t\t}).submit();\n\t\t\t});\t\n\t\t";
     echo "</script>";
 }
开发者ID:oguzeroglu,项目名称:serinhikaye.com,代码行数:56,代码来源:IndexGuncel.class.php


示例6: addBoard

 public function addBoard()
 {
     try {
         $db = new DB();
         $board = new Board($_POST["name"], $_POST["description"], $_GET["user"]);
         $sql = "INSERT INTO board(name,description,owner_id) VALUES (:name,:description,:owner_id)";
         $q = $db->getConnection()->prepare($sql);
         $q->execute(array(':name' => $board->getName(), ':description' => $board->getDescription(), ':owner_id' => $board->getOwnerId()));
     } catch (PDOException $e) {
         echo $e->getMessage();
     }
 }
开发者ID:Skaelv,项目名称:tcd-WT-trello-clone,代码行数:12,代码来源:UserCtrl.php


示例7: build

 /**
  * @param Board $board
  * @param int $depth
  */
 protected function build(Board $board, $depth)
 {
     $board->write('DELETE FROM ');
     $this->table->build($board, $depth + 1);
     $where = $this->where;
     if ($where) {
         $board->write("\n");
         $board->write('WHERE');
         $board->write($where->isBlock() ? "\n" : " ");
         $where->build($board, $depth + 1);
     }
 }
开发者ID:rakorium,项目名称:okapi,代码行数:16,代码来源:Delete.php


示例8: writePins

function writePins(array $rgb)
{
    static $pi, $r, $g, $b;
    if ($pi === null) {
        $pi = new Board();
        $r = $pi->getPin(0)->mode(Pin::SOFT_PWM_OUT)->softPwmWrite(100);
        $g = $pi->getPin(1)->mode(Pin::SOFT_PWM_OUT);
        $b = $pi->getPin(2)->mode(Pin::SOFT_PWM_OUT);
    }
    $r->softPwmWrite($rgb[0]);
    $g->softPwmWrite($rgb[1]);
    $b->softPwmWrite($rgb[2]);
}
开发者ID:amnuts,项目名称:phpiwire,代码行数:13,代码来源:rgbled.php


示例9: test5x6Game

 public function test5x6Game()
 {
     $bombs = [new Point(2, 2), new Point(2, 3), new Point(4, 5)];
     $settings = new Settings(['length' => 5, 'width' => 6, 'bombs' => count($bombs)]);
     $board = new Board($settings);
     $board->initBombs($bombs);
     $game = new Game($board);
     ob_start();
     $game->play(__DIR__ . '/resources/5x6_game_input.txt');
     $output = ob_get_clean();
     $expectedOutput = file_get_contents(__DIR__ . '/resources/5x6_game_expected_output.txt');
     $this->assertEquals($expectedOutput, $output);
 }
开发者ID:SamyGhannad,项目名称:CtCI-6th-Edition,代码行数:13,代码来源:MineSweeperTest.php


示例10: 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


示例11: readPosts

 /**
  * Gets the posts for the feed.
  */
 protected function readPosts()
 {
     // accessible boards
     $accessibleBoardIDArray = Board::getAccessibleBoardIDArray(array('canViewBoard', 'canEnterBoard', 'canReadThread'));
     if (!count($accessibleBoardIDArray)) {
         throw new PermissionDeniedException();
     }
     // get posts
     $attachmentPostIDArray = array();
     $sql = "SELECT\t\tpost.*\n\t\t\tFROM\t\twbb" . WBB_N . "_post post\n\t\t\tWHERE\t\tpost.threadID IN (" . implode(',', $this->threadIDArray) . ")\n\t\t\t\t\tAND post.threadID IN (SELECT threadID FROM wbb" . WBB_N . "_thread WHERE boardID IN (" . implode(',', $accessibleBoardIDArray) . "))\n\t\t\t\t\tAND post.isDeleted = 0\n\t\t\t\t\tAND post.isDisabled = 0\n\t\t\t\t\t" . ($this->hours ? "AND post.time > " . (TIME_NOW - $this->hours * 3600) : '') . "\n\t\t\tORDER BY\tpost.time DESC";
     $result = WCF::getDB()->sendQuery($sql, $this->limit);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->posts[] = new FeedPost(null, $row);
         // attachments
         if ($row['attachments'] != 0) {
             $attachmentPostIDArray[] = $row['postID'];
         }
     }
     // read attachments
     if (MODULE_ATTACHMENT == 1 && count($attachmentPostIDArray) > 0 && (WCF::getUser()->getPermission('user.board.canViewAttachmentPreview') || WCF::getUser()->getPermission('user.board.canDownloadAttachment'))) {
         require_once WCF_DIR . 'lib/data/attachment/MessageAttachmentList.class.php';
         $attachmentList = new MessageAttachmentList($attachmentPostIDArray, 'post');
         $attachmentList->readObjects();
         $attachments = $attachmentList->getSortedAttachments();
         // set embedded attachments
         require_once WCF_DIR . 'lib/data/message/bbcode/AttachmentBBCode.class.php';
         AttachmentBBCode::setAttachments($attachments);
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:32,代码来源:PostsFeedPage.class.php


示例12: run

 public function run()
 {
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 70; $i++) {
         $user = User::where('roles', 'applicant')->get()->shuffle()->first();
         $board = null;
         while (null == $board) {
             $day_type = array('internal' => self::INTERNAL_DAYS, 'external' => self::EXTERNAL_DAYS, 'union' => self::UNION_DAYS);
             $type = $faker->randomElement(['internal', 'external', 'union']);
             $days = $day_type[$type] - 1;
             $from = date_format($faker->dateTimeBetween('-3 months', '+3 months'), 'Y-m-d');
             $end = date('Y-m-d', strtotime("{$from} + {$days} days"));
             $board = Board::where('type', '!=', 'large')->isEmpty($from, $end)->get()->shuffle()->first();
         }
         ApplyRecord::create(array('board_id' => $board->id, 'user_id' => $user->id, 'event_name' => $faker->company(), 'event_type' => $type, 'post_from' => $from, 'post_end' => $end));
     }
     for ($i = 0; $i < 30; $i++) {
         $user = User::where('roles', 'applicant')->get()->shuffle()->first();
         $board = null;
         while (null == $board) {
             $type = $faker->randomElement(['internal', 'external', 'union']);
             $days = self::LARGE_POSTER_DAYS - 1;
             $from = date_format($faker->dateTimeBetween('-3 months', '+3 months'), 'Y-m-d');
             $end = date('Y-m-d', strtotime("{$from} + {$days} days"));
             $board = Board::where('type', 'large')->isEmpty($from, $end)->get()->shuffle()->first();
         }
         ApplyRecord::create(array('board_id' => $board->id, 'user_id' => $user->id, 'event_name' => $faker->company(), 'event_type' => $type, 'post_from' => $from, 'post_end' => $end));
     }
 }
开发者ID:fntsrlike,项目名称:BoardsManager,代码行数:29,代码来源:ApplyRecordTableSeeder.php


示例13: getObjectByID

 /**
  * @see WarningObjectType::getObjectByID()
  */
 public function getObjectByID($objectID)
 {
     if (is_array($objectID)) {
         $posts = array();
         $sql = "SELECT\t\tpost.*, thread.topic, thread.boardID\n\t\t\t\tFROM \t\twbb" . WBB_N . "_post post\n\t\t\t\tLEFT JOIN\twbb" . WBB_N . "_thread thread\n\t\t\t\tON\t\t(thread.threadID = post.threadID)\n\t\t\t\tWHERE \t\tpostID IN (" . implode(',', $objectID) . ")";
         $result = WCF::getDB()->sendQuery($sql);
         while ($row = WCF::getDB()->fetchArray($result)) {
             $posts[$row['postID']] = new PostWarningObject(null, $row);
         }
         return count($posts) > 0 ? $posts : null;
     } else {
         // get object
         $post = new PostWarningObject($objectID);
         if (!$post->postID) {
             return null;
         }
         // check permissions
         if (!class_exists('WBBACP')) {
             // ignore permission in acp
             $board = Board::getBoard($post->boardID);
             if (!$board->getPermission('canViewBoard') || !$board->getPermission('canEnterBoard')) {
                 return null;
             }
         }
         // return object
         return $post;
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:31,代码来源:PostWarningObjectType.class.php


示例14: getObjectsByTagID

 /**
  * @see Taggable::getObjectsByTagID()
  */
 public function getObjectsByTagID($tagID, $limit = 0, $offset = 0)
 {
     $accessibleBoardIDArray = Board::getAccessibleBoardIDArray();
     if (count($accessibleBoardIDArray) == 0) {
         return array();
     }
     $sqlThreadVisitSelect = $sqlThreadVisitJoin = $sqlSubscriptionSelect = $sqlSubscriptionJoin = $sqlOwnPostsSelect = $sqlOwnPostsJoin = '';
     if (WCF::getUser()->userID != 0) {
         $sqlThreadVisitSelect = ', thread_visit.lastVisitTime';
         $sqlThreadVisitJoin = " LEFT JOIN \twbb" . WBB_N . "_thread_visit thread_visit \n\t\t\t\t\t\tON \t\t(thread_visit.threadID = thread.threadID\n\t\t\t\t\t\t\t\tAND thread_visit.userID = " . WCF::getUser()->userID . ")";
         $sqlSubscriptionSelect = ', IF(thread_subscription.userID IS NOT NULL, 1, 0) AS subscribed';
         $sqlSubscriptionJoin = " LEFT JOIN \twbb" . WBB_N . "_thread_subscription thread_subscription \n\t\t\t\t\t\tON \t\t(thread_subscription.userID = " . WCF::getUser()->userID . "\n\t\t\t\t\t\t\t\tAND thread_subscription.threadID = thread.threadID)";
         if (BOARD_THREADS_ENABLE_OWN_POSTS) {
             $sqlOwnPostsSelect = "DISTINCT post.userID AS ownPosts,";
             $sqlOwnPostsJoin = "\tLEFT JOIN\twbb" . WBB_N . "_post post\n\t\t\t\t\t\t\tON \t\t(post.threadID = thread.threadID\n\t\t\t\t\t\t\t\t\tAND post.userID = " . WCF::getUser()->userID . ")";
         }
     }
     $threads = array();
     $sql = "SELECT\t\t" . $sqlOwnPostsSelect . "\n\t\t\t\t\tthread.*,\n\t\t\t\t\tboard.boardID, board.title\n\t\t\t\t\t" . $sqlThreadVisitSelect . "\n\t\t\t\t\t" . $sqlSubscriptionSelect . "\n\t\t\tFROM\t\twcf" . WCF_N . "_tag_to_object tag_to_object\n\t\t\tLEFT JOIN\twbb" . WBB_N . "_thread thread\n\t\t\tON\t\t(thread.threadID = tag_to_object.objectID)\n\t\t\tLEFT JOIN \twbb" . WBB_N . "_board board\n\t\t\tON \t\t(board.boardID = thread.boardID)\n\t\t\t" . $sqlOwnPostsJoin . "\n\t\t\t" . $sqlThreadVisitJoin . "\n\t\t\t" . $sqlSubscriptionJoin . "\n\t\t\tWHERE\t\ttag_to_object.tagID = " . $tagID . "\n\t\t\t\t\tAND tag_to_object.taggableID = " . $this->getTaggableID() . "\n\t\t\t\t\tAND thread.boardID IN (" . implode(',', $accessibleBoardIDArray) . ")\n\t\t\t\t\tAND thread.isDeleted = 0\n\t\t\t\t\tAND thread.isDisabled = 0\n\t\t\tORDER BY\tthread.lastPostTime DESC";
     $result = WCF::getDB()->sendQuery($sql, $limit, $offset);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $row['taggable'] = $this;
         $threads[] = new TaggedThread(null, $row);
     }
     return $threads;
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:29,代码来源:TaggableThread.class.php


示例15: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Board::create([]);
     }
 }
开发者ID:itsfamestudio,项目名称:hashtag,代码行数:7,代码来源:BoardsTableSeeder.php


示例16: beforeFilter

 public function beforeFilter()
 {
     parent::beforeFilter();
     App::import("vendor", array("model/board", "inc/pagination"));
     if (!isset($this->params['name'])) {
         $this->error(ECode::$BOARD_NONE);
     }
     try {
         $boardName = $this->params['name'];
         if (preg_match("/^\\d+\$/", $boardName)) {
             throw new BoardNullException();
         }
         $this->_board = Board::getInstance($boardName);
         if ($this->_board->isDir()) {
             throw new BoardNullException();
         }
     } catch (BoardNullException $e) {
         $this->error(ECode::$BOARD_UNKNOW);
     }
     if (isset($this->params['url']['mode'])) {
         $mode = (int) trim($this->params['url']['mode']);
         $this->_board->setMode($mode);
     }
     if (!$this->_board->hasReadPerm(User::getInstance())) {
         $this->error(ECode::$BOARD_NOPERM);
     }
     $this->_board->setOnBoard();
 }
开发者ID:tilitala,项目名称:nForum,代码行数:28,代码来源:board_controller.php


示例17: beforeFilter

 public function beforeFilter()
 {
     parent::beforeFilter();
     if (!isset($this->params['name'])) {
         $this->error(ECode::$BOARD_NONE);
     }
     try {
         $boardName = $this->params['name'];
         if (preg_match("/^\\d+\$/", $boardName)) {
             throw new BoardNullException();
         }
         $this->_board = Board::getInstance($boardName);
     } catch (BoardNullException $e) {
         $this->error(ECode::$BOARD_UNKNOW);
     }
     if (isset($this->params['url']['mode'])) {
         $mode = (int) trim($this->params['url']['mode']);
         if (!$this->_board->setMode($mode)) {
             $this->error(ECode::$BOARD_NOPERM);
         }
     }
     if (!$this->_board->hasReadPerm(User::getInstance())) {
         if (!$this->ByrSession->isLogin) {
             $this->requestLogin();
         }
         $this->error(ECode::$BOARD_NOPERM);
     }
     $this->_board->setOnBoard();
     $this->ByrSession->Cookie->write("XWJOKE", "hoho", false);
 }
开发者ID:rainsun,项目名称:nForum,代码行数:30,代码来源:article_controller.php


示例18: reachable_squares

 function reachable_squares()
 {
     #Array of square where the piece can move to
     $squares = array();
     $csq = $this->get_current_square();
     $hdist = abs(Board::horz_distance("a1", $csq));
     $vdist = abs(Board::vert_distance("a1", $csq));
     $dist = $hdist > $vdist ? $vdist : $hdist;
     $sq = Board::add_horz_distance($csq, -$dist);
     $sq = Board::add_vert_distance($sq, -$dist);
     $squares = array_merge($squares, Board::squares_in_line($csq, $sq));
     $hdist = abs(Board::horz_distance("h1", $csq));
     $vdist = abs(Board::vert_distance("h1", $csq));
     $dist = $hdist > $vdist ? $vdist : $hdist;
     $sq = Board::add_horz_distance($csq, $dist);
     $sq = Board::add_vert_distance($sq, -$dist);
     $squares = array_merge($squares, Board::squares_in_line($csq, $sq));
     $hdist = abs(Board::horz_distance("a8", $csq));
     $vdist = abs(Board::vert_distance("a8", $csq));
     $dist = $hdist > $vdist ? $vdist : $hdist;
     $sq = Board::add_horz_distance($csq, -$dist);
     $sq = Board::add_vert_distance($sq, $dist);
     $squares = array_merge($squares, Board::squares_in_line($csq, $sq));
     $hdist = abs(Board::horz_distance("h8", $csq));
     $vdist = abs(Board::vert_distance("h8", $csq));
     $dist = $hdist > $vdist ? $vdist : $hdist;
     $sq = Board::add_horz_distance($csq, $dist);
     $sq = Board::add_vert_distance($sq, $dist);
     $squares = array_merge($squares, Board::squares_in_line($csq, $sq));
     #Removes current position square
     $squares = preg_grep("/^{$csq}\$/", $squares, PREG_GREP_INVERT);
     return $squares;
 }
开发者ID:iamdual,项目名称:phpcheckmate,代码行数:33,代码来源:Bishop.class.php


示例19: beforeFilter

 public function beforeFilter()
 {
     parent::beforeFilter();
     if (isset($this->params['name'])) {
         $bName = trim($this->params['name']);
     } else {
         $this->error(ECode::$BOARD_NONE);
     }
     try {
         $this->_board = Board::getInstance($bName);
         if ($this->_board->isDir()) {
             throw new BoardNullException();
         }
     } catch (BoardNullException $e) {
         $this->error(ECode::$BOARD_NONE);
     }
     if (isset($this->params['mode'])) {
         $mode = (int) trim($this->params['mode']);
         if (!$this->_board->setMode($mode)) {
             $this->error(ECode::$BOARD_NOPERM);
         }
     }
     if (!$this->_board->hasReadPerm(User::getInstance())) {
         $this->error(ECode::$BOARD_NOPERM);
     }
     $this->_board->setOnBoard();
 }
开发者ID:tilitala,项目名称:nForum,代码行数:27,代码来源:board_controller.php


示例20: __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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP BoincDb类代码示例发布时间:2022-05-23
下一篇:
PHP BlowfishPasswordHasher类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap