コード例 #1
0
ファイル: boards_rss.php プロジェクト: bitweaver/boards
        // pass in a reference to the root object so that we can do proper permissions checks
        $gComment->mRootObj = $gContent;
        $feeds = $gComment->getComments($gContent->mContentId, $gBitSystem->getConfig('boards_rss_max_records', 10), 0, 'commentDate_desc', 'flat');
        break;
    case 'bitboard':
    default:
        $topic = new BitBoardTopic();
        $pParamHash = array();
        if (!empty($_REQUEST['b'])) {
            $pParamHash['b'] = $_REQUEST['b'];
        }
        $pParamHash['find'] = '';
        $pParamHash['sort_mode'] = "llc_last_modified_desc";
        $pParamHash['max_records'] = $gBitSystem->getConfig('boards_rss_max_records', 10);
        $pParamHash['offset'] = 0;
        $feeds = $topic->getList($pParamHash);
        break;
}
// get all the data ready for the feed creator
foreach ($feeds as $feed) {
    /*
    	echo "<pre>";
    	var_dump($feed);
    	//*/
    $item = new FeedItem();
    $item->title = $feed['title'];
    $item->source = 'http://' . $_SERVER['HTTP_HOST'] . BIT_ROOT_URL;
    switch ($gContent->getField('content_type_guid')) {
        case 'bitcomment':
            // topic specific
            $item->link = 'http://' . $_SERVER['HTTP_HOST'] . BIT_ROOT_URL . 'index.php?content_id=' . $feed['content_id'];
コード例 #2
0
    // if a content_type has been requested the user just wants a list of that
    if (isset($moduleParams['content_type_guid'])) {
        $contentListHash['content_type_guid'] = $moduleParams['content_type_guid'];
        if (isset($allowedContentTypes[$moduleParams['content_type_guid']])) {
            $gBitSmarty->assign("reqContentType", $allowedContentTypes[$moduleParams['content_type_guid']]);
        }
    }
    $contentList = $gContent->getContentList($contentListHash);
    $gBitSmarty->assign_by_ref("contentList", $contentList);
    // topics from related board
    $listHash = array("connect_group_content_id" => $gContent->mContentId, "content_type_guid" => "bitboard", "sort_mode" => "created_asc");
    $list = $gContent->getContentList($listHash);
    if ($listHash['cant']) {
        $gBitSmarty->assign('board_id', $list[0]['board_id']);
        // if a content_type has been requested the user just wants a list of that - no discussion topics
        if (empty($moduleParams['content_type_guid'])) {
            /*  boards package dependancy
             *  we're only expecting one board to be associated with the group.
             *  if more than one is to be allowed then maybe some support for handling 
             *  that would need to be added here. for now we get only the discussion
             *  topics of the oldest board, which is automagically created when the group
             *  is created.
             */
            require_once BOARDS_PKG_PATH . 'BitBoardTopic.php';
            $topicsHash = array("content_id" => $list[0]['content_id']);
            $topic = new BitBoardTopic();
            $topics = $topic->getList($topicsHash);
            $gBitSmarty->assign_by_ref('topics', $topics);
        }
    }
}
コード例 #3
0
ファイル: view_board_inc.php プロジェクト: bitweaver/boards
 * A mass remove topics request might be made, handle it, perms are checked in the include, it does not require board edit perms necessarily.
 * Code is moved to edit_topic_inc to try to make this all a little more sane.
 *
 * @TODO perhaps move this into the action process above
 */
require_once BOARDS_PKG_PATH . 'edit_topic_inc.php';
// Ok finally we can get on with viewing our board
// liberty display services
$displayHash = array('perm_name' => 'p_boards_read');
$gContent->invokeServices('content_display_function', $displayHash);
// set some comment values since topics are comments
$commentsParentId = $gContent->mContentId;
$comments_return_url = BOARDS_PKG_URL . "index.php?b=" . urlencode($gContent->mBitBoardId);
// @TODO not clear why we load up comments and topics after this when its likely to get both. If someone figures it out please clarify.
require_once BOARDS_PKG_PATH . 'boards_comments_inc.php';
// get the topics for this board
require_once BOARDS_PKG_PATH . 'BitBoardTopic.php';
$threads = new BitBoardTopic($gContent->mContentId);
// lets pass in a ref to the root obj so we can fully mimic comments
$threads->mRootObj = $gContent;
$threadsListHash = $_REQUEST;
$threadList = $threads->getList($threadsListHash);
$gBitSmarty->assignByRef('threadList', $threadList);
// getList() has now placed all the pagination information in $_REQUEST['listInfo']
$gBitSmarty->assignByRef('listInfo', $threadsListHash['listInfo']);
$gBitSmarty->assignByRef('board', $gContent);
$gBitSmarty->assign('cat_url', BOARDS_PKG_URL . "index.php");
//?ct=".urlencode($gContent->mInfo['content_type_guid']));
$gBitThemes->loadAjax('mochikit');
// Display the template
$gBitSystem->display('bitpackage:boards/list_topics.tpl', tra('Message Board Threads: ' . $gContent->getField('title')), array('display_mode' => 'display'));