Lurk
Active Member
- Joined
- Dec 4, 2017
- Messages
- 336
- Reaction score
- 48
I'm using this template (by default it doesn't come with top 5 players) and I was messing a bit and got to this code (which I added to
This is how it looks
I'd like to leave it like this tho (images here)
here's the code from the above one (it's for gesior 2012)
oh and btw if possible I'd like to add the reset number (storage 378378) alongside the player name, like Test [0] and oder from resets instead of experience
htdocs/layout/rightside.php
)
PHP:
<!-- TOP PLAYERS -->
<div class="Themebox">
<div class="panel-heading" style="background-image:url(layout/images/global/themeboxes/rankings/top_level_top.gif);">
<div class="panel-heading"><img src="https://i.imgur.com/IfWsieL.png" alt="img"></div>
<div class="panel-body">
<div class="single_sidebar_widget search_widget" style="background-image:url(layout/images/global/themeboxes/premium/2.png);">
<br>
<tbody>
<?php
$cache = new Cache('engine/cache/topPlayer');
if ($cache->hasExpired()) {
$players = mysql_select_multi('SELECT `name`, `level`, `experience`, `looktype`, `lookaddons`, `lookhead`, `lookbody`, `looklegs`, `lookfeet` FROM `players` WHERE `group_id` < ' . $config['highscore']['ignoreGroupId'] . ' ORDER BY `experience` DESC LIMIT 5;');
$cache->setContent($players);
$cache->save();
} else {
$players = $cache->load();
}
if ($players) {
$count = 1;
foreach($players as $player) {
echo '<img style="margin-top: -35px; margin-left: -35px;" src="https://outfit-images.ots.me/animatedOutfits1090/animoutfit.php?id='.$player['looktype'].'&addons='.$player['lookaddons'].'&head='.$player['lookhead'].'&body='.$player['lookbody'].'&legs='.$player['looklegs'].'&feet='.$player['lookfeet'].'&g=0&h=3&i=1"></img> <a href="characterprofile.php?name='.$player['name'].'">'.$player['name'].'</a> (<span>' . $player['level'].')<br>';
$count++;
}
}
?>
</tbody>
</div>
</div>
</div>
<!-- TOP PLAYERS end -->
I'd like to leave it like this tho (images here)
here's the code from the above one (it's for gesior 2012)
PHP:
<?php
$q = $SQL->query("SELECT `name`, `looktype`, `lookaddons`, `lookhead`, `lookbody`, `looklegs`, `lookfeet`, `level`, `vocation` FROM `players` WHERE `deleted` = 0 AND (`account_id` != 1 AND `group_id` < 3) ORDER BY `level` DESC LIMIT 5")->fetchAll();
if ($q) {
$rankImages = array(
1 => "top1.gif",
2 => "top2.gif",
3 => "top3.gif"
)
?>
<div id="Topbar" class="Toplevelbox" style="background-image:url(<?PHP echo $layout_name; ?>/images/themeboxes/rankings/top_level_top.gif);">
<div style="background:url(<?PHP echo $layout_name; ?>/images/themeboxes/rankings/shield.gif);width: 32px;height: 32px;position: relative;margin-left: 5px;margin-top: 1px;"></div>
<span class="topleveltext">Top Experience</span>
<div id="RankingBox" class="Themebox" style="height: auto; display: table; margin-top: -4px;">
<div id="menusrank"></div>
<table style="font-family: sans-serif; font-size: 12px; padding: 0px 12px; height: auto; display: block; background-image:url(./<?PHP echo $layout_name; ?>/images/themeboxes/rankings/box-bg.gif); margin-bottom: 5px; margin-top: -6px">
<?php
$count = 0;
foreach ($q as $v) {
$count++;
$tmpPlayer = new Player();
$tmpPlayer->find($v['name']);
if ($tmpPlayer->isLoaded()) {
echo '
<tr style="background-color:'.($count % 2 ? 'rgba(241, 224, 198, 0.6)' : 'rgba(212, 192, 161, 0.6)').';" >
<td width="34px;" style="padding:0px; padding-left: 2px;">
<div class="outfitImgtoplevel" style="background-image:url(/outfit.php?id='.$v['looktype'].'&addons='.$v['lookaddons'].'&head='.$v['lookhead'].'&body='.$v['lookbody'].'&legs='.$v['looklegs'].'&feet='.$v['lookfeet'].'&mount=0&direction=3);"></div>
</td>
<td width="130px;" style="padding:1px; padding-left: 3px;">
<strong style="float: right; font-size: 10px; color: '.($tmpPlayer->isOnline() ? 'green': '#bf2015' ).';">
<i class="fa fa-user" aria-hidden="true"></i>
</strong>
<a class="top_level" href="?subtopic=characters&name='.$v['name'].'">
<small style="margin-left: -2px;">'.$count.'- </small>'.$v['name'].'
</a>';
$tooLongName = ((strlen($tmpPlayer->getName()) > 17) ? '<img src="'.$layout_name.'/images/themeboxes/rankings/'.$rankImages[$count].'" style="float: left;margin-top: -36px;margin-left: -4px;">' : '<img src="'.$layout_name.'/images/themeboxes/rankings/'.$rankImages[$count].'" style="float: left;margin-top: -26px;margin-left: -4px;">');
echo '<div class="levelvoctoplevel">
<small style="font-size: 10px;">'. ($rankImages[$count] ? $tooLongName : '').'
<b>'.$v['level'].'</b>, '.htmlspecialchars(Website::getVocationName($v['vocation'], false)).'</small>
</div>
</td>
</tr>';
}
}
?>
</table><br>
<div class="Bottom2" style="background-image:url(<?PHP echo $layout_name; ?>/images/themeboxes/rankings/box-bottom.gif);"></div>
</div>
</div>
<?php
}
?>
Last edited: