Added "is_draft != 1" where appropriate in SQL queries to prevent drafts from being treated as real revisions.
authorDan
Tue, 12 Feb 2008 00:42:29 -0500
changeset 414 818b4cd12b8b
parent 413 6607cd646d6d
child 415 c8d0eaa4c0b1
Added "is_draft != 1" where appropriate in SQL queries to prevent drafts from being treated as real revisions.
includes/pageutils.php
plugins/SpecialRecentChanges.php
plugins/SpecialUserFuncs.php
--- a/includes/pageutils.php	Tue Feb 12 00:37:46 2008 -0500
+++ b/includes/pageutils.php	Tue Feb 12 00:42:29 2008 -0500
@@ -342,7 +342,7 @@
     $wiki = ( ( $paths->pages[$pname]['wiki_mode'] == 2 && getConfig('wiki_mode') == '1') || $paths->pages[$pname]['wiki_mode'] == 1) ? true : false;
     $prot = ( ( $paths->pages[$pname]['protected'] == 2 && $session->user_logged_in && $session->reg_time + 60*60*24*4 < time() ) || $paths->pages[$pname]['protected'] == 1) ? true : false;
     
-    $q = 'SELECT time_id,date_string,page_id,namespace,author,edit_summary,minor_edit FROM ' . table_prefix.'logs WHERE log_type=\'page\' AND action=\'edit\' AND page_id=\'' . $page_id . '\' AND namespace=\'' . $namespace . '\' ORDER BY time_id DESC;';
+    $q = 'SELECT time_id,date_string,page_id,namespace,author,edit_summary,minor_edit FROM ' . table_prefix.'logs WHERE log_type=\'page\' AND action=\'edit\' AND page_id=\'' . $page_id . '\' AND namespace=\'' . $namespace . '\' AND is_draft != 1 ORDER BY time_id DESC;';
     if(!$db->sql_query($q)) $db->_die('The history data for the page "' . $paths->cpage['name'] . '" could not be selected.');
     echo $lang->get('history_page_subtitle') . '
           <h3>' . $lang->get('history_heading_edits') . '</h3>';
--- a/plugins/SpecialRecentChanges.php	Tue Feb 12 00:37:46 2008 -0500
+++ b/plugins/SpecialRecentChanges.php	Tue Feb 12 00:42:29 2008 -0500
@@ -73,8 +73,9 @@
     l1.time_id AS currev_time, l2.time_id AS oldrev_time
   FROM ' . table_prefix . 'logs AS l1
   LEFT JOIN ' . table_prefix . 'logs AS l2                                                    
-    ON ( l1.log_type = l2.log_type AND l1.action = \'edit\' AND l1.action = l2.action AND l2.time_id < l1.time_id AND l1.page_id = l2.page_id AND l1.namespace = l2.namespace )
+    ON ( l1.log_type = l2.log_type AND l1.action = \'edit\' AND l1.action = l2.action AND l2.time_id < l1.time_id AND l1.page_id = l2.page_id AND l1.namespace = l2.namespace AND l2.is_draft != 1 )
   WHERE l2.time_id IS NOT NULL' . $where_extra . '
+        AND l1.is_draft != 1
   GROUP BY oldrev_time
   ORDER BY l1.time_id DESC, l2.time_id DESC;';
   }
--- a/plugins/SpecialUserFuncs.php	Tue Feb 12 00:37:46 2008 -0500
+++ b/plugins/SpecialUserFuncs.php	Tue Feb 12 00:42:29 2008 -0500
@@ -1021,7 +1021,7 @@
   }
   
   $user = $db->escape($user);
-  $q = 'SELECT log_type, time_id, action, date_string, page_id, namespace, author, edit_summary, minor_edit, page_id, namespace, ( action = \'edit\' ) AS is_edit FROM '.table_prefix.'logs WHERE author=\''.$user.'\' AND log_type=\'page\' ORDER BY is_edit DESC, time_id DESC;';
+  $q = 'SELECT log_type, time_id, action, date_string, page_id, namespace, author, edit_summary, minor_edit, page_id, namespace, ( action = \'edit\' ) AS is_edit FROM '.table_prefix.'logs WHERE author=\''.$user.'\' AND log_type=\'page\' AND is_draft != 1 ORDER BY is_edit DESC, time_id DESC;';
   $q = $db->sql_query($q);
   if ( !$q )
     $db->_die('SpecialUserFuncs selecting contribution data');