* Add a nice fieldset to the input form to be consistent with other forms.
[lhc/web/wiklou.git] / maintenance / nukePage.inc
index b2ce6b8..804651b 100644 (file)
@@ -11,7 +11,7 @@ require_once( 'purgeOldText.inc' );
 
 function NukePage( $name, $delete = false ) {
 
-       $dbw =& wfGetDB( DB_MASTER );
+       $dbw = wfGetDB( DB_MASTER );
        $dbw->begin();
        
        $tbl_pag = $dbw->tableName( 'page' );
@@ -64,7 +64,7 @@ function NukePage( $name, $delete = false ) {
 
 function DeleteRevisions( $ids ) {
 
-       $dbw =& wfGetDB( DB_MASTER );
+       $dbw = wfGetDB( DB_MASTER );
        $dbw->begin();
        
        $tbl_rev = $dbw->tableName( 'revision' );
@@ -73,6 +73,14 @@ function DeleteRevisions( $ids ) {
        $dbw->query( "DELETE FROM $tbl_rev WHERE rev_id IN ( $set )" );
        
        $dbw->commit(); 
+
+       #TODO: see if this is a "good" page, to decrement that as well.
+       $pages = $dbw->selectField('site_stats', 'ss_total_pages');
+       $pages--;
+       $dbw->update( 'site_stats', 
+                     array('ss_total_pages' => $pages ), 
+                     array( 'ss_row_id' => 1),
+                     __METHOD__ );
        
 }