<?php $board = CBoard::getInstance(); $user = CUser::getInstance(); if ($_GET['post_id'] == '') { echo 'Error'; exit; } $pID = $_GET['post_id']; // paging info $currentPage = isset($_GET['page']) ? intval($_GET['page']) : 1; $limit = 10; $postData = $board->postByPage($pID, ($currentPage - 1) * $limit, $limit); $totalRows = $GLOBALS['dbh']->found_rows(); $pagesToDisplay = 6; $totalPages = ceil($totalRows / $limit); $page =& new CPaging($currentPage, $pagesToDisplay, $totalPages, 'page', '/', $_SERVER['QUERY_STRING']); $pages = $page->getPages(); $firstPage = $page->getFirstPage('First'); $lastPage = $page->getLastPage('Last'); $nextPage = $page->getNextPage('Next'); $prevPage = $page->getPrevPage('Previous'); // data for the board this post resides in $boardData = $board->board($postData[0]['BP_BID']); // first post to get title $originalPost = $board->singlePost($pID); // add a view in the db $data = array(); $data['bv_bp_id'] = $pID; $data['bv_u_id'] = $_USER_ID; $board->addView($data);
<?php $b =& CBoard::getInstance(); $g =& CGroup::getInstance(); $u =& CUser::getInstance(); $g_id = $_GET['group_id']; $user_group = $g->groups($_USER_ID, $g_id); if (count($user_group) == 0) { $tpl->kill("You are not a member of this group"); } // data for this board $boardData = $b->board($g_id); // paging info $currentPage = isset($_GET['page']) ? intval($_GET['page']) : 1; $limit = 20; $postData = $b->postsByPages($g_id, ($currentPage - 1) * $limit, $limit); $totalRows = $GLOBALS['dbh']->found_rows(); $pagesToDisplay = 6; $totalPages = ceil($totalRows / $limit); $page =& new CPaging($currentPage, $pagesToDisplay, $totalPages, 'page', '/', $_SERVER['QUERY_STRING']); $pages = $page->getPages(); $firstPage = $page->getFirstPage('First'); $lastPage = $page->getLastPage('Last'); $nextPage = $page->getNextPage('Next'); $prevPage = $page->getPrevPage('Previous'); ?> <div style="padding-top:3px; padding-right:10px;"> <div style="float:left;"><a href="/?action=group.board_main&group_id=<?php echo $g_id; ?>