You are here

function advanced_forum_comment_is_styled in Advanced Forum 6.2

Same name and namespace in other branches
  1. 7.2 includes/style.inc \advanced_forum_comment_is_styled()
1 call to advanced_forum_comment_is_styled()
advanced_forum_is_styled in includes/style.inc

File

includes/style.inc, line 221
Functions relating to the style system, not including core hooks and preprocess / theme functions.

Code

function advanced_forum_comment_is_styled($comment, $master_topic_id) {
  if (isset($master_topic_id) && $comment->nid == $master_topic_id) {

    // This comment is on a node we already know is styled, or a previous
    // comment on this node is styled, so the comment is styled.
    return $master_topic_id;
  }
  if (variable_get("advanced_forum_style_all_comments", 0)) {

    // All comments on this site should be styled.
    return $comment->nid;
  }

  // Load up the node this comment is attached to and see if it is styled.
  // This should not happen often, only in a case where the comment is
  // displayed seperately from the node (such as a reply preview).
  $node = node_load($comment->nid);
  if (advanced_forum_node_is_styled($node, FALSE)) {
    return $comment->nid;
  }

  // Comment doesn't pass any styling test
  return -1;
}