Mercurial > defr > drupal > ad
diff adserve.inc @ 7:6aeff3329e01 ad
maj module ad 2.1rc1
author | piotre |
---|---|
date | Mon, 20 Jul 2009 13:54:40 +0000 |
parents | e5584a19768b |
children |
line wrap: on
line diff
--- a/adserve.inc Thu May 28 14:53:07 2009 +0000 +++ b/adserve.inc Mon Jul 20 13:54:40 2009 +0000 @@ -1,5 +1,5 @@ <?php -// $Id: adserve.inc,v 1.1.2.31.2.8.2.7 2009/04/09 14:06:27 jeremy Exp $ +// $Id: adserve.inc,v 1.1.2.31.2.8.2.8 2009/05/07 13:52:13 jeremy Exp $ /** * @file @@ -140,24 +140,26 @@ if (!isset($cache_loaded[$variables->adcache])) { // Retrieve variables defined by cache plugin, if enabled. if ($variables->adcache != 'none') { - $include = $variables->ad_dir ."/cache/$variables->adcache/ad_cache_$variables->adcache.inc"; - if (file_exists($include)) { - if ($variables->debug) { - echo "Attempting to include cache include file '$include'.<br />\n"; + $includes = array($variables->ad_dir ."/cache/$variables->adcache/ad_cache_$variables->adcache.inc", $variables->ad_dir ."/../ad_$variables->adcache/ad_cache_$variables->adcache.inc"); + foreach ($includes as $include) { + if (file_exists($include)) { + if ($variables->debug) { + echo "Attempting to include cache include file '$include'.<br />\n"; + } + require_once($include); } - require_once($include); - } - else if ($variables->debug) { - echo "Failed to find cache include file '$include'.<br />\n"; - } - $function = 'ad_cache_'. $variables->adcache .'_variables'; - if (function_exists($function)) { - $external_variables = $function(); - foreach ($external_variables as $key => $val) { - if (!isset($variables->$key)) { - $variables->$key = $val; - } + else if ($variables->debug) { + echo "Failed to find cache include file '$include'.<br />\n"; } + $function = 'ad_cache_'. $variables->adcache .'_variables'; + if (function_exists($function)) { + $external_variables = $function(); + foreach ($external_variables as $key => $val) { + if (!isset($variables->$key)) { + $variables->$key = $val; + } + } + } } } $cache_loaded[$variables->adcache] = TRUE;