To use the script all you have to do is include it in your own PHP page and initialise the class. Then, wherever you want the number of online users to show, you call the display_count() function.
- Code: Select all
include('online_users.php');
$online_users = new online_users();
// Display the count.
echo $online_users->display_count();
Or you can assign the count to a variable use to later on in your page, like so:
- Code: Select all
$users_online_count = $online_users->display_count();
I've also included a function so that you can install the table that logs the info. Simply call the function:
- Code: Select all
$online_users->install();
Then visit the page once (in your browser), although it doesn't matter if you visit more than once as txtSQL will give a warning after the table is created.
There are some configuration values at the top of the script that you will probably want to change, so it's worth having a look at them first.
There is no license. You can do whatever you like with it.
I think that's it. Here are the download links:
Mirror 1 (files-upload.com)
Mirror 2 (mediafire.com)
Enjoy!
