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

Source for file mod_last_comments.php

Documentation is available at mod_last_comments.php

  1. <?php
  2. /**
  3.  * @version $Header$
  4.  * @package liberty
  5.  * @subpackage modules
  6.  */
  7.  
  8. /**
  9.  * Initial Setup
  10.  */
  11. require_once( LIBERTY_PKG_PATH.'LibertyComment.php' );
  12. global $gQueryUser, $gBitUser, $gLibertySystem, $moduleParams;
  13. $params = $moduleParams['module_params'];
  14. $moduleTitle = !empty($moduleParams['title'])? $moduleParams['title'] : NULL;
  15.  
  16. $userId = NULL;
  17. if( !empty( $gQueryUser->mUserId ) ) {
  18.     $userId = $gQueryUser->mUserId;
  19. }
  20.  
  21. $listHash = array(
  22.     'user_id' => $userId,
  23.     'max_records' => $moduleParams['module_rows'],
  24. );
  25.  
  26. if (!empty($params['full'])) {
  27.     $listHash['parse'] = TRUE;
  28. }
  29.  
  30. if (!empty($params['sort'])) {
  31.     $listHash['sort_mode'] = $params['sort'];
  32. }
  33.  
  34. if (!empty($params['pigeonholes'])) {
  35.     $listHash['pigeonholes']['root_filter'] = $params['pigeonholes'];
  36. }
  37.  
  38. if( !empty( $params['root_content_type_guid'] ) ) {
  39.     if( empty($moduleTitle) && is_string( $params['root_content_type_guid'] ) ) {
  40.         $moduleTitle = $gLibertySystem->getContentTypeName( $params['root_content_type_guid'] ).' '.tra( 'Comments' );
  41.     }
  42.     $listHash['root_content_type_guid'] = $params['root_content_type_guid'];
  43. }
  44. $_template->tpl_vars['moduleTitle'] = new Smarty_variable( $moduleTitle );
  45.  
  46. $lcom = new LibertyComment();
  47. $modLastComments = $lcom->getList( $listHash );
  48. $_template->tpl_vars['modLastComments'] = new Smarty_variable( $modLastComments );
  49. ?>

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