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

MyACC [ONI TEMPLATE] Outfit on TOP5.

OTcreator

Active Member
Joined
Feb 14, 2022
Messages
425
Solutions
1
Reaction score
44
Hello!
Who can help me with outfit on TOP5 in MyACC (template ONI).
ONI LAYOUT DEMO - MyACC

[SOLVED]

PHP:
<div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">Top 5 Level</h3>
                    </div>
                    <div class="panel-body">
                        <table class="table table-condensed table-content table-striped">
                            <tbody>
                            <?php
                            $fetch_from_db = true;
                            if($cache->enabled())
                            {
                                $tmp = '';
                                if($cache->fetch('top_5_level', $tmp))
                                {
                                    $players = unserialize($tmp);
                                    $fetch_from_db = false;
                                }
                            }

                            if($fetch_from_db)
                            {
                                $players = $db->query('SELECT `name`, `level`, `experience`, `looktype`' . (fieldExist('players', 'lookaddons') ? ', `lookaddons`' : '') . ', `lookhead`, `lookbody`, `looklegs`, `lookfeet` FROM `players` WHERE `group_id` < ' . $config['highscores_groups_hidden'] . ' AND `id` > 6 ORDER BY `experience` DESC LIMIT 5;')->fetchAll();

                                if($cache->enabled())
                                    $cache->set('top_5_level', serialize($players), 120);
                            }

                            if ($players) {
                                $count = 1;
                                foreach($players as $player) {
                                    $outfit_url = '';
                                    if($config['online_outfit']) {
                                        $outfit_url = $config['outfit_images_url'] . '?id=' . $player['looktype']    . (!empty
                                            ($player['lookaddons']) ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'];
                                    }

                                    echo "<tr>" . ($config['online_outfit'] ? '<td style="width: 64px;"><img style="position:absolute;margin-top:' . (in_array($player['looktype'], [75, 266, 302]) ? '-20px;margin-left:-0px;' : '-45px;margin-left:-25px;') . '" src="' . $outfit_url . '" alt="player outfit"/></td>' : '') . "<td class='labelbox' width='150px'>$count - <a href='?subtopic=characters&name=". $player['name']. "'>". $player['name']. "</a> <span class='label label-primary' style='float:right;width: 55px;'>Level: ". $player['level'] ."</span></td></<tr>";
                                    $count++;
                                }
                            }
                            ?>
                            </tbody>
                        </table>
                    </div>
                </div>
 
Last edited:
Back
Top