| 1 |
<?php |
<?php |
| 2 |
|
// $Id$ |
| 3 |
|
|
| 4 |
/** |
/** |
|
* $Id: content_refresh.module,v 1.1 2008/09/05 19:25:51 yaph Exp $ |
|
|
* |
|
| 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 for various content related actions. |
|
* |
|
| 8 |
*/ |
*/ |
| 9 |
|
|
| 10 |
/** |
/** |
| 72 |
function content_refresh_clear_front_page_cache() { |
function content_refresh_clear_front_page_cache() { |
| 73 |
$front = variable_get('site_frontpage', 'node'); |
$front = variable_get('site_frontpage', 'node'); |
| 74 |
$url = url($front, array('absolute' => TRUE)); |
$url = url($front, array('absolute' => TRUE)); |
| 75 |
# also clear pager pages |
cache_clear_all($url, 'cache_page'); |
| 76 |
|
# clear pager pages |
| 77 |
cache_clear_all($url . '?page', 'cache_page', TRUE); |
cache_clear_all($url . '?page', 'cache_page', TRUE); |
| 78 |
if ('node' == $front) { |
# clear cache entry for the front page entry without the site_frontpage value appended |
| 79 |
$url = preg_replace("%$front$%", '', $url); |
$url = preg_replace("%$front$%", '', $url); |
| 80 |
cache_clear_all($url, 'cache_page', FALSE); |
cache_clear_all($url, 'cache_page', FALSE); |
|
} |
|
| 81 |
} |
} |
| 82 |
|
|
| 83 |
/** |
/** |