type) {
case 'blog':
$vars['blog_date'] = clean_blog_date($node);
break;
}
}
/**
* Override or insert variables into the comment templates.
*
* @param $vars
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered ("comment" in this case.)
*/
function phptemplate_preprocess_comment(&$vars, $hook) {
$comment = $vars['comment'];
$vars['comment_date'] = clean_comment_date($comment);
$vars['comment_classes'] = 'comment'. ($comment->new ? ' comment-new' : '');
$vars['comment_classes'] .= ($comment->status == COMMENT_NOT_PUBLISHED) ? ' comment-unpublished' : '';
$vars['comment_classes'] .= ' '. $vars['zebra'] .' clear-block';
}
/**
* Formats calendar style dates for blog posts.
*
* @param $node
* The node object from which to extract submitted date information.
* @return themed date.
*/
function clean_blog_date($node) {
$day = format_date($node->created, 'custom', "j");
$month = format_date($node->created, 'custom', "M");
$year = format_date($node->created, 'custom', "Y");
$output = ''. $day .'';
$output .= ''. $month .'';
$output .= ''. $year .'';
return $output;
}
/**
* Formats calendar style dates for comments.
*
* @param $comment
* The comment object from which to extract submitted date information.
* @return themed date.
*/
function clean_comment_date($comment) {
$day = format_date($comment->timestamp, 'custom', 'd M');
$time = format_date($comment->timestamp, 'custom', 'H:i');
$output = ''. $day .'';
$output .= ''. $time .'';
return $output;
}