You are here

function anonymous_publishing_pet_comment_insert in Anonymous Publishing 7

Implements hook_comment_insert().

File

modules/pet/anonymous_publishing_pet.module, line 402
Main hooks for Anonymous Publishing PET module.

Code

function anonymous_publishing_pet_comment_insert($content) {
  global $user;
  if (user_is_logged_in() && isset($content->anonymous_publishing['options'])) {
    $asanon = $content->anonymous_publishing['options'];
    if ($asanon) {
      db_insert('anonymous_publishing_realname')
        ->fields(array(
        'nid' => $content->nid,
        'cid' => $content->cid,
        'uid' => $user->uid,
      ))
        ->execute();
    }
  }
}