You are here

function ad_uniqid in Advertisement 7.3

Return a unique string which can be used to identify an event.

Parameters

string $type: The type of unique id.

Return value

string A unique string.

3 calls to ad_uniqid()
ad_get_ads in ./ad.module
Callback for the Ajax request to get ads.
ad_session_start in ./ad.session.inc
@file Code for the ad cookie tracking.
ad_track_event in ./ad.module
Track an event, like a click or an impression.

File

./ad.module, line 603
Core code for the ad module.

Code

function ad_uniqid($type) {

  // If serving from multiple server, use a different value for each server to
  // avoid duplicates.
  $prefix = $type . '.' . variable_get('ad_uniqid_prefix', $_SERVER['HTTP_HOST']);
  $uniqid = uniqid($prefix . '.', TRUE);
  return hash('sha256', $uniqid);
}