/[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.7, Wed Sep 10 21:06:52 2008 UTC revision 1.8, Wed Oct 15 09:53:45 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: content_refresh.module,v 1.6 2008/09/10 20:53:57 yaph Exp $  // $Id: content_refresh.module,v 1.7 2008/09/10 21:06:52 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    switch ($op) {    global $user;
105      case 'insert':    // check wheter user is anonymous and is allowed to post comments without approval
106      case 'update':    if (0 == $user->uid && user_access('post comments without approval')) {
107        $nid = $a1['nid'];      switch ($op) {
108        break;        case 'insert':
109      case 'unpublish':        case 'update':
110      case 'delete':          $nid = $a1['nid'];
111        $nid = $a1->nid;          break;
112        break;        case 'unpublish':
113    }        case 'delete':
114    if ($nid) {          $nid = $a1->nid;
115      // retrieve the absolute url for the node          break;
116      $options = array('absolute' => TRUE);      }
117      $url = url('node/'. $nid, $options);      if ($nid) {
118      // delete cache entries for that url        // retrieve the absolute url for the node
119      cache_clear_all($url, 'cache_page');        $options = array('absolute' => TRUE);
120          $url = url('node/'. $nid, $options);
121          // delete cache entries for that url
122          cache_clear_all($url, 'cache_page');
123        }
124    }    }
125  }  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.2