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

Source for file mod_upcoming.php

Documentation is available at mod_upcoming.php

  1. <?php
  2. /**
  3.  * Params:
  4.  * - title : if is "title", show the title of the post, else show the date of creation
  5.  *
  6.  * @version $Header$
  7.  * @package blogs
  8.  * @subpackage modules
  9.  */
  10.  
  11. /**
  12.  * required setup
  13.  */
  14. if( !defined( 'MAX_EVENTS_PREVIEW_LENGTH' ) ) {
  15.     define ('MAX_EVENTS_PREVIEW_LENGTH', 100);
  16. }
  17.  
  18. include_once( EVENTS_PKG_PATH.'BitEvents.php' );
  19.  
  20. global $gBitSmarty, $gQueryUserId, $gBitSystem, $moduleParams;
  21.  
  22. $module_rows = $moduleParams['module_rows'];
  23. $module_params = $moduleParams['module_params'];
  24. $module_title = isset($moduleParams['title']) ? $moduleParams['title'] : tra( "Upcoming Events");
  25.  
  26. $_template->tpl_vars['moduleTitle'] = new Smarty_variable( $module_title );
  27.  
  28. $listHash = array( 'max_records' => $module_rows, 'parse_split' => !empty($module_params['preview']) && $module_params['preview'] ? TRUE : FALSE ,
  29.            'sort_mode' => !empty($module_params['random']) && $module_params['random'] ? 'random' : 'event_time_asc',
  30.            'event_after' => $gBitSystem->getUTCTime(),
  31.            'event_before' => $gBitSystem->getUTCTime() + (60 * 60 * 24 * $gBitSystem->getConfig('events_upcoming_limit', 7)));
  32.  
  33. /* Support for selecting entries only from one or more categories */
  34. if (isset($module_params['pigeonholes'])) {
  35.     $listHash['pigeonholes']['filter'] = split(",", $module_params['pigeonholes']);
  36. }
  37. $events = new BitEvents();
  38. $list = $events->getList( $listHash );
  39. $maxPreviewLength = (!empty($module_params['max_preview_length']) ? $module_params['max_preview_length'] : MAX_EVENTS_PREVIEW_LENGTH);
  40.  
  41. $_template->tpl_vars['maxPreviewLength'] = new Smarty_variable( $maxPreviewLength);
  42. $_template->tpl_vars['modUpcomingEvents'] = new Smarty_variable( $list);
  43.  
  44. $_template->tpl_vars['eventsPackageActive'] = new Smarty_variable( $gBitSystem->isPackageActive('events'));
  45.  
  46. ?>

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