You are here

function ip_posts_insert in IP address manager 7

Same name and namespace in other branches
  1. 6 ip.module \ip_posts_insert()
  2. 7.2 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_insert in ./ip.module
Implements hook_comment_insert().
ip_node_insert in ./ip.module
Implements hook_node_insert().

File

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

Code

function ip_posts_insert($type, $id, $ip_address = NULL) {
  $ip_address = is_null($ip_address) ? ip_address() : $ip_address;
  $iplong = ip2long($ip_address);
  if (!empty($iplong)) {
    return db_insert('ip_posts')
      ->fields(array(
      'type' => $type,
      'id' => $id,
      'ip' => $iplong,
    ))
      ->execute();
  }
}