/[drupal]/contributions/modules/content_refresh/content_refresh.module
ViewVC logotype

Diff of /contributions/modules/content_refresh/content_refresh.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2, Fri Sep 5 21:22:47 2008 UTC revision 1.3, Fri Sep 5 22:25:54 2008 UTC
# Line 1  Line 1 
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  /**  /**
# Line 73  function content_refresh_nodeapi(&$node, Line 72  function content_refresh_nodeapi(&$node,
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  /**  /**

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.2