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

[Modern AAC] Injection - Top Guild Rating

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Reaction score
72
Location
Poland
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



wk4aww.jpg

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.
 
im using it for now. i like it much better then most powerful guilds
 
PHP:
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`

All lvl in guild + max lvl + min lvl + avg of all llvs + count of members
 
How Do I Change Font COlor To Red On This Part?
Code:
Top Rating :
 
Probably this question will make u lough but I have to ask - what's the diffrence between injection and the old one script? How to make this new one work?
 
error

Code:
Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\injections\home\guildpoints\injection.php on line 45
 
Back
Top