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

top guild request

Pedrook

Advanced OT User
Joined
May 24, 2009
Messages
442
Solutions
3
Reaction score
183
Location
Brazil
I do not know if I'm in the right place, I'm using a layout, where there are no top guilds, the layout was copied, "thora" the source code has been placed and it shows the guild, but does not have the system, how do I add a code that works here?

GpUYJIg.png

here codiging layout.php

Code:
<div class="well">
                                                <h2><font color="black">Top 5 Guilds</font></h2>
                                              
                                                <table class="table table-condensed table-content table-striped">
                                                        <tbody>
                                                                                                                                <tr><td>1.</td><td><a href="?subtopic=guilds&action=show&guild=26"><img src="guild_image.php?id=26" width="16" height="16" border="0"/> Loneliness</a>&nbsp;<td><span class="label label-danger pull-right">126 kills</td></span></td></tr>
<tr><td>2.</td><td><a href="?subtopic=guilds&action=show&guild=30"><img src="guild_image.php?id=30" width="16" height="16" border="0"/> Out Laws</a>&nbsp;<td><span class="label label-danger pull-right">65 kills</td></span></td></tr>
<tr><td>3.</td><td><a href="?subtopic=guilds&action=show&guild=39"><img src="guild_image.php?id=39" width="16" height="16" border="0"/> Amfethamine</a>&nbsp;<td><span class="label label-danger pull-right">57 kills</td></span></td></tr>
<tr><td>4.</td><td><a href="?subtopic=guilds&action=show&guild=25"><img src="guild_image.php?id=25" width="16" height="16" border="0"/> Daylight</a>&nbsp;<td><span class="label label-danger pull-right">51 kills</td></span></td></tr>
<tr><td>5.</td><td><a href="?subtopic=guilds&action=show&guild=15"><img src="guild_image.php?id=15" width="16" height="16" border="0"/> Semicolon Parenthesis</a>&nbsp;<td><span class="label label-danger pull-right">45 kills</td></span></td></tr>
</tbody>
                                                </table>
                                        </div>
</div>

I have tried to paste some syllable of top guilds, or implement, but it is already far from my knowledge.
 
Solution
I'm not sure if that is what you meant, but try this:
PHP:
<div class="well">
    <h2><font color="black">Top 5 Guilds</font></h2>
    <table class="table table-condensed table-content table-striped">
        <tbody>
<?php
    $guildsPower = $SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, COUNT(`g`.`name`) as `frags` FROM `players` p LEFT JOIN `player_deaths` pd ON `pd`.`killed_by` = `p`.`name` LEFT JOIN `guild_membership` gm ON `p`.`id` = `gm`.`player_id` LEFT JOIN `guilds` g ON `gm`.`guild_id` = `g`.`id` WHERE `pd`.`unjustified` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0, 4')->fetchAll();
    $i = 0;
    foreach($guildsPower as $guild) {
        echo '
            <tr><td>' . ++$i . '.</td><td><a...
this code works but I can not put it there.

Code:
<?PHP
                    $guildsPower = $SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, COUNT(`g`.`name`) as `frags` FROM `players` p LEFT JOIN `player_deaths` pd ON `pd`.`killed_by` = `p`.`name` LEFT JOIN `guild_membership` gm ON `p`.`id` = `gm`.`player_id` LEFT JOIN `guilds` g ON `gm`.`guild_id` = `g`.`id` WHERE `pd`.`unjustified` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0, 4')->fetchAll();
                                                $main_content .= '<tr>';
                                            foreach($guildsPower as $guildp) {
                                                $main_content .= '
                                                        <a href="?subtopic=guilds&action=view&GuildName=' . $guildp['name'] . '"><img src="guild_image.php?id=' . $guildp['id'] . '" width="64" height="64" border="0"/><br />' . $guildp['name'] . '</a><br />' . $guildp['frags'] . ' kills
                                                    </td>';
                                            }
                                                $main_content .= '</tr>';
?>
 
I'm not sure if that is what you meant, but try this:
PHP:
<div class="well">
    <h2><font color="black">Top 5 Guilds</font></h2>
    <table class="table table-condensed table-content table-striped">
        <tbody>
<?php
    $guildsPower = $SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, COUNT(`g`.`name`) as `frags` FROM `players` p LEFT JOIN `player_deaths` pd ON `pd`.`killed_by` = `p`.`name` LEFT JOIN `guild_membership` gm ON `p`.`id` = `gm`.`player_id` LEFT JOIN `guilds` g ON `gm`.`guild_id` = `g`.`id` WHERE `pd`.`unjustified` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0, 4')->fetchAll();
    $i = 0;
    foreach($guildsPower as $guild) {
        echo '
            <tr><td>' . ++$i . '.</td><td><a href="?subtopic=guilds&action=show&guild=' . $guild['id'] . '"><img src="guild_image.php?id=' . $guild['id'] . '" width="16" height="16" border="0"/> ' . $guild['name'] . '</a>&nbsp;<td><span class="label label-danger pull-right">' . $guild['frags'] . ' kills</td></span></td></tr>';
    }
?>
        </tbody>
    </table>
</div>

Notice: I removed one </div> closing. Cause it was too much. When you copy that, then paste it in the right place.
 
Solution
I'm not sure if that is what you meant, but try this:
PHP:
<div class="well">
    <h2><font color="black">Top 5 Guilds</font></h2>
    <table class="table table-condensed table-content table-striped">
        <tbody>
<?php
    $guildsPower = $SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, COUNT(`g`.`name`) as `frags` FROM `players` p LEFT JOIN `player_deaths` pd ON `pd`.`killed_by` = `p`.`name` LEFT JOIN `guild_membership` gm ON `p`.`id` = `gm`.`player_id` LEFT JOIN `guilds` g ON `gm`.`guild_id` = `g`.`id` WHERE `pd`.`unjustified` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0, 4')->fetchAll();
    $i = 0;
    foreach($guildsPower as $guild) {
        echo '
            <tr><td>' . ++$i . '.</td><td><a href="?subtopic=guilds&action=show&guild=' . $guild['id'] . '"><img src="guild_image.php?id=' . $guild['id'] . '" width="16" height="16" border="0"/> ' . $guild['name'] . '</a>&nbsp;<td><span class="label label-danger pull-right">' . $guild['frags'] . ' kills</td></span></td></tr>';
    }
?>
        </tbody>
    </table>
</div>

Notice: I removed one </div> closing. Cause it was too much. When you copy that, then paste it in the right place.

thank you very much, it worked.
 
Back
Top