You are here

function _prev_next_node_types_sql in Previous/Next API 6

Same name and namespace in other branches
  1. 7.2 prev_next.module \_prev_next_node_types_sql()
  2. 7 prev_next.module \_prev_next_node_types_sql()
3 calls to _prev_next_node_types_sql()
prev_next_admin in ./prev_next.module
Menu callback argument. Creates the prev_next administration form.
prev_next_cron in ./prev_next.module
Implementation of hook_cron().
_prev_next_add in ./prev_next.module
Create or update the prev_next records.

File

./prev_next.module, line 569

Code

function _prev_next_node_types_sql($node_type = '') {
  $same_type = variable_get(PREV_NEXT_NODE_TYPE . $node_type . '_same_type', 0);
  if (!$same_type) {
    $types = _prev_next_node_types();
    $quoted_types = array();
    foreach (_prev_next_node_types() as $type) {
      $quoted_types[] = "'" . $type . "'";
    }
    $cond = '';
    if (count($types)) {
      $cond = ' AND type IN (' . implode(',', $quoted_types) . ')';
    }
  }
  else {
    $cond = " AND type = '" . $node_type . "'";
  }
  return $cond;
}