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