• 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!

AAC [ZnoteAcc] convert this gesior top 5 players to znote

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 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 -->
This is how it looks
1593356685041.png

I'd like to leave it like this tho (images here)
1593356717194.png
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
                                }
                            ?>
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
 
Last edited:
this is a query I used to use on gesior to get the reset number and sort by it
SQL:
SELECT * FROM players p INNER JOIN player_storage ps ON p.id = ps.player_id WHERE p.deleted = 0 AND p.group_id < 4 AND ps.key = 378378 ORDER BY CAST(ps.value AS SIGNED INTEGER) DESC, p.level DESC LIMIT 6

also, with this code (divs and tags of the gesior one)
PHP:
    <div class="Themebox">
    <div id="Topbar" class="Toplevelbox" style="background-image:url(layout/images/global/themeboxes/rankings/top_level_top.gif);">
    <div style="background:url(layout/images/global/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="menusrank"></div>
    <table style="font-family: sans-serif; font-size: 12px; padding: 0px 12px; height: auto; display: block; background-image:url(./layout/images/global/themeboxes/rankings/box-bg.gif); margin-bottom: 5px; margin-top: -6px">
      
        <?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++;
            }
            }
        ?>
    </table><br>
    <div class="Bottom2" style="background-image:url(layout/images/global/themeboxes/rankings/box-bottom.gif);"></div>
    </div>

I got this
1593423282228.png

I also have this code, dunno how much it helps or if it helps at all
PHP:
<div id="Topbar" class="Themebox" style="background-image:url(layout/images/global/themeboxes/rankings/top_level_top.gif);margin-top: 78%;" >
<div style="background:url(layout/images/global/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="Toplevelbox" style="height: auto; display: table;margin-top: 20px;">                       
    <div id="menusrank"></div>
    <style>
        .Toplevelbox
        {
            position:relative;
            margin-bottom:10px;
            top:-4px;
            width:180px;
            height:192px
        }
        .semtoplevel {
            margin-bottom: 2px;
            color: darkred;
            font-style: italic;
            line-height: 3;
        }
        .topleveltext {
            z-index: 99;
            padding: 3px;
            position: absolute;
            height: 24px;
            width: 100%;
            top: 2px;
            left: 36px;
            color: #ffd698;
            text-shadow: -1px -1px 0 #000, 1px -1px 0 #2c2c2c, -1px 1px 0 #000, 1px 1px 0 #000;
            font: 100 14pt Fondamento,Arial,Times New Roman,sans-serif;
            -ms-user-select: none;
            user-select: none;
            cursor: default;
        }
        .ButtonTextInputs {
            text-align: center;
            color: #ffd698;
            overflow: hidden;
            font: 400 9pt Verdana,Arial,Times New Roman,sans-serif;
            text-shadow: -1px -1px 0 #000, 1px -1px 0 #2c2c2c, -1px 1px 0 #000, 1px 1px 0 #000;
            height: 22px;
            top: 5px;
        }
        .Themebox
        {
            position:relative
        }
        .top_level
        {
            top:35px;
            left:6px;
            z-index:20;
            display:block;
            padding-top:6px;
            font-family:Tahoma,Geneva,sans-serif;
            font-size:8pt;
            color:#5f4d41!important;
            font-weight:700;
            text-align:left;
            text-decoration:inherit
        }

        a.topfont,a:hover.topfont
        {
            font-weight:700;
            font-size:12px
        }

        #Topbar a,a.topfont,a:hover.top_level,a:hover.topfont
        {
            text-decoration:none
        }

        a:hover.top_level
        {
            font-weight:700;
            color:#4e3131!important
        }

        a.topfont
        {
            color:#004294
        }

        a:hover.topfont
        {
            color:#06c
        }
        #Themeboxes .Bottom2
        {
            bottom:0;
            left:0;
            margin-top:-18px;
            height:32px;
            width:180px;
            z-index:-1
        }
        .levelvoctoplevel
        {
            color:#5a2800;
            font:100 7pt Verdana,Arial,Times New Roman,sans-serif
        }
        
        .positiotoplvel
        {
            left:52px;
            top:82px;
            color:#fdeed7;
            text-shadow:1px 1px 1px #000
        }

        .positiotoplvel img
        {
            margin-left:-5px;
            margin-top:-5px
        }
        .outfitImgtoplevel,.positiotoplvel
        {
            background-position:right bottom;
            position:relative;
            margin-left:-64px;
            margin-top:-64px;
            height:64px;
            width:64px
        }

        .outfitImgtoplevel
        {
            left:26px;
            top:13px
        }
    </style>
    <div class="Bottom2" style="background-image:url(layout/images/global/themeboxes/rankings/box-bottom.gif);"></div>    </div>
  </div>
 
Last edited:
anyone please? I got this code that orders currectly but doesn't show outfit and I still can't show the currect images and doesn't have a cache
PHP:
<div class="Themebox">
    <div class="mod-tab">
    <div class="module">
        <div class="module-2">
            <div class="module-3">
                <div class="module-4">
                    <div class="module-5 deepest">
                        <div class="header-container-1">
                            <div class="header-container-2">
                                <div class="header-l"></div>
                                <div class="header-r"></div>
                                <h3 class="module"><span class="color">Top 5</span> Jogadores</h3>
                            </div>
                        </div>
                        <div style="overflow: hidden;">
                            <div>
                                <div>
                                    <?php
                                    $limitt = 5;
                                    $_storage = 378378;
                                    $skills = mysql_select_multi("SELECT a.name, a.level, a.experience, b.resets FROM (SELECT * FROM players WHERE group_id < 2 AND name != 'Account Manager') a left join (SELECT b.player_id, b.value as resets FROM player_storage b WHERE b.key = '$_storage') b on (a.id = b.player_id) ORDER BY b.resets DESC, a.level DESC, a.experience DESC LIMIT $limitt");
                                    $number_of_rows = 0;
                                    foreach($skills as $skillss) {
                                        $number_of_rows++;
                                        echo '+ <b></b><a href="characterprofile.php?name='.urlencode($skillss['name']).'" class="menu">'.$skillss['name'].'</a><br>';
                                        echo '<em class="style2">Level: <b>'.urlencode($skillss['level']).'</b> <small>Resets: <b>'. (($skillss['resets'])? $skillss['resets'] : 0) .'</b></small></em></li><br />';
                                    }
                                ?>
                                </div>
                            </div>
                        </div>  
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>

1593685250451.png
 
Last edited:
Back
Top