You are here

function spambot_nodeapi in Spambot 6.3

Implementation of hook_nodeapi()

Updates the node_spambot table to remember the ip address of node creation.

File

./spambot.module, line 125

Code

function spambot_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  global $user;
  switch ($op) {
    case 'insert':
      db_query("INSERT INTO {node_spambot} (nid, uid, hostname) VALUES (%d, %d, '%s')", $node->nid, $node->uid, ip_address());
      break;
    case 'delete':
      db_query("DELETE FROM {node_spambot} where nid = %d", $node->nid);
      break;
  }
}