You are here

function _discussthis_get_node in Discuss This! 5

1 call to _discussthis_get_node()
discussthis_nodeapi in ./discussthis.module
hook_nodeapi implementation This is the meat of the module. Here we add the Discuss This link which will create a new forum topic if none exists, or link to the existing one if it does. Also adds forum override dropdown on add/edit screen for users…

File

./discussthis.module, line 570

Code

function _discussthis_get_node($topic_nid) {
  $sql = 'SELECT nid FROM {discussthis} WHERE topic_nid=%d';
  $nid = db_result(db_query($sql, $topic_nid));
  if ($nid) {
    return $nid;
  }
  else {
    return 0;
  }
}