function adserve_ad in Advertisement 6.3
Same name and namespace in other branches
- 5.2 adserve.inc \adserve_ad()
- 5 adserve.inc \adserve_ad()
- 6 adserve.inc \adserve_ad()
- 6.2 adserve.inc \adserve_ad()
- 7 adserve.inc \adserve_ad()
The main adserve logic.
2 calls to adserve_ad()
File
- ./
adserve.inc, line 31 - Configuration.
Code
function adserve_ad($options = array()) {
static $displayed_count = 0;
// if no $options are passed in, assume we're using JavaScript
if (!empty($options)) {
adserve_variable('variable_load', $options);
}
else {
adserve_variable('variable_load');
}
// include Drupal's settings.php
adserve_bootstrap(0);
// if debug enabled, dump current state
adserve_debug();
// start with 'error' set to false
adserve_variable('error', FALSE);
// invoke cache function (file already included in adserve_variable)
$ids = adserve_cache('get_ad_ids');
// display the advertisement(s)
return adserve_cache('display', $ids);
}