You are here

function themekey_comment_cid2nid in ThemeKey 6.2

Same name and namespace in other branches
  1. 6.4 modules/themekey.comment.inc \themekey_comment_cid2nid()
  2. 6 modules/themekey.comment.inc \themekey_comment_cid2nid()
  3. 6.3 modules/themekey.comment.inc \themekey_comment_cid2nid()
  4. 7.3 modules/themekey.comment.inc \themekey_comment_cid2nid()
  5. 7 modules/themekey.comment.inc \themekey_comment_cid2nid()
  6. 7.2 modules/themekey.comment.inc \themekey_comment_cid2nid()

ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).

src: comment:cid dst: node:nid

Parameters

$nid: a comment id

Return value

a node id or NULL if no value could be mapped

1 string reference to 'themekey_comment_cid2nid'
themekey_comment_themekey_properties in modules/themekey.comment.inc
Implements hook_themekey_properties().

File

modules/themekey.comment.inc, line 66
Provides some comment attributes as ThemeKey properties.

Code

function themekey_comment_cid2nid($cid) {
  $nid = db_result(db_query('SELECT nid FROM {comments} WHERE cid = %d', $cid));
  return $nid ? $nid : NULL;
}