You are here

function ip_posts_insert in IP address manager 6

Same name and namespace in other branches
  1. 7.2 ip.module \ip_posts_insert()
  2. 7 ip.module \ip_posts_insert()

Insert a record into the cave_tracker table.

4 calls to ip_posts_insert()
ip_backlog_comments in ./ip.module
Handle backlog of comments.
ip_backlog_nodes in ./ip.module
Handle backlog of nodes.
ip_comment in ./ip.module
Implementation of hook_comment().
ip_nodeapi in ./ip.module
Implementation of hook_nodeapi().

File

./ip.module, line 283
IP address manager module.

Code

function ip_posts_insert($type, $id, $ip_address = NULL) {
  $ip_address = is_null($ip_address) ? ip_address() : $ip_address;
  $sql = "INSERT INTO {ip_posts} (type, id, ip) VALUES ('%s', %d, %d)";
  $args = array(
    $type,
    $id,
    ip2long($ip_address),
  );
  db_query($sql, $args);
}