[Znote AAC] Online players records

cbrm

Just another mod
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,550
Best answers
1
Likes
802
Location
Caribbean Sea
#1
Only for TFS 0.3, unless you add the record tables to your 0.2 db and edit your record globalevent like 0.3

Preview:



record.php
PHP:
<?php 
#    Online Players Records for ZnoteAAC
#    By cbrm @ otland.net

require_once 'engine/init.php'; include 'layout/overall/header.php';
echo'<h1>Online Players Records</h1>';
$record = mysql_query('SELECT * FROM `server_record` ORDER BY `record` DESC LIMIT 20;');
while ($row = mysql_fetch_assoc($record)) {$data[] = $row;}
if (empty($data)) {echo 'This server is not born yet.'; return include 'layout/overall/footer.php';}
?>

<center>
    Max amount of online players was of <?php echo $data[0]['record'] ?> players on <?php echo date("M j Y", $data[0]['timestamp']) ?>
</center>

<table>
<tr class="yellow">
    <td width="30%">
        <span style="font-weight:bold;">Players</span>
    </td>
    <td width="70%">
        <span style="font-weight:bold;">Date</span>
    </td>
</tr>

<?php
foreach($data as $record):
    echo'<tr><td>'.$record['record'].'</td>';
    echo'<td>'.date("M j Y, H:i:s T", $record['timestamp']).'</td></tr>';
endforeach;
echo'</table>'; include 'layout/overall/footer.php'; ?>
 
Last edited:

cbrm

Just another mod
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,550
Best answers
1
Likes
802
Location
Caribbean Sea
#3
Save code as "record.php" in your znote folder

Code:
localhost/record.php
You can add link at template with:
PHP:
<li><a href="record.php">Online Records</a></li>
 

Spankarn

New Member
Joined
Jul 1, 2010
Messages
101
Best answers
0
Likes
1
#4
Save code as "record.php" in your znote folder

Code:
localhost/record.php
You can add link at template with:
PHP:
<li><a href="record.php">Online Records</a></li>
do you mean my znote folder in phpmyadmin?:eek:
 

gerard95

Keep cool :)
Joined
Dec 31, 2011
Messages
276
Best answers
0
Likes
10
#8
Do you know how to start this script from 0? I mean, my server isn't officially opened yet, and when I open it I'd like to "reset" the record table. Thank you:)
 
Joined
Jun 9, 2008
Messages
188
Best answers
0
Likes
9
#10
i get this error sometimes
Code:
Fatal error: [] operator not supported for strings in C:\xampp\htdocs\record.php on line 8

and after many refreshes show the record
 

addewe

New Member
Joined
Jan 14, 2015
Messages
25
Best answers
0
Likes
2
#16
Online Players Records

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given inD:\xxmap\htdocs\record.php on line 8
This server is not born yet.
 
Top