r97813 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97812‎ | r97813 | r97814 >
Date:13:56, 22 September 2011
Author:ashley
Status:deferred
Tags:
Comment:
SportsTeams: remove some dead code now that this extension is under version control; follow-up to r97812
Modified paths:
  • /trunk/extensions/SportsTeams/SpecialTopNetworks.php (modified) (history)
  • /trunk/extensions/SportsTeams/SportsTeamsClass.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SportsTeams/SpecialTopNetworks.php
@@ -50,7 +50,6 @@
5151 $where = array();
5252 if ( $sport ) {
5353 $where['team_sport_id'] = $sport;
54 - //$sport_where = "WHERE sport_team.team_sport_id={$sport}";
5554 }
5655
5756 // Set the page title
@@ -71,16 +70,6 @@
7271 $dbr = wfGetDB( DB_MASTER );
7372
7473 // Teams
75 - /*
76 - $sql = "SELECT COUNT(sport_favorite.sf_team_id) AS network_user_count,
77 - sport_favorite.sf_team_id, sport_team.team_name,
78 - sport_team.team_sport_id
79 - FROM sport_favorite
80 - INNER JOIN sport_team ON sport_favorite.sf_team_id=sport_team.team_id {$sport_where}
81 - GROUP BY sport_team.team_id
82 - ORDER BY network_user_count {$order} LIMIT 0,50";
83 - $res = $dbr->query( $sql, __METHOD__ );
84 - */
8574 $res = $dbr->select(
8675 array( 'sport_favorite', 'sport_team' ),
8776 array(
@@ -100,14 +89,6 @@
10190 );
10291
10392 // Sports
104 - /*
105 - $sql_sport = "SELECT COUNT(sf_sport_id) AS sport_count, sf_sport_id, sport_name
106 - FROM sport_favorite
107 - INNER JOIN sport ON sf_sport_id = sport_id
108 - GROUP BY sf_sport_id
109 - ORDER BY sport_count {$order} LIMIT 0,50";
110 - $res_sport = $dbr->query( $sql_sport, __METHOD__ );
111 - */
11293 $res_sport = $dbr->select(
11394 array( 'sport_favorite', 'sport' ),
11495 array(
@@ -125,14 +106,6 @@
126107 );
127108
128109 // Navigation
129 - /*
130 - $sql_sport_nav = "SELECT sport_id, sport_name, team_sport_id
131 - FROM sport
132 - INNER JOIN sport_team ON sport_id = team_sport_id
133 - GROUP BY sport_name
134 - ORDER BY sport_id";
135 - $res_sport_nav = $dbr->query( $sql_sport_nav, __METHOD__ );
136 - */
137110 $res_sport_nav = $dbr->select(
138111 array( 'sport', 'sport_team' ),
139112 array( 'sport_id', 'sport_name', 'team_sport_id' ),
Index: trunk/extensions/SportsTeams/SportsTeamsClass.php
@@ -387,7 +387,6 @@
388388 }
389389 $options['OFFSET'] = intval( $limitvalue );
390390 $options['LIMIT'] = intval( $limit );
391 - //$limit_sql = " LIMIT {$limitvalue},{$limit} ";
392391 }
393392
394393 if( !$team_id ) {
@@ -496,14 +495,8 @@
497496 } else {
498497 $count = 0;
499498 }
500 - /*
501 - $sql = "SELECT COUNT(*) AS the_count FROM {$dbr->tableName( 'sport_favorite' )} WHERE {$where_sql} AND sf_user_id IN
502 - (SELECT r_user_id_relation FROM {$dbr->tableName( 'user_relationship' )} WHERE r_user_id = {$user_id} AND r_type = 1)";
503 - $res = $dbr->query( $sql, __METHOD__ );
504 - $row = $dbr->fetchObject( $res );
505 - */
506499
507 - return $count;//$row->the_count;
 500+ return $count;
508501 }
509502
510503 static function getSimilarUserCount( $user_id ) {
@@ -536,15 +529,7 @@
537530 $count = 0;
538531 }
539532
540 - /*
541 - $sql = "SELECT COUNT(*) AS the_count FROM {$dbr->tableName( 'sport_favorite' )} WHERE sf_team_id IN
542 - (SELECT sf_team_id FROM {$dbr->tableName( 'sport_favorite' )} WHERE sf_user_id ={$user_id})
543 - AND sf_team_id <> 0 AND sf_user_id <> {$user_id}";
544 - $res = $dbr->query( $sql, __METHOD__ );
545 - $row = $dbr->fetchObject( $res );
546 - */
547 -
548 - return $count;//$row->the_count;
 533+ return $count;
549534 }
550535
551536 /**
@@ -572,11 +557,6 @@
573558 $where,
574559 __METHOD__
575560 );
576 - /*
577 - $sql = "SELECT sf_id FROM {$dbr->tableName( 'sport_favorite' )} WHERE sf_user_id={$user_id} AND {$where_sql}";
578 - $res = $dbr->query( $sql, __METHOD__ );
579 - $row = $dbr->fetchObject( $res );
580 - */
581561
582562 if( !$row ) {
583563 return false;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97812add SportsTeams and UserStatus; original code by Aaron Wright, Ashish Datta a...ashley13:23, 22 September 2011

Status & tagging log