You are here

function theme_archive_separator in Archive 7

Same name and namespace in other branches
  1. 6 archive.pages.inc \theme_archive_separator()
  2. 7.2 archive.pages.inc \theme_archive_separator()

Theme the date separators between nodes of different year/month/day.

Parameters

$date_created: A UNIX timestamp.

$separators: An array with 'year', 'month', and 'day' keys. A value of 1 for any of those keys means a transition for that unit of time. Ex. array('year' => 0, 'month' => 1, 'day' => 1) ^ Means the month has transitioned

1 theme call to theme_archive_separator()
archive_page in ./archive.pages.inc
Fetch nodes for the selected date, or current date if none selected.

File

./archive.pages.inc, line 414
Pages for the archive module.

Code

function theme_archive_separator($variables) {
  $date_sep = '';
  if ($variables['separators']['year'] && $variables['separators']['month'] && $variables['separators']['day']) {
    $date_sep = format_date($variables['date_created'], 'custom', 'F jS, Y');
  }
  elseif ($variables['separators']['month'] && $variables['separators']['day']) {
    $date_sep = format_date($variables['date_created'], 'custom', 'F jS');
  }
  elseif ($variables['separators']['day']) {
    $date_sep = format_date($variables['date_created'], 'custom', 'F jS');
  }
  return '<h3>' . $date_sep . '</h3>';
}