You are here

function record_shorten_shorten_create in Shorten URLs 7

Same name and namespace in other branches
  1. 8.2 modules/record_shorten/record_shorten.module \record_shorten_shorten_create()
  2. 8 modules/record_shorten/record_shorten.module \record_shorten_shorten_create()
  3. 6 record_shorten.module \record_shorten_shorten_create()
  4. 7.2 record_shorten.module \record_shorten_shorten_create()

Implements hook_shorten_create().

File

./record_shorten.module, line 38
Records shortened URLs.

Code

function record_shorten_shorten_create($old, $new, $service) {
  $array = array(
    'original' => $old,
    'short' => $new,
    'service' => $service,
    'uid' => $GLOBALS['user']->uid,
    'hostname' => ip_address(),
    'created' => REQUEST_TIME,
  );
  drupal_write_record('record_shorten', $array);
}