|
|
|
This class return online users in a website that using sessions. To give more acceptable information, sessions have been counted in an interval of 1 hour.
online class : Class that return users online optimised for an interval of one (1) hour.
@package
@author Ben Yacoub Hatem <hatem@php.net>
@copyright Copyright (c) 2004
@version $Id$ - 25/05/2004 14:04:22 - sessions.class.php
@access public
| <?php
class online{
/**
* Constructor
* @access protected
*/
function online(){
}
/**
*
* @access public
* @return void
**/
function who(){
$path = session_save_path();
if (trim($path)=="") {
return FALSE;
}
$d = dir( $path); $i = 0;
while (false !== ($entry = $d->read())) {
if ($entry!="." and $entry!="..") {
$SESS[] = $entry;
if (filemtime($path."/$entry") < strtotime('-0 days 1 hours')) {
$content[] = implode('',file($path."/$entry"));
$i++;
}
}
}
$d->close();
$result = "<span class=tab-s>$i Online users</span><br>\n";
return $result;
}
}
$o = new online;
echo $o->who();
?> | | |
|
| A beginner's session handling class Categories : PHP, PHP Classes, Sessions, Beginner Guides | | | base64 with encryption - encode and decode sessions Categories : PHP, PHP Classes, Encryption, Sessions | | | SPL and ITERATOR : examples Categories : PHP, Object Oriented, PHP Classes, Sessions | | | file class , uploade file , download file already uploaded on another website Categories : PHP, PHP Classes, Filesystem, Web Services | | | Authorize.net AIM Interface Class v1.0.0 Categories : PHP, PHP Classes, Ecommerce, Payment Gateways | | | crop and resize image class using gd library function Categories : PHP, PHP Classes, GD image library, Graphics | | | Basic Authentication with sessions Categories : PHP, Beginner Guides, Authentication, Form Processing, Sessions | | | News management class Categories : PHP, PHP Classes, Beginner Guides | | | A Timing Class Categories : PHP, PHP Classes, Date Time | | | The class to check load time of your script
VERY usefull for relatively slow applications, but not only.. Categories : PHP, PHP Classes, Debugging | | | Expose - PHP template engine, supports server and client-sided caching,a plugin system, multiple languages, template script language is based on PHP itself. Categories : PHP, PHP Classes, Templates, Complete Programs | | | XDT Topsite (Gold v1.0) Categories : Databases, CSS, PHP, HTML and PHP, Sessions | | | RSS parser.
Parses RSS into an array. Quick and nasty but does the job.
No checking is done for correct Tags, only correct XML.
PHP4 needed to display result (uses print_r). Categories : PHP, XML, PHP Classes, Rich Site Summary (RSS) | | | MS Word Mail Merge Automation (COM) Categories : PHP, PHP Classes, COM | | | ElfReader: An ELF (Executable and Linking Format) header information in PHP. Shows how to use the UNPACK function to read data. Categories : PHP, Linux, PHP Classes | |
|
|
|