boards
[ class tree: boards ] [ index: boards ] [ all elements ]

Source for file mod_recent_posts.php

Documentation is available at mod_recent_posts.php

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

Documentation generated on Wed, 29 Jul 2015 13:57:11 +0000 by phpDocumentor 1.5.0-lsces