annotate cache/README.txt @ 1:948362c2a207 ad

update advertisement
author pierre
date Thu, 02 Apr 2009 15:28:21 +0000
parents
children
rev   line source
pierre@1 1
pierre@1 2 Cache hook format:
pierre@1 3 $cache['hook_name'] = array(
pierre@1 4 'weight' => integer, // optional
pierre@1 5 'file' => '/full/path/to/include/file',
pierre@1 6 'function' => 'function_name',
pierre@1 7 );
pierre@1 8
pierre@1 9 Supported hooks:
pierre@1 10
pierre@1 11 - hook_init
pierre@1 12 Alter which advertisements are selecting from.
pierre@1 13
pierre@1 14 - hook_filter
pierre@1 15 Filter out invalid advertisements.
pierre@1 16
pierre@1 17 - hook_select
pierre@1 18 Alter how advertisements are selected.
pierre@1 19
pierre@1 20 OLD README (this may not be accurate anymore):
pierre@1 21 TODO: Update.
pierre@1 22 Ad caches are defined through external modules. Ad caches are composed of a
pierre@1 23 module 'ad_cache_TYPE.module' and an include file 'ad_cache_TYPE.inc' that live
pierre@1 24 in the 'cache/TYPE' subdirectory where 'TYPE' is replaced with the type of
pierre@1 25 cache. For example, the included file cache lives in 'cache/file'.
pierre@1 26
pierre@1 27 The ad_cache_TYPE.inc file must have a function named ad_cache_TYPE() which is
pierre@1 28 used to display ads. It can optionally include a function titled
pierre@1 29 ad_cache_TYPE_variables used to extract any necessary variables from the global
pierre@1 30 $_GET array (this can also be used to override values that would normally be
pierre@1 31 set from $_GET). Any functions used by this code without bootstrapping Drupal
pierre@1 32 should also be in this file.
pierre@1 33
pierre@1 34 The ad_cache_TYPE.module file should define the drupal _help() hook so the
pierre@1 35 module can be enabled. It should also define the _adcacheapi() hook allowing
pierre@1 36 for configuration and processing. Any functions used by this code after
pierre@1 37 bootstrapping Drupal should also be in this module.
pierre@1 38
pierre@1 39 Refer to cache/file/* for an implementation example.