blob: b116202a3279adf79e3c68b35e0bfab4a5e93a88 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<?php
/**
* Params:
* - title : if is "title", show the title of the post, else show the date of creation
* - b : numeric id of board to show posts from
* - all_boards : display posts from all boards. Default behavior is to auto-track to board you are in.
*
* @version $Header$
* @package boards
* @subpackage modules
*/
/**
* required setup
*/
include_once( BOARDS_PKG_PATH.'BitBoardPost.php' );
global $gBitSmarty, $gQueryUserId, $gBitSystem, $moduleParams;
if( !empty( $moduleParams ) ) {
extract( $moduleParams );
}
$listHash = array( 'user_id' => $gQueryUserId, 'sort_mode' => 'created_desc', 'max_records' => $module_rows );
if( !empty( $module_params['b'] ) ) {
$listHash['board_id'] = $module_params['b'];
} elseif( !empty( $_REQUEST['b'] ) && empty( $module_params['all_boards'] ) ) {
$listHash['board_id'] = $_REQUEST['b'];
}
$_template->tpl_vars['modRecentPostsBoardId'] = new Smarty_variable( !empty( $listHash['board_id'] ) );
if( BitBase::verifyId( $gQueryUserId ) ) {
$listHash['user_id'] = $gQueryUserId;
}
$post = new BitBoardPost();
if( $postList = $post->getList( $listHash ) ) {
$_template->tpl_vars['modLastBoardPosts'] = new Smarty_variable( $postList );
}
?>
|