You are here

function _discussthis_get_forum in Discuss This! 5

Same name and namespace in other branches
  1. 6 discussthis.module \_discussthis_get_forum()
  2. 7.2 discussthis.node.inc \_discussthis_get_forum()
  3. 7 discussthis.node.inc \_discussthis_get_forum()

Lookup the given nid in the discussthis_forums db table, and return the corresponding forum tid, otherwise 0

2 calls to _discussthis_get_forum()
discussthis_form_alter in ./discussthis.module
hook_form_alter implementation Adds per-node override forum dropdown and topic autocomplete form for node edit forms
discussthis_new in ./discussthis.module

File

./discussthis.module, line 541

Code

function _discussthis_get_forum($nid, $type) {
  $sql = 'SELECT forum_tid FROM {discussthis_forums} WHERE nid=%d';
  $forum_tid = db_result(db_query($sql, $nid));
  if (!$forum_tid) {
    $forum_tid = variable_get('discussthis_node_' . $type, 0);
  }
  return $forum_tid;
}