[Znote AAC] Online players records

Discussion in 'Website Applications' started by cbrm, Oct 8, 2012.

  1. cbrm

    cbrm Just another mod Staff Member Global Moderator

    Joined:
    Jan 6, 2009
    Messages:
    6,541
    Likes Received:
    834
    Best Answers:
    0
    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:

    [​IMG]

    record.php
    PHP:
    1. <?php
    2. #    Online Players Records for ZnoteAAC
    3. #    By cbrm @ otland.net
    4.  
    5. require_once 'engine/init.php'; include 'layout/overall/header.php';
    6. echo'<h1>Online Players Records</h1>';
    7. $record = mysql_query('SELECT * FROM `server_record` ORDER BY `record` DESC LIMIT 20;');
    8. while ($row = mysql_fetch_assoc($record)) {$data[] = $row;}
    9. if (empty($data)) {echo 'This server is not born yet.'; return include 'layout/overall/footer.php';}
    10. ?>
    11.  
    12. <center>
    13.     Max amount of online players was of <?php echo $data[0]['record'] ?> players on <?php echo date("M j Y", $data[0]['timestamp']) ?>
    14. </center>
    15.  
    16. <table>
    17. <tr class="yellow">
    18.     <td width="30%">
    19.         <span style="font-weight:bold;">Players</span>
    20.     </td>
    21.     <td width="70%">
    22.         <span style="font-weight:bold;">Date</span>
    23.     </td>
    24. </tr>
    25.  
    26. <?php
    27. foreach($data as $record):
    28.     echo'<tr><td>'.$record['record'].'</td>';
    29.     echo'<td>'.date("M j Y, H:i:s T", $record['timestamp']).'</td></tr>';
    30. endforeach;
    31. echo'</table>'; include 'layout/overall/footer.php'; ?>
     
    Last edited: Oct 9, 2012
    gerard95 likes this.
  2. Spankarn

    Spankarn New Member

    Joined:
    Jul 1, 2010
    Messages:
    101
    Likes Received:
    1
    Best Answers:
    0
    can you tell me how to install xD?
     
  3. cbrm

    cbrm Just another mod Staff Member Global Moderator

    Joined:
    Jan 6, 2009
    Messages:
    6,541
    Likes Received:
    834
    Best Answers:
    0
    Save code as "record.php" in your znote folder

    Code (Text):
    1.  
    2. localhost/record.php
    3.  
    You can add link at template with:
    PHP:
    1. <li><a href="record.php">Online Records</a></li>
     
  4. Spankarn

    Spankarn New Member

    Joined:
    Jul 1, 2010
    Messages:
    101
    Likes Received:
    1
    Best Answers:
    0
    do you mean my znote folder in phpmyadmin?:eek:
     
  5. cbrm

    cbrm Just another mod Staff Member Global Moderator

    Joined:
    Jan 6, 2009
    Messages:
    6,541
    Likes Received:
    834
    Best Answers:
    0
    your htdocs folder if windows or www directory if linux
     
  6. Nightss

    Nightss Normal People

    Joined:
    May 18, 2013
    Messages:
    56
    Likes Received:
    12
    Best Answers:
    0
    Nice,
    This PHP Go To My Server
    :D
     
    cbrm likes this.
  7. Mr.Bela

    Mr.Bela Back :P

    Joined:
    Apr 23, 2011
    Messages:
    773
    Likes Received:
    42
    Best Answers:
    0
    Thanks :p
     
  8. gerard95

    gerard95 Keep cool :)

    Joined:
    Dec 31, 2011
    Messages:
    276
    Likes Received:
    16
    Best Answers:
    0
    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:)
     
  9. Oldschool'er

    Oldschool'er Tibia since 1998'

    Joined:
    Dec 14, 2010
    Messages:
    2,205
    Likes Received:
    144
    Best Answers:
    0
    how do i make it a button from the site?
     
  10. Esparda

    Esparda Member

    Joined:
    Jun 9, 2008
    Messages:
    188
    Likes Received:
    9
    Best Answers:
    0
    i get this error sometimes
    Code (Text):
    1. Fatal error: [] operator not supported for strings in C:\xampp\htdocs\record.php on line 8

    and after many refreshes show the record
     
  11. Peonso

    Peonso 1337

    Joined:
    Jan 14, 2008
    Messages:
    1,381
    Likes Received:
    885
    Best Answers:
    20
  12. silveralol

    silveralol Well-Known Member

    Joined:
    Mar 16, 2010
    Messages:
    1,457
    Likes Received:
    189
    Best Answers:
    7
    how make work in tfs 1.2?
     
  13. God Mythera

    God Mythera Well-Known Member

    Joined:
    Aug 11, 2012
    Messages:
    2,024
    Likes Received:
    238
    Best Answers:
    2
    it says this...


    Online Players Records
    This server is not born yet.
     
  14. silveralol

    silveralol Well-Known Member

    Joined:
    Mar 16, 2010
    Messages:
    1,457
    Likes Received:
    189
    Best Answers:
    7
    "Only for TFS 0.3", then I ask how make it work in 1.2 ;)
     
  15. God Mythera

    God Mythera Well-Known Member

    Joined:
    Aug 11, 2012
    Messages:
    2,024
    Likes Received:
    238
    Best Answers:
    2
    i already got it.
     
  16. addewe

    addewe New Member

    Joined:
    Jan 14, 2015
    Messages:
    12
    Likes Received:
    2
    Best Answers:
    0
    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.
     

Share This Page

Loading...