Mercurial > defr > drupal > ad
comparison adserve.inc @ 7:6aeff3329e01 ad
maj module ad 2.1rc1
author | piotre |
---|---|
date | Mon, 20 Jul 2009 13:54:40 +0000 |
parents | e5584a19768b |
children |
comparison
equal
deleted
inserted
replaced
6:b7653861e0b4 | 7:6aeff3329e01 |
---|---|
1 <?php | 1 <?php |
2 // $Id: adserve.inc,v 1.1.2.31.2.8.2.7 2009/04/09 14:06:27 jeremy Exp $ | 2 // $Id: adserve.inc,v 1.1.2.31.2.8.2.8 2009/05/07 13:52:13 jeremy Exp $ |
3 | 3 |
4 /** | 4 /** |
5 * @file | 5 * @file |
6 * Configuration. | 6 * Configuration. |
7 * | 7 * |
138 } | 138 } |
139 | 139 |
140 if (!isset($cache_loaded[$variables->adcache])) { | 140 if (!isset($cache_loaded[$variables->adcache])) { |
141 // Retrieve variables defined by cache plugin, if enabled. | 141 // Retrieve variables defined by cache plugin, if enabled. |
142 if ($variables->adcache != 'none') { | 142 if ($variables->adcache != 'none') { |
143 $include = $variables->ad_dir ."/cache/$variables->adcache/ad_cache_$variables->adcache.inc"; | 143 $includes = array($variables->ad_dir ."/cache/$variables->adcache/ad_cache_$variables->adcache.inc", $variables->ad_dir ."/../ad_$variables->adcache/ad_cache_$variables->adcache.inc"); |
144 if (file_exists($include)) { | 144 foreach ($includes as $include) { |
145 if ($variables->debug) { | 145 if (file_exists($include)) { |
146 echo "Attempting to include cache include file '$include'.<br />\n"; | 146 if ($variables->debug) { |
147 echo "Attempting to include cache include file '$include'.<br />\n"; | |
148 } | |
149 require_once($include); | |
147 } | 150 } |
148 require_once($include); | 151 else if ($variables->debug) { |
149 } | 152 echo "Failed to find cache include file '$include'.<br />\n"; |
150 else if ($variables->debug) { | |
151 echo "Failed to find cache include file '$include'.<br />\n"; | |
152 } | |
153 $function = 'ad_cache_'. $variables->adcache .'_variables'; | |
154 if (function_exists($function)) { | |
155 $external_variables = $function(); | |
156 foreach ($external_variables as $key => $val) { | |
157 if (!isset($variables->$key)) { | |
158 $variables->$key = $val; | |
159 } | |
160 } | 153 } |
154 $function = 'ad_cache_'. $variables->adcache .'_variables'; | |
155 if (function_exists($function)) { | |
156 $external_variables = $function(); | |
157 foreach ($external_variables as $key => $val) { | |
158 if (!isset($variables->$key)) { | |
159 $variables->$key = $val; | |
160 } | |
161 } | |
162 } | |
161 } | 163 } |
162 } | 164 } |
163 $cache_loaded[$variables->adcache] = TRUE; | 165 $cache_loaded[$variables->adcache] = TRUE; |
164 } | 166 } |
165 | 167 |