You are here

function theme_archive_page_title in Archive 6

Same name and namespace in other branches
  1. 5 archive.inc \theme_archive_page_title()
  2. 7.2 archive.pages.inc \theme_archive_page_title()
  3. 7 archive.pages.inc \theme_archive_page_title()

Theme function for the title of the archive page. Changes according to content being viewed

Parameters

string $type:

integer $year:

integer $month:

integer $day:

Return value

string

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

File

./archive.pages.inc, line 208

Code

function theme_archive_page_title($type, $year, $month, $day) {
  $title = t('Archive');
  $month_names = array(
    '',
    'Jan',
    'Feb',
    'Mar',
    'Apr',
    'May',
    'Jun',
    'Jul',
    'Aug',
    'Sep',
    'Oct',
    'Nov',
    'Dec',
  );
  if ($day) {
    $title .= ' - ' . t($month_names[$month]) . ' ' . $day . ', ' . $year;
  }
  else {
    if ($month) {
      $title .= ' - ' . t($month_names[$month]) . ' ' . $year;
    }
    else {
      if ($year) {
        $title .= ' - ' . $year;
      }
    }
  }
  if ($type != 'all') {
    $type_name = db_result(db_query("SELECT name FROM {node_type} WHERE type = '%s'", $type));
    $title .= ' - ' . ($type_name ? t($type_name) : $type);
  }
  return $title;
}