You are here

function _discussthis_set_topic in Discuss This! 7.2

Same name and namespace in other branches
  1. 5 discussthis.module \_discussthis_set_topic()
  2. 7 discussthis.node.inc \_discussthis_set_topic()

Save a node to topic association

This function stores a mapping between the given node (nid) and a forum topic (tid). Helps to configure individually each node.

Parameters

$discussthis_topic The array to save in the discussthis_forums table:

2 calls to _discussthis_set_topic()
discussthis_create_discussion_form_submit in ./discussthis.discussion.inc
Save the new comment.
field_discussthis_form_validate in ./discussthis.fields.inc
Validate the individual fields and then convert them into a single HTML RGB value as text.

File

./discussthis.node.inc, line 195
File with node discussion display methods.

Code

function _discussthis_set_topic($nid, $topic_nid) {
  db_merge('discussthis')
    ->key(array(
    'nid' => $nid,
  ))
    ->fields(array(
    'nid' => $nid,
    'topic_nid' => $topic_nid,
  ))
    ->execute();
}