Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host="localhost";
- $user="mysqluser"; // mysql user
- $pass="mysqluserpass"; // mysql user pass
- $database="mysqdb"; // mysql database
- $mode = "ctf";
- $mingames=20; // debe ser el mismo que en el archivo de configacion del bot gatherbot.cfg
- $inactivedays=30; // debe ser el mismo que en el archivo de configacion del bot gatherbot.cfg
- $pagesize=10;
- $filtername_sql="";
- $offset=0;
- $link = @mysql_connect($host,$user,$pass);
- mysql_select_db($database, $link) or die ($database. " Database not found." . $user);
- $result=@mysql_query("
- SELECT
- ROUND((COALESCE(killed/death,killed) * (COALESCE(win/(win+lose),0) + COALESCE(cap/teamcap,0)))*1000+points) AS score,
- COALESCE(ROUND(killed/death,2),'Inf') AS kpd,
- COALESCE(ROUND(cap/teamcap*100),0) AS capratio,
- win+tie+lose AS played,
- COALESCE(ROUND(win/(win+lose)*100),0) AS winratio,
- (SELECT COUNT(*)+1 FROM $mode WHERE
- time_updated > TIMESTAMPADD(DAY,-$inactivedays,NOW())
- AND
- ROUND((COALESCE(killed/death,killed) * (COALESCE(win/(win+lose),0) + COALESCE(cap/teamcap,0)))*1000+points)>score
- AND
- (win+tie+lose) >= $mingames
- ) AS place,
- id,name,time_updated,killed,death
- FROM $mode
- WHERE
- time_updated > TIMESTAMPADD(DAY,-$inactivedays,NOW())
- AND
- (win+tie+lose) >= $mingames
- $filtername_sql
- ORDER BY score DESC, killed DESC, DEATH ASC, name ASC
- LIMIT $offset, $pagesize
- ",$link);
- echo '<table width="100%"><tr><td><div align=center>Player</div></td><td><div align=center>Points</div></td></tr>';
- while ($row = mysql_fetch_array($result)) {
- echo '<tr><td>'.$row[name].'</td><td><div= align=center>'.$row['score'].'</div></td></tr>';
- // echo '<p>'.$row[name].' '.$row['points'].'</p>';
- }
- echo '</table>';
- mysql_close($link);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement