/[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.9, Sat Aug 15 18:42:45 2009 UTC revision 1.10, Fri Aug 21 19:47:13 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: content_refresh.module,v 1.8 2008/10/15 09:53:45 yaph Exp $  // $Id: content_refresh.module,v 1.9 2009/08/15 18:42:45 yaph Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 101  function content_refresh_clear_front_pag Line 101  function content_refresh_clear_front_pag
101   * Implementation of hook_comment().   * Implementation of hook_comment().
102   */   */
103  function content_refresh_comment($a1, $op) {  function content_refresh_comment($a1, $op) {
104    global $user;    $nid = false;
105    // check wheter user is anonymous    $uid = false;
106    if (0 == $user->uid) {    switch ($op) {
107      switch ($op) {      case 'insert':
108        case 'insert':      case 'update':
109        case 'update':        $nid = $a1['nid'];
110          $nid = $a1['nid'];        $uid = $a1['uid'];
111          break;        break;
112        case 'publish':      case 'publish':
113        case 'unpublish':      case 'unpublish':
114        case 'delete':      case 'delete':
115          $nid = $a1->nid;        $nid = $a1->nid;
116          break;        $uid = $a1->uid;
117      }        break;
118      if ($nid) {    }
119        // retrieve the absolute url for the node    if ($nid !== false && 0 === $uid) {
120        $options = array('absolute' => TRUE);      // retrieve the absolute url for the node
121        $url = url('node/'. $nid, $options);      $options = array('absolute' => TRUE);
122        // delete cache entries for that url      $url = url('node/'. $nid, $options);
123        cache_clear_all($url, 'cache_page');      // delete cache entries for that url
124      }      cache_clear_all($url, 'cache_page');
125    }    }
126  }  }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.2