• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Exphist.php (Powergamers) with some mods. Smaller text, condensed #'s

jerryb1988

Member
Joined
Mar 10, 2008
Messages
79
Reaction score
5
Based off http://otland.net/f118/gesior-acc-maker-forgotten-server-0-3-powergamers-online-time-stats-8640/ I modified this exphist.php to my liking and I'm sure someone else will enjoy it as well.

It uses smaller text on the numbers and uses correct number formatting based on php's built in number format (no more numbers with ,393,000) and I also added a "Condenser" to make the numbers short, like 1.2B (instead of 1,200,000,000) so the boxes wont stretch all the way across the screen :p It has an explanation of the letters on the top of the page, too. It also doesn't show players who are below level 8 and/or players who have had no exp history in the last 7 days, so your page wont be filled with inactive level 8 players. View it here Jerrys OT - EXP History

Replace everything in exphist.php with:
PHP:
<?PHP
$limit = 300; //Change to the number of players you want listed.
$type = $_REQUEST['type'];
function coloured_value($valuein)
{
{
	if(abs($valuein) > 1000000000)
		$value2 = number_format(($valuein/1000000000),2)."B"; //Change the "2" to how many numbers you want to show after the decimal Ex 5 = 5.12345, 2 = 5.12
	elseif(abs($valuein) > 1000000)
		$value2 = number_format(($valuein/1000000),2)."M"; //Change the "2" to how many numbers you want to show after the decimal Ex 5 = 5.12345, 2 = 5.12
	elseif(abs($valuein) > 1000)
		$value2 = number_format(($valuein/1000),2)."K"; //Change the "2" to how many numbers you want to show after the decimal Ex 5 = 5.12345, 2 = 5.12
}
	if($valuein > 0)
		return '<font color="green">+'.$value2.'</font>';
	elseif($valuein < 0)
		return '<font color="red">'.$value2.'</font>';
	else
		return '<font color="black">'.$valuein.'</font>';
}
if(empty($type))
	$players = $SQL->query(' SELECT * FROM players WHERE `players`.`experience` > 4200 AND `players`.`exphist1`+`players`.`exphist2`+`players`.`exphist3`+`players`.`exphist4`+`players`.`exphist5`+`players`.`exphist6`+`players`.`exphist7` > 0 ORDER BY `players`.`experience`-`players`.`exphist_lastexp` DESC LIMIT '.$limit)->fetchAll();
elseif($type == "sum")
	$players = $SQL->query(' SELECT * FROM players WHERE `players`.`experience` > 4200 AND `players`.`exphist1`+`players`.`exphist2`+`players`.`exphist3`+`players`.`exphist4`+`players`.`exphist5`+`players`.`exphist6`+`players`.`exphist7` > 0 ORDER BY `players`.`exphist1`+`players`.`exphist2`+`players`.`exphist3`+`players`.`exphist4`+`players`.`exphist5`+`players`.`exphist6`+`players`.`exphist7`+`players`.`experience`-`players`.`exphist_lastexp` DESC LIMIT '.$limit)->fetchAll();
elseif($type >= 1 && $type <= 7)
	$players = $SQL->query(' SELECT * FROM players WHERE `players`.`experience` > 4200 AND `players`.`exphist1`+`players`.`exphist2`+`players`.`exphist3`+`players`.`exphist4`+`players`.`exphist5`+`players`.`exphist6`+`players`.`exphist7` > 0 ORDER BY exphist'.(int) $type.' DESC LIMIT '.$limit)->fetchAll();
$main_content .= '<CENTER><H2>Ranking of Powergamers</H2><BR><B>K = 1,000 (Thousand) <font color=red>|</font> M = 1,000,000 (Million) <font color=red>|</font> B = 1,000,000,000 (Billion)</B><BR><font color=green><b>Green = EXP Gain</font> | </b><font color=red><b>Red = EXP Loss</b></font></CENTER><BR><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD WIDTH=10% CLASS=white><B>Rank</B></TD><TD WIDTH=75% CLASS=white><B>Name</B></TD>';
if($type == "sum")
	$main_content .= '<TD WIDTH=15% bgcolor="red" CLASS=white><b><center><a href="?subtopic=exphist&type=sum">7 Day sum</a></center></B></TD>';
else
	$main_content .= '<TD WIDTH=15% bgcolor="yellow" CLASS=white><b><center><a href="?subtopic=exphist&type=sum">7 Day sum</a></center></B></TD>';
for($i = 7; $i >= 2; $i--)
	if($type == $i)
		$main_content .= '<TD WIDTH=15% bgcolor="red" CLASS=white><b><center><a href="?subtopic=exphist&type='.$i.'">'.$i.' Days Ago</a></center></B></TD>';
	else
		$main_content .= '<TD WIDTH=15% bgcolor="yellow" CLASS=white><b><center><a href="?subtopic=exphist&type='.$i.'">'.$i.' Days Ago</a></center></B></TD>';
if($type == 1)
	$main_content .= '<TD WIDTH=15% bgcolor="red" CLASS=white><b><center><a href="?subtopic=exphist&type=1">1 Day Ago</a></center></B></TD>';
else
	$main_content .= '<TD WIDTH=15% bgcolor="yellow" CLASS=white><b><center><a href="?subtopic=exphist&type=1">1 Day Ago</a></center></B></TD>';
if(empty($type))
	$main_content .= '<TD WIDTH=15% bgcolor="red" CLASS=white><b><center><a href="?subtopic=exphist">Today</a></center></B></TD>';
else
	$main_content .= '<TD WIDTH=15% bgcolor="yellow" CLASS=white><b><center><a href="?subtopic=exphist">Today</a></center></B></TD>';
$main_content .= '</TR>';
foreach($players as $player)
{
	if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
	$main_content .= '<tr bgcolor="'.$bgcolor.'"><td align="center">'.$number_of_rows.'. </td>';
	if($player['online'] == 1)
		$main_content .= '<td><a href="?subtopic=characters&name='.urlencode($player['name']).'"><b><font color="green">'.$player['name'].'</font></b></a>';
	else
		$main_content .= '<td><a href="?subtopic=characters&name='.urlencode($player['name']).'"><b><font color="red">'.$player['name'].'</font></b></a>';
	$main_content .= '<br /><small>'.$player['level'].' '.$vocation_name[0][$player['promotion']][$player['vocation']].'</small></td><td align="right"><small>'.coloured_value($player['exphist1'] + $player['exphist2'] + $player['exphist3'] + $player['exphist4'] + $player['exphist5'] + $player['exphist6'] + $player['exphist7'] + $player['experience'] - $player['exphist_lastexp']).'</small></td>';
	$main_content .= '<td align="right"><small>'.coloured_value($player['exphist7']).'</small></td><td align="right"><small>'.coloured_value($player['exphist6']).'</small></td><td align="right"><small>'.coloured_value($player['exphist5']).'</small></td><td align="right"><small>'.coloured_value($player['exphist4']).'</small></td><td align="right"><small>'.coloured_value($player['exphist3']).'</small></td><td align="right"><small>'.coloured_value($player['exphist2']).'</small></td><td align="right"><small>'.coloured_value($player['exphist1']).'</small></td><td align="right"><small>'.coloured_value($player['experience']-$player['exphist_lastexp']).'</small></td></tr>';
}
$main_content .= '</TABLE>Page customized by <b>Jerry</b> from <a href="http://jerry.servegame.com">Jerry\'s OT</a>.';
?>

Enjoy! :)
 
Hey JERRY can yo uhalp to fix my php??? I'm explain, all original phps by gesior apear 100 on screan, but all editeds php for me apear one black color on top of background... you or other friend can help me to fix????
 
I also completely forgot, I also fixed the displaying of characters Level & Vocation under their name.
 
i make this click on page and see "Invalid subtopic. Can't load page. "
 
Back
Top