|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/afglcweb/ny/sites/all/themes/zen/zen/ |
Upload File : |
<?php
// $Id: template.comment.inc,v 1.2 2008/09/14 12:09:37 johnalbin Exp $
/**
* @file
* Contains functions only needed when rendering comments.
*/
/**
* 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 _zen_preprocess_comment(&$vars, $hook) {
// Add an "unpublished" flag.
$vars['unpublished'] = ($vars['comment']->status == COMMENT_NOT_PUBLISHED);
// If comment subjects are disabled, don't display them.
if (variable_get('comment_subject_field_' . $vars['node']->type, 1) == 0) {
$vars['title'] = '';
}
// Special classes for comments.
$classes = array('comment');
if ($vars['comment']->new) {
$classes[] = 'comment-new';
}
$classes[] = $vars['status'];
$classes[] = $vars['zebra'];
if ($vars['id'] == 1) {
$classes[] = 'first';
}
if ($vars['id'] == $vars['node']->comment_count) {
$classes[] = 'last';
}
if ($vars['comment']->uid == 0) {
// Comment is by an anonymous user.
$classes[] = 'comment-by-anon';
}
else {
if ($vars['comment']->uid == $vars['node']->uid) {
// Comment is by the node author.
$classes[] = 'comment-by-author';
}
if ($vars['comment']->uid == $GLOBALS['user']->uid) {
// Comment was posted by current user.
$classes[] = 'comment-mine';
}
}
$vars['classes'] = implode(' ', $classes);
}