function adserve_ad in Advertisement 5.2
Same name and namespace in other branches
- 5 adserve.inc \adserve_ad()
- 6.3 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 22
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 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)
adserve_cache('display', $ids);
}