https://www.mediawiki.org/wiki/Special:Code/MediaWiki/102095

Revision: 102095
Author:   ashley
Date:     2011-11-05 14:05:38 +0000 (Sat, 05 Nov 2011)
Log Message:
-----------
SocialProfile: remove updateCreatedOpinionsCount() and 
updatePublishedOpinionsCount() from UserStatsTrack class. 
updateCreatedOpinionsCount() is now a part of the BlogPage extension (because 
extensions should remain as self-contained as possible) and 
updatePublishedOpinionsCount() is simply gone. Ping r94282.

Modified Paths:
--------------
    trunk/extensions/SocialProfile/UserStats/UserStatsClass.php

Modified: trunk/extensions/SocialProfile/UserStats/UserStatsClass.php
===================================================================
--- trunk/extensions/SocialProfile/UserStats/UserStatsClass.php 2011-11-05 
14:00:22 UTC (rev 102094)
+++ trunk/extensions/SocialProfile/UserStats/UserStatsClass.php 2011-11-05 
14:05:38 UTC (rev 102095)
@@ -397,82 +397,6 @@
        }
 
        /**
-        * Updates the amount of created opinions by the current user.
-        * Currently this is ugly, unused and a leftover from ArmchairGM days.
-        */
-       function updateCreatedOpinionsCount() {
-               global $wgUser, $wgOut;
-               if ( !$wgUser->isAnon() && $this->user_id ) {
-                       $ctg = 'Opinions by User ' . ( $this->user_name );
-                       $parser = new Parser();
-                       $ctgTitle = Title::newFromText(
-                               $parser->preprocess( trim( $ctg ), 
$wgOut->getTitle(), $wgOut->parserOptions() )
-                       );
-                       $ctgTitle = $ctgTitle->getDBkey();
-                       $dbw = wfGetDB( DB_MASTER );
-
-                       $opinions = $dbw->select(
-                               array( 'page', 'categorylinks' ),
-                               array( 'COUNT(*) AS CreatedOpinions' ),
-                               array( 'cl_to' => $ctgTitle ),
-                               __METHOD__,
-                               array(),
-                               array(
-                                       'categorylinks' => array( 'INNER JOIN', 
'page_id = cl_from' ),
-                               )
-                       );
-
-                       $res = $dbw->update(
-                               'user_stats',
-                               array( 'stats_opinions_created' => 
$opinions->CreatedOpinions ),
-                               array( 'stats_user_id' => $this->user_id ),
-                               __METHOD__
-                       );
-
-                       $this->clearCache();
-               }
-       }
-
-       /**
-        * Updates the amount of published opinions by the current user.
-        * Currently this is ugly, unused and a leftover from ArmchairGM days.
-        */
-       function updatePublishedOpinionsCount() {
-               global $wgOut;
-
-               $parser = new Parser();
-               $dbw = wfGetDB( DB_MASTER );
-               $ctg = 'Opinions by User ' . ( $this->user_name );
-               $ctgTitle = Title::newFromText(
-                       $parser->preprocess( trim( $ctg ), $wgOut->getTitle(), 
$wgOut->parserOptions() )
-               );
-               $ctgTitle = $ctgTitle->getDBkey();
-
-               $opinions = $dbw->select(
-                       array( 'page', 'categorylinks', 'published_page' ),
-                       array( 'COUNT(*) AS PromotedOpinions' ),
-                       array( 'cl_to' => $ctgTitle, 'published_type' => 1 ),
-                       __METHOD__,
-                       array(),
-                       array(
-                               'categorylinks' => array( 'INNER JOIN', 
'page_id = cl_from' ),
-                               'published_page' => array(
-                                       'INNER JOIN', 'page_id = 
published_page_id'
-                               ),
-                       )
-               );
-
-               $res = $dbw->update(
-                       'user_stats',
-                       array( 'stats_opinions_published' => 
$opinions->PromotedOpinions ),
-                       array( 'stats_user_id' => $this->user_id ),
-                       __METHOD__
-               );
-
-               $this->clearCache();
-       }
-
-       /**
         * Updates the amount of relationships (friends or foes) if the user 
isn't
         * an anonymous one.
         * This is called by UserRelationship::removeRelationshipByUserID(), 
which


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

Reply via email to