You are here

function event_block_upcoming in Event 5.2

Same name and namespace in other branches
  1. 5 event.module \event_block_upcoming()

Creates a block that contains upcoming events.

Parameters

$limit The number of events that can be displayed in the block.:

$types The node types to get. If none given, all: event-enabled types will be retrieved that are configured to show up in all calendars.

$rewrite_parameter optional array that will be passed on to queries: in event_database.*.inc files and merged into the fourth argument of db_rewrite_sql.

Return value

An array containing the number of found items and a string containing the fully themed block content.

Related topics

1 call to event_block_upcoming()
event_block in ./event.module
Provides the blocks that this module is capable of displaying.

File

./event.module, line 1881

Code

function event_block_upcoming($limit = 6, $types = array(), $rewrite_parameter = array()) {
  $items = _event_block_upcoming($limit, $types, $rewrite_parameter);
  if (!($count = count($items))) {
    $items[] = t('No upcoming events available');
  }
  $output = theme('event_upcoming_block', $items);
  $output .= theme('event_ical_link', 'event/ical');
  if (count($types)) {
    $date = _event_user_time();
    $output .= theme('event_more_link', 'event/' . _event_format_url($date) . '/' . variable_get('event_overview', 'month') . '/' . implode(',', $types));
  }
  else {
    $output .= theme('event_more_link', 'event');
  }
  return array(
    'count' => $count,
    'content' => $output,
  );
}