| 1 |
<?php |
<?php |
| 2 |
// $Id: content_refresh.module,v 1.5 2008/09/10 20:17:57 yaph Exp $ |
// $Id: content_refresh.module,v 1.6 2008/09/10 20:53:57 yaph Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 6 |
* Author: Ramiro Gómez - http://www.ramiro.org |
* Author: Ramiro Gómez - http://www.ramiro.org |
| 7 |
* A Drupal module that provides cache clearing functionality for various content related actions. |
* A Drupal module that provides cache clearing functionality |
| 8 |
|
* for various content related actions. |
| 9 |
*/ |
*/ |
| 10 |
|
|
| 11 |
/** |
/** |
| 90 |
$front = variable_get('site_frontpage', 'node'); |
$front = variable_get('site_frontpage', 'node'); |
| 91 |
$url = url($front, array('absolute' => TRUE)); |
$url = url($front, array('absolute' => TRUE)); |
| 92 |
cache_clear_all($url, 'cache_page'); |
cache_clear_all($url, 'cache_page'); |
| 93 |
# clear pager pages |
// clear pager pages |
| 94 |
cache_clear_all($url . '?page', 'cache_page', TRUE); |
cache_clear_all($url . '?page', 'cache_page', TRUE); |
| 95 |
# clear cache entry for the front page entry without the site_frontpage value appended |
// clear cache entry for the front page entry without the site_frontpage value appended |
| 96 |
$url = preg_replace("%$front$%", '', $url); |
$url = preg_replace("%$front$%", '', $url); |
| 97 |
cache_clear_all($url, 'cache_page', FALSE); |
cache_clear_all($url, 'cache_page', FALSE); |
| 98 |
} |
} |