Mercurial > defr > drupal > ad
comparison imageserve.inc @ 2:e5584a19768b ad
maj module ad
author | sly |
---|---|
date | Wed, 15 Apr 2009 07:58:32 +0000 |
parents | d8a3998dac8e |
children | 6aeff3329e01 |
comparison
equal
deleted
inserted
replaced
1:948362c2a207 | 2:e5584a19768b |
---|---|
1 <?php | 1 <?php |
2 // $Id: imageserve.inc,v 1.1.2.8.2.2 2009/02/16 17:06:47 jeremy Exp $ | 2 // $Id: imageserve.inc,v 1.1.2.8.2.2.2.1 2009/04/09 14:06:27 jeremy Exp $ |
3 | 3 |
4 /** | 4 /** |
5 * @file | 5 * @file |
6 * Image serving lib. | 6 * Image serving lib. |
7 * | 7 * |
15 */ | 15 */ |
16 function adserve_counter_image() { | 16 function adserve_counter_image() { |
17 adserve_variable('variable_load'); | 17 adserve_variable('variable_load'); |
18 adserve_bootstrap(0); | 18 adserve_bootstrap(0); |
19 | 19 |
20 $ad->aid = adserve_variable('aid'); | 20 if (adserve_variable('aid')) { |
21 if ($ad->aid) { | 21 $ad->aid = adserve_variable('aid'); |
22 adserve_increment($ad); | 22 } |
23 if (isset($ad->aid) && $ad->aid) { | |
24 _debug_echo("adserve_counter_image: increment 'view' counter for aid: $ad->aid"); | |
25 adserve_cache('increment', 'view', $ad->aid); | |
23 } | 26 } |
24 else { | 27 else { |
25 adserve_increment($ad, 'count'); | 28 _debug_echo("adserve_counter_image: increment 'count' counter for no aid"); |
29 adserve_cache('increment', 'count', NULL); | |
26 } | 30 } |
27 | 31 |
28 if (function_exists('imagecreate')) { | 32 if (function_exists('imagecreate')) { |
29 $image = imagecreate(1, 1); | 33 $image = imagecreate(1, 1); |
30 // Tell the web browser not to cache this image so we register a count each | 34 // Tell the web browser not to cache this image so we register a count each |