• 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 - Latest News - Aleh's table

Kavvson

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

I would like you to present a Injection for the latest Aac maker. Its not official don't its still a beta version but you might use it later.

I made remade the table of Aleh (all credits goes to Aleh so please don't forget to add him reputation )that displays some nice functions http://otland.net/f118/gesior-acc-last-joined-free-houses-other-70272/. Its a bit changed code and also there is added a fade.

Tutorial where to place it?

enter the following direction \injections\home crate a new folder with a name Aleh-Table paste in it the code.. Save it as injection.php


PHP:
<?php
//** Connection to the database **//
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = POT::getInstance()->getDBHandle();

include ('config.php');
/////////////////////////////////////////////////////////////////////////////////////////
//The new edition of my script: Best Player, Last joined and something new Server Motd.//
/////////////////////////Everything in the new appearance.///////////////////////////////
//////////////////////////////////////by  Aleh///////////////////////////////////////////
///////////////////////Modification For Modern Aac made by Kavvson///////////////////////
///Queries ///
$query = $SQL->query('SELECT `players`.`name`,`players`.`id`,`players`.`level`, `players`.`experience`, `server_motd`.`id`, `server_motd`.`text` FROM `players`,`server_motd` WHERE `players`.`group_id` AND `players`.`name` != "Account Manager" ORDER BY `players`.`level` DESC, `players`.`experience` DESC, `server_motd`.`id` DESC LIMIT 1;')->fetch();
$query2 = $SQL->query('SELECT `id`, `name` FROM `players` ORDER BY `id` DESC LIMIT 1;')->fetch();
$housesfree = $SQL->query('SELECT COUNT(*) FROM `houses` WHERE `owner`=0;')->fetch();
$housesrented = $SQL->query('SELECT COUNT(*) FROM `houses` WHERE `owner`=1;')->fetch();
$players = $SQL->query('SELECT COUNT(*) FROM `players` WHERE `id`>0;')->fetch();
$accounts = $SQL->query('SELECT COUNT(*) FROM `accounts` WHERE `id`>0;')->fetch();
$banned = $SQL->query('SELECT COUNT(*) FROM `bans` WHERE `id`>0;')->fetch();
$guilds = $SQL->query('SELECT COUNT(*) FROM `guilds` WHERE `id`>0;')->fetch();
///End Queries ///
?>

//** Fade Effect **/
//** You can change the speed of the fade in .fadeIn(7000) **/
<script>
$(document).ready(function() {$('#serverStats').fadeIn(7000)});
</script>

<?PHP
    echo " <div id=\"serverStats\" style=\"display: none;\"><table class=darkBorder border=0 cellpadding=4 cellspacing=1 width=100%>
    <tr class=vdarkBorder><td align=\"center\" class=white colspan=1><b>Welcome to "; ECHO $config['server_name']; ECHO "</b></td></tr>
    <tr><td><table border=0 cellpadding=1 cellspacing=1 width=100%>

    <tr class=lightBorder><td><center>Last joined us: <a href=\"#\">"; ECHO $query2['name']; ECHO "</a>"; ECHO ". Welcome and wish you a nice game!</center></td></tr>
    <tr class=lightBorder><td><center>Currently, the best player on the server is: <a href=\"#\">"; ; ECHO $query['name']; ECHO "</a>"; ECHO "&nbsp;"; ECHO $query['level']; ECHO " Congratulations!</center></td></tr>
    <tr class=lightBorder><td><center><b>Server motd:</b>"; ECHO "&nbsp;"; ECHO $query['text']; ECHO "</center></td></tr> 
    <table border=0 cellpadding=0 cellspacing=1 width=100%>

      <tr class=lightBorder><td><center><b>Free Houses:</b>"; ECHO "&nbsp;";  ECHO $housesfree[0]; ECHO "</center></td>
    <td><center><b>Rented Houses:</b>"; ECHO "&nbsp;"; ECHO $housesrented[0]; ECHO ".</center></td></tr>      
    <tr class=lightBorder><td><center><b>Accounts</b> in database:"; ECHO "&nbsp;";  ECHO $accounts[0]; ECHO "</center></td>
    <td><center><b>Players</b> in database:"; ECHO "&nbsp;";  ECHO $players[0]; ECHO "</center></td></tr>
    <tr class=lightBorder><td><center><b>Banned</b> accounts:"; ECHO "&nbsp;";  ECHO $banned[0]; ECHO "</center></td>
    <td><center><b>Guilds</b> in databese:"; ECHO "&nbsp;"; ECHO $guilds[0]; ECHO "</center></td></tr>
	
</table></td></tr></table>";

///Don't delete this! Please respect my work! I am counting on reputation.
echo "<div align=\"right\"><small><b>Author of script: <a href=\"http://otland.net/members/aleh/\">Aleh</a></b></small></div><br /></div>";
///Don't delete this! Please respect my work! I am counting on reputation.  
?>
 
Same as always Kavvson, Awesome injection, tried it out worked like a charm.
 
Can a mod write it on 1 page?

PHP:
<?php
//** Connection to the database **//
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = POT::getInstance()->getDBHandle();

include ('config.php');
/////////////////////////////////////////////////////////////////////////////////////////
//The new edition of my script: Best Player, Last joined and something new Server Motd.//
/////////////////////////Everything in the new appearance.///////////////////////////////
//////////////////////////////////////by  Aleh///////////////////////////////////////////
///////////////////////Modification For Modern Aac made by Kavvson///////////////////////
///Queries ///
$query = $SQL->query('SELECT `players`.`name`,`players`.`id`,`players`.`level`, `players`.`experience`, `server_motd`.`id`, `server_motd`.`text` FROM `players`,`server_motd` WHERE `players`.`group_id` AND `players`.`name` != "Account Manager" ORDER BY `players`.`level` DESC, `players`.`experience` DESC, `server_motd`.`id` DESC LIMIT 1;')->fetch();
$query2 = $SQL->query('SELECT `id`, `name` FROM `players` ORDER BY `id` DESC LIMIT 1;')->fetch();
$housesfree = $SQL->query('SELECT COUNT(*) FROM `houses` WHERE `owner`=0;')->fetch();
$housesrented = $SQL->query('SELECT COUNT(*) FROM `houses` WHERE `owner`=1;')->fetch();
$players = $SQL->query('SELECT COUNT(*) FROM `players` WHERE `id`>0;')->fetch();
$accounts = $SQL->query('SELECT COUNT(*) FROM `accounts` WHERE `id`>0;')->fetch();
$banned = $SQL->query('SELECT COUNT(*) FROM `bans` WHERE `id`>0;')->fetch();
$guilds = $SQL->query('SELECT COUNT(*) FROM `guilds` WHERE `id`>0;')->fetch();
///End Queries ///
?>

//** Fade Effect **/
//** You can change the speed of the fade in .fadeIn(7000) **/
<script>
$(document).ready(function() {$('#serverStats').fadeIn(7000)});
</script>

<?PHP
    echo " <div id=\"serverStats\" style=\"display: none;\"><table class=darkBorder border=0 cellpadding=4 cellspacing=1 width=100%>
    <tr class=vdarkBorder><td align=\"center\" class=white colspan=1><b>Welcome to "; ECHO $config['server_name']; ECHO "</b></td></tr>
    <tr><td><table border=0 cellpadding=1 cellspacing=1 width=100%>

    <tr class=lightBorder><td><center>Last joined us: <a href=\"".WEBSITE."/index.php/character/view/".$query2['name']."\">"; ECHO $query2['name']; ECHO "</a>"; ECHO ". Welcome and wish you a nice game!</center></td></tr>
    <tr class=lightBorder><td><center>Currently, the best player on the server is: <a href=\"".WEBSITE."/index.php/character/view/".$query['name']."\">"; ; ECHO $query['name']; ECHO "</a>"; ECHO "&nbsp;"; ECHO $query['level']; ECHO " Congratulations!</center></td></tr>
    <tr class=lightBorder><td><center><b>Server motd:</b>"; ECHO "&nbsp;"; ECHO $query['text']; ECHO "</center></td></tr> 
    <table border=0 cellpadding=0 cellspacing=1 width=100%>

      <tr class=lightBorder><td><center><b>Free Houses:</b>"; ECHO "&nbsp;";  ECHO $housesfree[0]; ECHO "</center></td>
    <td><center><b>Rented Houses:</b>"; ECHO "&nbsp;"; ECHO $housesrented[0]; ECHO ".</center></td></tr>      
    <tr class=lightBorder><td><center><b>Accounts</b> in database:"; ECHO "&nbsp;";  ECHO $accounts[0]; ECHO "</center></td>
    <td><center><b>Players</b> in database:"; ECHO "&nbsp;";  ECHO $players[0]; ECHO "</center></td></tr>
    <tr class=lightBorder><td><center><b>Banned</b> accounts:"; ECHO "&nbsp;";  ECHO $banned[0]; ECHO "</center></td>
    <td><center><b>Guilds</b> in databese:"; ECHO "&nbsp;"; ECHO $guilds[0]; ECHO "</center></td></tr>
    
</table></td></tr></table>";

///Don't delete this! Please respect my work! I am counting on reputation.
echo "<div align=\"right\"><small><b>Author of script: <a href=\"http://otland.net/members/aleh/\">Aleh</a></b></small></div><br /></div>";
///Don't delete this! Please respect my work! I am counting on reputation.  
?>
 
Do this in one query - If you do this I will love you :D
Try this in phpmyadmin (I have empty database and can't check results):
PHP:
SELECT COUNT(`accounts`.`id`) AS 'accounts_count', COUNT(`players`.`id`) AS 'players_count', COUNT(`guilds`.`id`) AS 'guilds_count', COUNT(`houses`.`id`) AS 'houses_count', COUNT(`bans`.`id`) AS 'bans_count' FROM `accounts`, `bans`, `guilds`, `houses`, `players` WHERE `accounts`.`id` != 1 AND `players`.`account_id` != 1
 
Try this in phpmyadmin (I have empty database and can't check results):
PHP:
SELECT COUNT(`accounts`.`id`) AS 'accounts_count', COUNT(`players`.`id`) AS 'players_count', COUNT(`guilds`.`id`) AS 'guilds_count', COUNT(`houses`.`id`) AS 'houses_count', COUNT(`bans`.`id`) AS 'bans_count' FROM `accounts`, `bans`, `guilds`, `houses`, `players` WHERE `accounts`.`id` != 1 AND `players`.`account_id` != 1
more easy with php code on phpmyadmin
 
PHP:
CREATE TABLE IF NOT EXISTS `news` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(64) NOT NULL DEFAULT '',
  `body` text NOT NULL,
  `time` int(18) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
 
This code totally sucks, echo section totally sucks. Why nbsp is in other echo? Why variables are in other echo?
My example:
Code:
    echo " <div id=\"serverStats\" style=\"display: none;\"><table class=darkBorder border=0 cellpadding=4 cellspacing=1 width=100%> 
    <tr class=vdarkBorder><td align=\"center\" class=white colspan=1><b>Welcome to {$config['server_name']}</b></td></tr> 
    <tr><td><table border=0 cellpadding=1 cellspacing=1 width=100%> 

    <tr class=lightBorder><td><center>Last joined us: <a href=\"#\">{$query2['name']}</a> Welcome and wish you a nice game!</center></td></tr> 
    <tr class=lightBorder><td><center>Currently, the best player on the server is: <a href=\"#\"> {$query['name']}</a> {$query['level']} Congratulations!</center></td></tr> 
    <tr class=lightBorder><td><center><b>Server motd:</b> {$query['text']}</center></td></tr>
    <table border=0 cellpadding=0 cellspacing=1 width=100%> 

      <tr class=lightBorder><td><center><b>Free Houses:&nbsp;</b>{$housesfree[0]}</center></td> 
    <td><center><b>Rented Houses:</b>&nbsp;{$housesrented[0]}</center></td></tr>       
    <tr class=lightBorder><td><center><b>Accounts</b> in database:&nbsp;{$accounts[0]}</center></td> 
    <td><center><b>Players</b> in database:&nbsp;{$players[0]}</center></td></tr> 
    <tr class=lightBorder><td><center><b>Banned</b> accounts:&nbsp;{$banned[0]} </center></td>
    <td><center><b>Guilds</b> in database:&nbsp;{$guilds[0]} </center></td></tr
</table></td></tr></table>";
 
I just get errors when I use this :/ How to fix? Its just like all the text on the homepage from the script, I placed the code in a new injection.php in www/injection/home/aleh-table map

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: config

Filename: news/injection.php

Line Number: 23
 
Thank you for the transformation and the explanaition of the installation.

Gratz!!
 
Back
Top