http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89776

Revision: 89776
Author:   catrope
Date:     2011-06-09 17:29:40 +0000 (Thu, 09 Jun 2011)
Log Message:
-----------
Limit problem articles to 50 and fix comment. This only pulls the first, more 
or less random, 50 problem articles, not the 50 most problematic ones

Modified Paths:
--------------
    trunk/extensions/ArticleFeedback/populateAFStatistics.php

Modified: trunk/extensions/ArticleFeedback/populateAFStatistics.php
===================================================================
--- trunk/extensions/ArticleFeedback/populateAFStatistics.php   2011-06-09 
17:15:54 UTC (rev 89775)
+++ trunk/extensions/ArticleFeedback/populateAFStatistics.php   2011-06-09 
17:29:40 UTC (rev 89776)
@@ -189,6 +189,7 @@
                
                $rows = array();
                $cur_ts = $this->dbw->timestamp();
+               $count = 0;
                foreach( $problems as $page_id ) {
                        $page = $this->pages->getPage( $page_id );
                        $rows[] = array(
@@ -198,6 +199,13 @@
                                'afs_ts' => $cur_ts,
                                'afs_stats_type_id' => $stats_type_id,
                        );
+                       
+                       $count++;
+                       if ( $count >= 50 ) {
+                               // No more than 50
+                               // TODO: Get the 50 most problematic articles 
rather than 50 random problematic ones
+                               break;
+                       }
                }
                $this->output( "Done.\n" );
                
@@ -540,7 +548,7 @@
        /**
         * Determine whether this article is  'problematic'
         *
-        * If a page has one more rating categories where 70% of the ratings 
are 
+        * If a page has one or more rating categories where 70% of the ratings 
are 
         * <= 2, it is considered problematic.
         */
        public function determineProblematicStatus() {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to