See the footer of this page!
Open online.php
Make sure to read the comments
Variables that need be edited
$db['h'] = 'localhost';
The hostname of your MySQL server, most likely localhost.
$db['u'] = 'user';
Username of the user for your MySQL database
$db['p'] = 'pass';
Password of the user for your MySQL database
$db['d'] = 'database';
Name of your MySQL database
define('UO_TIMEOUT', 300);
300 is the timeout, in seconds, of the script. Users who have been inactive for this amount of time will no longer be counted as online. Change the 300 to change the timeout. 300 seconds = 5 minutes
Upload the whole users-online folder to the root of your website
Point your browser to the install.php file on your website. This will most likly be: www.yourdomain.com/users-online/install.php
This will check your database settings in online.php and then attempt to create the required tables and insert some information
Once this process is complete, delete install.php from your server
The script is now ready to go, it's just a matter of adding it to your current website.
Copy and paste the following code into your PHP pages:
<?php
include_once('users-online/online.php');
list($online, $record) = users_online();
?>
<p>There are currently <?=$online?> users online. The most ever online is <?=$record?></p>
You may have to change users-online/online.php to point to the correct location of online.php on your server, relative to the page you are putting the code into.
You can easily style and change the output, just use <?=$online?> and <?=$record?> to display the current online count and the record online count!
You can get help, support for this script plus other web design and development tips from our webmaster forums: http://community.spyka.co.uk/forumdisplay.php?f=9