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

Pedrook

Advanced OT User
Joined
May 24, 2009
Messages
442
Solutions
3
Reaction score
183
Location
Brazil
how could I add top 5 powergamers here?

zjRolH1.png

Code:
<div class="col-3 pull-right">
                                                    <div class="well">
                        <h2><font color="black">Powergamer of day</font></h2>
                                <table class="table table-condensed table-content table-striped">
                                    <tbody>
                                    <tr><td><a href="?subtopic=characters&name=Rook Sample">Rook Sample</a>&nbsp;<td><span class="label label-success pull-right">+0 exp</td></span></td></tr>
                                     </tbody>
                                </table>
                                <table class="table table-condensed table-content table-striped">
                                    <tbody>
                                                                            </tbody>
                                </table>

              
                    </div>
 
Solution
Try this:
PHP:
<?php
    $powergamers = $SQL->query("SELECT name, experience, exphist_lastexp FROM players WHERE group_id < 2 ORDER BY  experience - exphist_lastexp DESC LIMIT 5;");
?>
<div class="col-3 pull-right">
    <div class="well">
        <h2><font color="black">Powergamer of day</font></h2>
        <table class="table table-condensed table-content table-striped">
            <tbody>
                <?php
                    foreach($powergamers->fetchAll() as $player) {
                        $change = $player['experience']-$player['exphist_lastexp'];
                        $nam = $player['name'];
                                if (strlen($nam) > 15)
                                {$nam = substr($nam, 0, 12) . '...';}...
Code:
                        if ($cache->hasExpired()) {
                                $znotePlayers = mysql_select_multi('SELECT * FROM players WHERE group_id < 2 ORDER BY  experience - exphist_lastexp DESC LIMIT 5;');
                                $cache->setContent($znotePlayers);
                                $cache->save();
                            } else {
                                $znotePlayers = $cache->load();
                            }

                            if($znotePlayers){
                                foreach($znotePlayers as $player)
                                {
                                    $nam = $player['name'];
                                    if (strlen($nam) > 15)
                                    {$nam = substr($nam, 0, 12) . '...';}
                                    echo '<li style="margin: 6px 0;"><div style="position:relative; left:-48px; top:-48px;"><div style="background-image: url(layout/outfitter/outfit.php?id='.$player['looktype'].'&head='.$player['lookhead'].'&body='.$player['lookbody'].'&legs='.$player['looklegs'].'&feet='.$player['lookfeet'].');width:64px;height:64px;position:absolute;background-repeat:no-repeat;background-position:right bottom;"></div></div>
                                    <a style="margin-left: 19px;" href="characterprofile.php?name=' .$player['name']. '">' .$nam. '</a>';
                                   
                                    echo '<span style="float: right;">'.coloured_value($player['experience']-$player['exphist_lastexp']).'</span></li>';
                                }
                            }
                            ?>
                            </ul>
                        </div>
                    </div>

Can someone help me adapt to gesior?
 
Try this:
PHP:
<?php
    $powergamers = $SQL->query("SELECT name, experience, exphist_lastexp FROM players WHERE group_id < 2 ORDER BY  experience - exphist_lastexp DESC LIMIT 5;");
?>
<div class="col-3 pull-right">
    <div class="well">
        <h2><font color="black">Powergamer of day</font></h2>
        <table class="table table-condensed table-content table-striped">
            <tbody>
                <?php
                    foreach($powergamers->fetchAll() as $player) {
                        $change = $player['experience']-$player['exphist_lastexp'];
                        $nam = $player['name'];
                                if (strlen($nam) > 15)
                                {$nam = substr($nam, 0, 12) . '...';}
                echo '
                <tr>
                <td>
                    <a href="?subtopic=characters&name=' . $player['name'] . '">' . $nam . '</a>&nbsp;<td><span class="label label-' . ($change >= 0 ? 'success' : 'error') . ' pull-right">' . ($change >= 0 ? '+' : '-') . $change . ' exp</td></span>
                </td>
            </tr>';
                    }
                ?>
            </tbody>
        </table>
        <table class="table table-condensed table-content table-striped">
            <tbody>
            </tbody>
        </table>
    </div>
</div>
 
Solution
Try this:
PHP:
<?php
    $powergamers = $SQL->query("SELECT name, experience, exphist_lastexp FROM players WHERE group_id < 2 ORDER BY  experience - exphist_lastexp DESC LIMIT 5;");
?>
<div class="col-3 pull-right">
    <div class="well">
        <h2><font color="black">Powergamer of day</font></h2>
        <table class="table table-condensed table-content table-striped">
            <tbody>
                <?php
                    foreach($powergamers->fetchAll() as $player) {
                        $change = $player['experience']-$player['exphist_lastexp'];
                        $nam = $player['name'];
                                if (strlen($nam) > 15)
                                {$nam = substr($nam, 0, 12) . '...';}
                echo '
                <tr>
                <td>
                    <a href="?subtopic=characters&name=' . $player['name'] . '">' . $nam . '</a>&nbsp;<td><span class="label label-' . ($change >= 0 ? 'success' : 'error') . ' pull-right">' . ($change >= 0 ? '+' : '-') . $change . ' exp</td></span>
                </td>
            </tr>';
                    }
                ?>
            </tbody>
        </table>
        <table class="table table-condensed table-content table-striped">
            <tbody>
            </tbody>
        </table>
    </div>
</div>

the page stayed this way.

45BvXgk.jpg
 
Back
Top