From: Hendrik B. <nh...@us...> - 2011-06-15 19:26:07
|
Update of /cvsroot/arianne/stendhal_website/scripts In directory vz-cvs-4.sog:/tmp/cvs-serv21614/scripts Modified Files: players.php Log Message: split halloffame_archive into halloffame_archive_recent and halloffame_archive_alltimes and only keep the history on the first one Index: players.php =================================================================== RCS file: /cvsroot/arianne/stendhal_website/scripts/players.php,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** players.php 10 Mar 2011 20:25:18 -0000 1.63 --- players.php 15 Jun 2011 19:26:05 -0000 1.64 *************** *** 147,151 **** function getHallOfFameScore($fametype) { ! $result=mysql_query('select points from halloffame_archive where day = CURRENT_DATE() AND recent = "0" and charname="'.mysql_real_escape_string($this->name).'" and fametype="'.mysql_real_escape_string($fametype).'"',getGameDB()); while($row=mysql_fetch_assoc($result)) { --- 147,152 ---- function getHallOfFameScore($fametype) { ! $tableSuffix = 'alltimes'; ! $result=mysql_query('select points from halloffame_archive_'.$tableSuffix.' where day = CURRENT_DATE() and charname="'.mysql_real_escape_string($this->name).'" and fametype="'.mysql_real_escape_string($fametype).'"',getGameDB()); while($row=mysql_fetch_assoc($result)) { *************** *** 175,180 **** } ! function getBestPlayer($where='') { ! $query = 'select halloffame_archive.points, halloffame_archive.charname, character_stats.age, character_stats.level, character_stats.xp, character_stats.outfit, character_stats.sentence from halloffame_archive join character_stats on (charname=name) '.$where.' and day = CURRENT_DATE() and fametype = "R" order by rank limit 1'; $list = queryWithCache($query, 60*60, getGameDB()); return $list[0]; --- 176,181 ---- } ! function getBestPlayer($tableSuffix, $where='') { ! $query = 'select halloffame_archive_'.$tableSuffix.'.points, halloffame_archive_'.$tableSuffix.'.charname, character_stats.age, character_stats.level, character_stats.xp, character_stats.outfit, character_stats.sentence from halloffame_archive_'.$tableSuffix.' join character_stats on (charname=name) '.$where.' and day = CURRENT_DATE() and fametype = "R" order by rank limit 1'; $list = queryWithCache($query, 60*60, getGameDB()); return $list[0]; *************** *** 186,191 **** * Note: Parameters must be sql escaped. */ ! function getHOFPlayers($where='', $fametype = '', $cond='limit 2') { ! $query = 'select distinct halloffame_archive.charname, halloffame_archive.rank, halloffame_archive.points, character_stats.outfit from halloffame_archive join character_stats on (charname=name) '.$where.' and day = CURRENT_DATE() and fametype = "'.mysql_real_escape_string($fametype).'" order by rank '.$cond; $result = mysql_query($query,getGameDB()); $list=array(); --- 187,192 ---- * Note: Parameters must be sql escaped. */ ! function getHOFPlayers($tableSuffix, $where='', $fametype = '', $cond='limit 2') { ! $query = 'select distinct halloffame_archive_'.$tableSuffix.'.charname, halloffame_archive_'.$tableSuffix.'.rank, halloffame_archive_'.$tableSuffix.'.points, character_stats.outfit from halloffame_archive_'.$tableSuffix.' join character_stats on (charname=name) '.$where.' and day = CURRENT_DATE() and fametype = "'.mysql_real_escape_string($fametype).'" order by rank '.$cond; $result = mysql_query($query,getGameDB()); $list=array(); *************** *** 266,270 **** */ function getCharacterRanks($charname) { ! $query = "SELECT fametype, rank FROM halloffame_archive WHERE charname='".mysql_real_escape_string($charname)."' AND day=CURRENT_DATE() AND recent='1'"; $result = mysql_query($query, getGameDB()); // if the player has not played recently, we fetch the all times data --- 267,271 ---- */ function getCharacterRanks($charname) { ! $query = "SELECT fametype, rank FROM halloffame_archive_recent WHERE charname='".mysql_real_escape_string($charname)."' AND day=CURRENT_DATE()"; $result = mysql_query($query, getGameDB()); // if the player has not played recently, we fetch the all times data *************** *** 272,276 **** if (mysql_num_rows($result) == 0) { mysql_free_result($result); ! $query = "SELECT fametype, rank FROM halloffame_archive WHERE charname='".mysql_real_escape_string($charname)."' AND day=CURRENT_DATE() AND recent='0'"; $result = mysql_query($query, getGameDB()); $res['__'] = 'alltimes'; --- 273,277 ---- if (mysql_num_rows($result) == 0) { mysql_free_result($result); ! $query = "SELECT fametype, rank FROM halloffame_archive_alltimes WHERE charname='".mysql_real_escape_string($charname)."' AND day=CURRENT_DATE()"; $result = mysql_query($query, getGameDB()); $res['__'] = 'alltimes'; |