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

[Znote AAC] Server information stats summary table

Raggaer

Godly Member
Joined
Jul 25, 2012
Messages
1,557
Solutions
8
Reaction score
957
Location
Spain
Hello, I made this simple script for znote acc based on the gesior one
*Note: tested on TFS 2.0!

- Photo -

Untitled-2.jpg

- Install -

Open index.php and locate this part
PHP:
<?php
// Load the data from SQL or cache
$cache = new Cache('engine/cache/serverstats');
if ($cache->hasExpired()) {
    $stats = array(
        'newPlayer' => mysql_select_single("SELECT `id`, `name` FROM `players` ORDER BY `id` DESC LIMIT 1"),
        'playerCount' => mysql_select_single("SELECT COUNT(`id`) as `value` FROM `players`"),
        'bestPlayer' => mysql_select_single("SELECT `name`, `level` FROM `players` ORDER BY `level` DESC LIMIT 1"),
        'accountCount' => mysql_select_single("SELECT COUNT(`id`) as `value` FROM `accounts`"),
        'guildCount' => mysql_select_single("SELECT COUNT(`id`) as `value` FROM `guilds`")
    );
    $cache->setContent($stats);
    $cache->save();
} else {
    $stats = $cache->load();
}

// Present the data:
?>

<table border="0" cellspacing="0">
    <tr class="yellow">
        <td><center>Server Information</center></td>
    </tr>
    <tr>
        <td>
            <center><?php
                echo 'Welcome to our newest player: <a href="characterprofile.php?name='.$stats['newPlayer']['name'].'">'.$stats['newPlayer']['name'].'</a>';
            ?></center>
        </td>
    </tr>
    <tr>
        <td>
            <center><?php
                echo 'The best player is: <a href="characterprofile.php?name='.$stats['bestPlayer']['name'].'">'.$stats['bestPlayer']['name'].'</a> level: '.$stats['bestPlayer']['level'].' congratulations!';
            ?></center>
        </td>
    </tr>
    <tr>
        <td>
            <center><?php
                echo 'We have <b>'.$stats['accountCount']['value'].'</b> accounts in our database, <b>'.$stats['playerCount']['value'].'</b> players, and <b>'.$stats['guildCount']['value'].' </b>guilds';
            ?></center>
        </td>
    </tr>
</table>

We are done._
 
Last edited by a moderator:
The total accounts, players & guilds may not be as accurate as you would think. You are simply fetching the latest ID from the database, what if a few rows were deleted? Or even a thousand rows? Rather than selecting the ID, use the MySQL count function.

Good job on contributing to Znote AAC and the community though!
 
Approved

Silly Chris probably didn't even noticed this thread has to be Approved xD
 
PHP:
<?PHP
echo '<table border="0" cellspacing="0"><tr class="yellow"><td><center>Server Information</center></td></tr>
<tr><td>';
$getshit11 = mysql_query("SELECT `id`, `name` FROM `players` ORDER BY `id` DESC LIMIT 1"); 
$fetchshitt = mysql_fetch_assoc($getshit11); 
$getshit1 = mysql_query("SELECT COUNT(*) as `shit` FROM `players` ");
$fetchshit = mysql_fetch_assoc($getshit1);
$getshit2 = mysql_query("SELECT `name`, `level` FROM `players` ORDER BY `level` DESC LIMIT 1");
$fetchshit2 = mysql_fetch_assoc($getshit2);
$getshit3 = mysql_query("SELECT COUNT(*) as `shiter` FROM `accounts` ");
$fetchshit3 = mysql_fetch_assoc($getshit3);
$getshit4 = mysql_query("SELECT COUNT(*) as `yea` FROM `guilds` ");
$fetchshit4 = mysql_fetch_assoc($getshit4);
echo '<center>Welcome to our newest player: <a href="characterprofile.php?name='.$fetchshitt['name'].'">'.$fetchshitt['name'].'</a></center></td></tr>';
echo '<tr><td><center>The best player is: <a href="characterprofile.php?name='.$fetchshit2['name'].'">'.$fetchshit2['name'].'</a> level: '.$fetchshit2['level'].' congratulations!</center></td></tr>';
echo '<tr><td><center>We have <b>'.$fetchshit3['shiter'].'</b> accounts in our database, <b>'.$fetchshit['shit'].'</b> players, and <b>'.$fetchshit4['yea'].' </b>guilds </center></td></tr>';
echo '</table>';
?>

mm updated maybe this will be better?
 
Approved

Silly Chris probably didn't even noticed this thread has to be Approved xD
Hahaha... I just wanted to see if you were doing your job properly!!

PHP:
<?PHP
echo '<table border="0" cellspacing="0"><tr class="yellow"><td><center>Server Information</center></td></tr>
<tr><td>';
$getshit11 = mysql_query("SELECT `id`, `name` FROM `players` ORDER BY `id` DESC LIMIT 1"); 
$fetchshitt = mysql_fetch_assoc($getshit11); 
$getshit1 = mysql_query("SELECT COUNT(*) as `shit` FROM `players` ");
$fetchshit = mysql_fetch_assoc($getshit1);
$getshit2 = mysql_query("SELECT `name`, `level` FROM `players` ORDER BY `level` DESC LIMIT 1");
$fetchshit2 = mysql_fetch_assoc($getshit2);
$getshit3 = mysql_query("SELECT COUNT(*) as `shiter` FROM `accounts` ");
$fetchshit3 = mysql_fetch_assoc($getshit3);
$getshit4 = mysql_query("SELECT COUNT(*) as `yea` FROM `guilds` ");
$fetchshit4 = mysql_fetch_assoc($getshit4);
echo '<center>Welcome to our newest player: <a rel="nofollow" href="characterprofile.php?name='.$fetchshitt['name'].'">'.$fetchshitt['name'].'</a></center></td></tr>';
echo '<tr><td><center>The best player is: <a rel="nofollow" href="characterprofile.php?name='.$fetchshit2['name'].'">'.$fetchshit2['name'].'</a> level: '.$fetchshit2['level'].' congratulations!</center></td></tr>';
echo '<tr><td><center>We have <b>'.$fetchshit3['shiter'].'</b> accounts in our database, <b>'.$fetchshit['shit'].'</b> players, and <b>'.$fetchshit4['yea'].' </b>guilds </center></td></tr>';
echo '</table>';
?>

mm updated maybe this will be better?
Yeah, that should do. :)
 
liez!!

I've been approving threads for 1 year now, I suppose I already have enough practice xD
 
This was the final test. You're a global moderator now, you needed a bit of a reminder!! :rolleyes:
 
Using it on TFS_03, Im new to this, but I removed "<?PHP" in the start and "?>" in the end and it worked! :)


Code:
echo '<table border="0" cellspacing="0"><tr class="yellow"><td><center>Server Information</center></td></tr>
<tr><td>';
$getshit11 = mysql_query("SELECT `id`, `name` FROM `players` ORDER BY `id` DESC LIMIT 1"); 
$fetchshitt = mysql_fetch_assoc($getshit11); 
$getshit1 = mysql_query("SELECT COUNT(*) as `shit` FROM `players` ");
$fetchshit = mysql_fetch_assoc($getshit1);
$getshit2 = mysql_query("SELECT `name`, `level` FROM `players` ORDER BY `level` DESC LIMIT 1");
$fetchshit2 = mysql_fetch_assoc($getshit2);
$getshit3 = mysql_query("SELECT COUNT(*) as `shiter` FROM `accounts` ");
$fetchshit3 = mysql_fetch_assoc($getshit3);
$getshit4 = mysql_query("SELECT COUNT(*) as `yea` FROM `guilds` ");
$fetchshit4 = mysql_fetch_assoc($getshit4);
echo '<center>Welcome to our newest player: <a href="characterprofile.php?name='.$fetchshitt['name'].'">'.$fetchshitt['name'].'</a></center></td></tr>';
echo '<tr><td><center>The best player is: <a href="characterprofile.php?name='.$fetchshit2['name'].'">'.$fetchshit2['name'].'</a> level: '.$fetchshit2['level'].' congratulations!</center></td></tr>';
echo '<tr><td><center>We have <b>'.$fetchshit3['shiter'].'</b> accounts in our database, <b>'.$fetchshit['shit'].'</b> players, and <b>'.$fetchshit4['yea'].' </b>guilds </center></td></tr>';
echo '</table>';
 
I'm having some problem with this one. My Lastest joined Is at the bottom of the screen not at the top, anyone know what the problem is?
 
it doesnt work for me and im using 0.3.6



Server Information
Welcome to our newest player:
The best player is: level: congratulations!
We have accounts in our database, players, and guilds
 
Back
Top