Index: trunk/extensions/SportsTeams/SpecialTopNetworks.php |
— | — | @@ -50,7 +50,6 @@ |
51 | 51 | $where = array(); |
52 | 52 | if ( $sport ) { |
53 | 53 | $where['team_sport_id'] = $sport; |
54 | | - //$sport_where = "WHERE sport_team.team_sport_id={$sport}"; |
55 | 54 | } |
56 | 55 | |
57 | 56 | // Set the page title |
— | — | @@ -71,16 +70,6 @@ |
72 | 71 | $dbr = wfGetDB( DB_MASTER ); |
73 | 72 | |
74 | 73 | // 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 | | - */ |
85 | 74 | $res = $dbr->select( |
86 | 75 | array( 'sport_favorite', 'sport_team' ), |
87 | 76 | array( |
— | — | @@ -100,14 +89,6 @@ |
101 | 90 | ); |
102 | 91 | |
103 | 92 | // 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 | | - */ |
112 | 93 | $res_sport = $dbr->select( |
113 | 94 | array( 'sport_favorite', 'sport' ), |
114 | 95 | array( |
— | — | @@ -125,14 +106,6 @@ |
126 | 107 | ); |
127 | 108 | |
128 | 109 | // 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 | | - */ |
137 | 110 | $res_sport_nav = $dbr->select( |
138 | 111 | array( 'sport', 'sport_team' ), |
139 | 112 | array( 'sport_id', 'sport_name', 'team_sport_id' ), |
Index: trunk/extensions/SportsTeams/SportsTeamsClass.php |
— | — | @@ -387,7 +387,6 @@ |
388 | 388 | } |
389 | 389 | $options['OFFSET'] = intval( $limitvalue ); |
390 | 390 | $options['LIMIT'] = intval( $limit ); |
391 | | - //$limit_sql = " LIMIT {$limitvalue},{$limit} "; |
392 | 391 | } |
393 | 392 | |
394 | 393 | if( !$team_id ) { |
— | — | @@ -496,14 +495,8 @@ |
497 | 496 | } else { |
498 | 497 | $count = 0; |
499 | 498 | } |
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 | | - */ |
506 | 499 | |
507 | | - return $count;//$row->the_count; |
| 500 | + return $count; |
508 | 501 | } |
509 | 502 | |
510 | 503 | static function getSimilarUserCount( $user_id ) { |
— | — | @@ -536,15 +529,7 @@ |
537 | 530 | $count = 0; |
538 | 531 | } |
539 | 532 | |
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; |
549 | 534 | } |
550 | 535 | |
551 | 536 | /** |
— | — | @@ -572,11 +557,6 @@ |
573 | 558 | $where, |
574 | 559 | __METHOD__ |
575 | 560 | ); |
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 | | - */ |
581 | 561 | |
582 | 562 | if( !$row ) { |
583 | 563 | return false; |