function wfAddUserStatusNetwork( $sport_id, $team_id, $text, $count ) { global $wgUser; // Don't do anything if the user is blocked or the DB is read-only if ( $wgUser->isBlocked() || wfReadOnly() ) { return ''; } $s = new UserStatus(); $m = $s->addStatus( $sport_id, $team_id, urldecode( $text ) ); return $s->displayStatusMessages( 0, $sport_id, $team_id, $count, 1 ); }
function fnAddFavoriteTeam( $user ) { if ( isset( $_COOKIE['sports_sid'] ) ) { $sport_id = $_COOKIE['sports_sid']; $team_id = $_COOKIE['sports_tid']; $thought = $_COOKIE['thought']; if( !$team_id ) { $team_id = 0; } if( $sport_id != 0 ) { $s = new SportsTeams(); $s->addFavorite( $user->getID(), $sport_id, $team_id ); if( $thought ) { $b = new UserStatus(); $m = $b->addStatus( $sport_id, $team_id, $thought ); } } } return true; }