You are here

function advanced_forum_node_is_styled in Advanced Forum 6.2

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

File

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

Code

function advanced_forum_node_is_styled($node, $teaser = FALSE) {

  // Get the list of types that should have the style applied
  $styled_node_types = variable_get('advanced_forum_styled_node_types', array(
    'forum',
  ));

  // If this type is in the list of types that should be styled...
  if (in_array($node->type, $styled_node_types)) {

    // ...and if we are styling teasers or this isn't a teaser...
    if (variable_get('advanced_forum_style_teasers', FALSE) || !$teaser) {

      // ...and if this is not a new node being previewed...
      if (!empty($node->nid)) {

        // ...and if we are styling non forum tagged nodes or this is forum tagged...
        if (!variable_get('advanced_forum_style_only_forum_tagged', TRUE) || advanced_forum_is_forum_tagged($node)) {

          // ... then return the node ID.
          return $node->nid;
        }
      }
      else {

        // ...and if we are styling non forum tagged nodes or this is forum tagged...
        if (!variable_get('advanced_forum_style_only_forum_tagged', TRUE) || advanced_forum_is_forum_tagged($node, TRUE)) {

          // ...Send back -42 as a special code to say that this should be
          // styled but that it isn't the actual node id.
          return -42;
        }
      }
    }
  }
}