[ Index ] |
|
Code source de Drupal 5.3 |
1 <?php 2 // $Id: comment.install,v 1.2.2.1 2007/06/20 07:14:21 drumm Exp $ 3 4 /** 5 * Implementation of hook_enable(). 6 */ 7 function comment_enable() { 8 // Insert records into the node_comment_statistics for nodes that are missing. 9 db_query_temporary("SELECT n.nid, n.changed, n.uid FROM {node} n LEFT JOIN {node_comment_statistics} c ON n.nid = c.nid WHERE c.comment_count IS NULL", 'missing_nids'); 10 db_query("INSERT INTO {node_comment_statistics} (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) SELECT n.nid, n.changed, NULL, n.uid, 0 FROM missing_nids n"); 11 } 12 13 /** 14 * Changed node_comment_statistics to use node->changed to avoid future 15 * timestamps. 16 */ 17 function comment_update_1() { 18 // Change any future last comment timestamps to now. 19 db_query('UPDATE {node_comment_statistics} SET last_comment_timestamp = %d WHERE last_comment_timestamp > %d', time(), time()); 20 21 // Unstuck node indexing timestamp if needed. 22 if (($last = variable_get('node_cron_last', FALSE)) !== FALSE) { 23 variable_set('node_cron_last', min(time(), $last)); 24 } 25 return array(); 26 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Nov 30 16:20:15 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |