Hello. This is my second version of my script. The other once can be found here : http://otland.net/f118/modern-aac-page-top-guild-rating-107492/ | and its a page version of this script this one will be displayed on the home page as a injection.
Tutorial where to place it?
enter the following direction \injections\home crate a new folder with a name guildpoints paste in it the code.. Save it as injection.php
Download the attach
gp.rar (291.5 KB) View attachment gp.rar
And extract in \public\images\
Put there the folder gp.
Tutorial where to place it?
enter the following direction \injections\home crate a new folder with a name guildpoints paste in it the code.. Save it as injection.php
PHP:
<?php
#################################################################################
## CONFIGURATION PAGE ##
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- #
## ---------------------------------------------------------------------------- #
## Script created by Kavvson (http://otland.net/members/kavvson/) and MiPo91 #
## Author & developer: MiPo91 and Kavvson #
## #
## Helpers: MiPo91 <http://www.otland.net> #
#################################################################################
########################
## Connection ##
########################
## Leave these values ##
########################
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
echo'<div class="message"><div class="title">Top Guild Points</div> <div class="content">
<table border="0" cellspacing="3" cellpadding="4" width="100%">
<tr>';
$i = 0;
foreach($SQL->query('
SELECT
`g`.`id` AS `id`,
`g`.`name` AS `name`,
SUM(`p`.`level`) AS `level`,
COUNT(`p`.`name`) AS `count`,
AVG(`p`.`level`) AS `average`,
MIN(`p`.`level`) AS `min`,
MAX(`p`.`level`) AS `max`
FROM `players` p
LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id`
LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id`
WHERE `g`.`id` = `g`.`id`
GROUP BY `name`
ORDER BY `level` DESC
LIMIT 3
') as $guild)
{
$Points = $guild['level'] + $guild['count'] + round($guild['average']) + $guild['min'] + $guild['max'];
echo '
<td style="padding-right:20px;padding-top:3px" align="center">
Top Rating :
<p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">'.$Points.'</p>
<a href="'.WEBSITE.'/index.php/guilds/view/' . $guild['id'] . '"><img src="'.WEBSITE.'/public/images/gp/'. $i = $i + 1 .'.png" width="90" height="90" border="0"/>
<br /><b>' . $guild['name'] . '</b></a><br />
</td>';
}
echo' </tr>
</table>';
if(empty($i)) {
echo "<center><font color='red'>There is no guilds yet.</font></center>";
}
echo "</div>";
echo "</div><br/>";
?>
Download the attach
gp.rar (291.5 KB) View attachment gp.rar
And extract in \public\images\
Put there the folder gp.