• 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] Looking for injection suggestions

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Reaction score
72
Location
Poland
2q2en9t.jpg


What can be added/changed?
 
Looks good enough, I don't really think that there is anything that need to added, btw.. you should change that "Experienice" to "Experience". Otherwise it's perfect ^^

Btw... you should add "width" to the character name "td" part, because it's not in line if the names aren't same size...
 
Oh :D yup miko

but i want to change also

PHP:
IF ( $guildMembers[0] == 1 )
ECHO "The Guild has ".$guildMembers[0]." member";
ELSE
ECHO "The Guild has ".$guildMembers[0]." members";
ECHO "<br>";
IF ( $invite[0] == 0 )
ECHO "No members are invited";
ELSEIF ( $invite[0] == 1 )
ECHO "One member is invited";
ELSE "".$invite[0]." Members are currently invited";
ECHO "<br>";
IF ( $allM[0] == 0 )
ECHO "No one is online";
ELSEIF ( $allM[0] == 1 )
ECHO "One member is online";
ELSE "".$allM[0]." Members are currently online";
    echo "</div>";


    echo "<div id='statistics'>";    
ECHO "".$allM1[0]." Total level in guild";
ECHO "<br>";
ECHO "".round($allM2[0])." Average level of all members in the guild";
ECHO "<br>";
    echo "</div>";
	
    echo "<div id='glory'>";
ECHO "".$allM3[0]." Can be proud of beeing the best in guild";
ECHO "<br>";
ECHO "".$allM4[0]." Is a shame for the guild for beeing the lowest level";

     echo "</div>";


Wanted to make some functions from this but it doesnt work
 
Oh :D yup miko

but i want to change also

PHP:
IF ( $guildMembers[0] == 1 )
ECHO "The Guild has ".$guildMembers[0]." member";
ELSE
ECHO "The Guild has ".$guildMembers[0]." members";
ECHO "<br>";
IF ( $invite[0] == 0 )
ECHO "No members are invited";
ELSEIF ( $invite[0] == 1 )
ECHO "One member is invited";
ELSE "".$invite[0]." Members are currently invited";
ECHO "<br>";
IF ( $allM[0] == 0 )
ECHO "No one is online";
ELSEIF ( $allM[0] == 1 )
ECHO "One member is online";
ELSE "".$allM[0]." Members are currently online";
    echo "</div>";


    echo "<div id='statistics'>";    
ECHO "".$allM1[0]." Total level in guild";
ECHO "<br>";
ECHO "".round($allM2[0])." Average level of all members in the guild";
ECHO "<br>";
    echo "</div>";
	
    echo "<div id='glory'>";
ECHO "".$allM3[0]." Can be proud of beeing the best in guild";
ECHO "<br>";
ECHO "".$allM4[0]." Is a shame for the guild for beeing the lowest level";

     echo "</div>";


Wanted to make some functions from this but it doesnt work

Could you explain it little bit more? Like how you want to change it? What doesn't work with it etc?
 
PHP:
function member(){
global $connection;
global $guild_id;
global $guildMembers;

echo $guildMembers[0];
}
$get=member();

PHP:
@DEFINE ('INJECTION_PATH', 'injections/guild_view/Advanced Table');
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$connection = POT::getInstance()->getDBHandle();
$CI =& get_instance(); 
$CI->load->helper("url");
$guild_id = $CI->uri->segment(3);

//** SQL Query **//
//** List **//
//** Functions **//
//** - Show the amount of members in guild **//
//** - Show the amount of members that are invited **//
//** - V2 **//
//%% - Fade %%//
//%% - Tabs %%//
//** - Show online members in the guild **//
//** - Show the total level of members in guild **//
//** - Show the average level of members in guild **//
//** - Show the highest level in guild **//
//** - Show the lowest level in guild **//
//** - V3 **//
//** @DEFINE INJECTION_PATH - path to the folder **//
//** - Skill ranking (all skills,mlvl experience) credits : http://otland.net/members/mipo91/ **//
//** - Alert Box **//
//** - Average level script fix .round(value) **//
//** - Typo fixes **//

$guildMembers = $connection->query ( 'SELECT COUNT(`gr`.`id`) AS `total` FROM `players` AS `p` LEFT JOIN `guild_ranks` AS `gr` ON `gr`.`id` = `p`.`rank_id` WHERE `gr`.`guild_id` = '.$guild_id )->fetch( );

$invite = $connection->query( 'SELECT COUNT(*) FROM `guild_invites` WHERE `guild_id` = '.$guild_id)->fetch( );
.... more

No output
 
Well you have typed the query wrongly.
Code:
$guildMembers = $connection->query ( 'SELECT COUNT(`gr`.`id`) AS `total` FROM `players` AS `p` LEFT JOIN `guild_ranks` AS `gr` ON `gr`.`id` = `p`.`rank_id` WHERE `gr`.`guild_id` = '.$guild_id )->fetch( );

$invite = $connection->query( 'SELECT COUNT(*) FROM `guild_invites` WHERE `guild_id` = '.$guild_id)->fetch( );

to

Code:
$guildMembers = $connection->query ( 'SELECT COUNT(`gr`.`id`) AS `total` FROM `players` AS `p` LEFT JOIN `guild_ranks` AS `gr` ON `gr`.`id` = `p`.`rank_id` WHERE `gr`.`guild_id` = '.$guild_id.'' )->fetch( );

$invite = $connection->query( 'SELECT COUNT(*) FROM `guild_invites` WHERE `guild_id` = '.$guild_id.'')->fetch( );

or

Code:
$guildMembers = $connection->query ( 'SELECT COUNT(`gr`.`id`) AS `total` FROM `players` AS `p` LEFT JOIN `guild_ranks` AS `gr` ON `gr`.`id` = `p`.`rank_id` WHERE (`gr`.`guild_id` = '.$guild_id.')' )->fetch( );

$invite = $connection->query( 'SELECT COUNT(*) FROM `guild_invites` WHERE (`guild_id` = '.$guild_id.')')->fetch( );

I'm not pro yet in php either, but I think that should fix it, because your code part would kinf of end the query just before it's selecting the guild_id because of " ' "

And anyways it would be easier to look on the problem if you post the whole code so I could test it and so on...
 
The Queries are ok since other variables outputs it correctly

PHP:
<?php
//** Connection to the database and getting the $guild_id **//
@DEFINE ('INJECTION_PATH', 'injections/guild_view/Advanced Table');
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$connection = POT::getInstance()->getDBHandle();
$CI =& get_instance(); 
$CI->load->helper("url");
$guild_id = $CI->uri->segment(3);

//** SQL Query **//
//** List **//
//** Functions **//
//** - Show the amount of members in guild **//
//** - Show the amount of members that are invited **//
//** - V2 **//
//%% - Fade %%//
//%% - Tabs %%//
//** - Show online members in the guild **//
//** - Show the total level of members in guild **//
//** - Show the average level of members in guild **//
//** - Show the highest level in guild **//
//** - Show the lowest level in guild **//
$guildMembers = $connection->query ( 'SELECT COUNT(`gr`.`id`) AS `total` FROM `players` AS `p` LEFT JOIN `guild_ranks` AS `gr` ON `gr`.`id` = `p`.`rank_id` WHERE `gr`.`guild_id` = '.$guild_id )->fetch( );

$invite = $connection->query( 'SELECT COUNT(*) FROM `guild_invites` WHERE `guild_id` = '.$guild_id)->fetch( );
$allM = $connection->query ('SELECT COUNT(1) as `people` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = '.$guild_id.') AND online = 1')->fetch(); 
$allM1 = $connection->query ('SELECT SUM(`level`) as `level` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = '.$guild_id.') ')->fetch(); 
$allM2 = $connection->query ('SELECT AVG(`level`) as `level` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = '.$guild_id.') ')->fetch(); 
$allM3 = $connection->query ('SELECT `name` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = '.$guild_id.') ORDER BY `level` ASC LIMIT 1')->fetch(); 
$allM4 = $connection->query ('SELECT `name` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = '.$guild_id.') ORDER BY `level` DESC LIMIT 1')->fetch();



ECHO '<link rel="stylesheet" href="'.WEBSITE.'/'.INJECTION_PATH.'/jquery.alerts.css" />';
ECHO '<script src="'.WEBSITE.'/'.INJECTION_PATH.'/jquery.alerts.js" type="text/javascript"></script>';

$skills = array(
0 => "Fist Fighting",
1 => "Club Fighting",
2 => "Sword Fighting",
3 => "Axe Fighting",
4 => "Distance Fighting",
5 => "Shielding",
6 => "Fishing"
);

$image_i = '<img style="border: medium none;" src="'.WEBSITE.'/'.INJECTION_PATH.'/images/Golden_Goblet.gif">';
echo '<a id="alert_button" href="#">Highscores</a>';

function member(){
global $connection;
global $guild_id;
global $guildMembers;

ECHO "The Guild has ".$guildMembers[0]." member";
}
$get=member();
?>


<script>
$(document).ready(function() {
$('#serverStats').fadeIn(6000)

});
$("a#alert_button").click( function() {
jAlert('<?PHP 
echo "<div class=i_head>Skills</div><hr><table align=center>";
foreach($skills as $key => $value)
{
$allM5 = $connection->query ('SELECT `p`.`name` AS `Name`, `ps`.`value` AS `Sword`, `p`.`maglevel`, `p`.`experience` FROM `players` AS `p` JOIN `player_skills` AS `ps` WHERE `ps`.`player_id` = `p`.`id` AND `ps`.`skillid` = '.$key.' AND `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = '.$guild_id.') ORDER BY `Sword` DESC Limit 1')->fetch();
echo "<tr align=center><td><img style=\"border: medium none;\" src=\"".WEBSITE."/".INJECTION_PATH."/images/skills/".$key.".png\"></td><td><div class=i_name>".$allM5[0]."</div></td> <td><div class=i_skill>".$allM5[1]." : ".$value."</div></td> </tr>";
}
echo "</table><div class=i_head>Experienice</div><hr><table align=center>"; echo "<tr align=center><td><img style=\"border: medium none;\" src=\"".WEBSITE."/".INJECTION_PATH."/images/skills/7.png\"></td><td><div class=i_name>".$allM5[0]."</div></td> <td><div class=i_skill>".$allM5[3] . " : Experience</div></td></tr>";
echo "<tr align=center><td><img style=\"border: medium none;\" src=\"".WEBSITE."/".INJECTION_PATH."/images/skills/8.png\"></td><td><div class=i_name>".$allM5[0]."</div></td> <td><div class=i_skill>".$allM5[2] . " : Magic Level</div></td></tr>";
?></table>', '<?PHP echo $image_i; ?> Skill Ranking <?PHP echo $image_i; ?>');
}); 
</script> 
<script>$(function(){$("#tabs").tabs();});</script>
<?PHP

echo "<style type=\"text/css\">
    .ui-tabs {
    height: !auto;
}
</style>
<div id=\"serverStats\" style=\"display: none;\">
<div id='tabs'>";
echo '<ul>
        <li><a href="#general">General Informations</a></li>
        <li><a href="#statistics">Statistics</a></li>
        <li><a href="#glory">Fame Hall</a></li>
    </ul>';

    echo "<div id='general'>";

IF ( $guildMembers[0] == 1 )
ECHO "The Guild has ".$guildMembers[0]." member";
ELSE
ECHO "The Guild has ".$guildMembers[0]." members";
ECHO "<br>";
IF ( $invite[0] == 0 )
ECHO "No members are invited";
ELSEIF ( $invite[0] == 1 )
ECHO "One member is invited";
ELSE "".$invite[0]." Members are currently invited";
ECHO "<br>";
IF ( $allM[0] == 0 )
ECHO "No one is online";
ELSEIF ( $allM[0] == 1 )
ECHO "One member is online";
ELSE "".$allM[0]." Members are currently online";
    echo "</div>";


    echo "<div id='statistics'>";    
ECHO "".$allM1[0]." Total level in guild";
ECHO "<br>";
ECHO "".round($allM2[0])." Average level of all members in the guild";
ECHO "<br>";
    echo "</div>";
	
    echo "<div id='glory'>";
ECHO "".$allM3[0]." Can be proud of beeing the best in guild";
ECHO "<br>";
ECHO "".$allM4[0]." Is a shame for the guild for beeing the lowest level";

     echo "</div>";
	 

echo "</div>
</div>
<br><br><br>";

?>
 
Mind to post picture of the problem? It seems to be working fine on my pc(without the jquerys part)...
 
Well I see what you mean, but I don't got solutation for that atm.

EDIT:
I don't really see point of using globals inside of a fuction.
But if you really want to use it with functions you could do it this way

Code:
function member($guildMembers){
ECHO "The Guild has ".$guildMembers[0]." member";
}
$get=member($guildMembers);

if you want to add more variables into the function then.
Code:
function member($guildMembers, $allM){
ECHO "The Guild has ".$guildMembers[0]." member";
echo "".$allM[0]." Members are currently online";
}
$get=member($guildMembers, $allM);
 
Last edited:
Back
Top