You are here

function _submitted_by_token_date in Submitted By 6

1 call to _submitted_by_token_date()
submitted_by_token_values in ./submitted_by.module
Because the normal submission line offers a quick and easy link to the user's account page, we'll provide a token for that. Token should probably have this built in.

File

./submitted_by.module, line 311
Take over the "Submitted by" theme function to allow different content types to have different strings.

Code

function _submitted_by_token_date($date, $prefix = NULL) {
  $date = (int) $date;
  $tz = variable_get('date_default_timezone', 0);
  if ($prefix) {
    $prefix .= '-';
  }
  $values = array(
    $prefix . 'small' => format_date($date, 'small', '', $tz),
    $prefix . 'medium' => format_date($date, 'medium', '', $tz),
    $prefix . 'large' => format_date($date, 'large', '', $tz),
    $prefix . 'since' => $date ? format_interval(time() - $date) : t('Never'),
    $prefix . 'yyyy' => format_date($date, 'custom', 'Y', $tz),
    $prefix . 'yy' => format_date($date, 'custom', 'y', $tz),
    $prefix . 'month' => t(format_date($date, 'custom', 'F', $tz)),
    $prefix . 'mon' => t(format_date($date, 'custom', 'M', $tz)),
    $prefix . 'mm' => format_date($date, 'custom', 'm', $tz),
    $prefix . 'm' => format_date($date, 'custom', 'n', $tz),
    $prefix . 'ww' => format_date($date, 'custom', 'W', $tz),
    $prefix . 'date' => format_date($date, 'custom', 'N', $tz),
    $prefix . 'day' => t(format_date($date, 'custom', 'l', $tz)),
    $prefix . 'ddd' => t(format_date($date, 'custom', 'D', $tz)),
    $prefix . 'dd' => format_date($date, 'custom', 'd', $tz),
    $prefix . 'd' => format_date($date, 'custom', 'j', $tz),
    $prefix . 'hh' => format_date($date, 'custom', 'h', $tz),
    $prefix . 'ii' => format_date($date, 'custom', 'i', $tz),
    $prefix . 'ss' => format_date($date, 'custom', 's', $tz),
  );
  return $values;
}