function ad_host_id_create in Advertisement 6
Same name and namespace in other branches
- 5 ad.module \ad_host_id_create()
Create a unique host id for each ad owner, used when displaying ads remotely.
2 calls to ad_host_id_create()
- ad_owners_nodeapi in owners/
ad_owners.module - Implementation of hook_nodeapi().
- ad_remote_form in remote/
ad_remote.module - A simple page providing source snippets for displaying ads on remote websites. When form is being submitted, it rebuilds with needed code snippet.
File
- owners/
ad_owners.module, line 347 - Enhances the ad module to support ad owners.
Code
function ad_host_id_create($uid) {
$hostid = db_result(db_query('SELECT hostid FROM {ad_hosts} WHERE uid = %d', $uid));
if (!$hostid) {
$hostid = md5($uid . time());
db_query("INSERT INTO {ad_hosts} (uid, hostid) VALUES (%d, '%s')", $uid, md5($uid . time()));
}
return $hostid;
}