You are here

function template_preprocess_social_comments_items in Open Social 7

Prepares variables for social-comments-items template.

File

./social_comments.module, line 72

Code

function template_preprocess_social_comments_items(&$variables) {
  $comments =& $variables['comments'];
  if (is_array($comments)) {
    foreach ($comments as &$comment) {
      $comment['date'] = format_date($comment['timestamp'], 'medium');
      $comment['userphoto'] = theme('image', array(
        'path' => $comment['userphoto'],
      ));
    }
  }
  $variables['theme_hook_suggestions'][] = 'social_comments_items__' . $variables['entity_type'];
  $variables['theme_hook_suggestions'][] = 'social_comments_items__' . $variables['bundle'];
  $variables['theme_hook_suggestions'][] = 'social_comments_items__' . $variables['type'];
  $variables['theme_hook_suggestions'][] = 'social_comments_items__' . $variables['type'] . '__' . $variables['bundle'];
}