Location: PHPKode > projects > phpCAMALEO > common/contents/stat_useronline.inc
<?php
if(function_exists('stat_useronline'))	return;

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# version: 19 September 2006
#
function stat_useronline($from,$to)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
	global $tot_value;
	$args="SELECT DISTINCT stat_online_date, stat_online_user, stat_online_ip

				FROM g_stat_online
				WHERE stat_online_skin='".$_SESSION[misc][skin]."' AND stat_online_date>='$from' AND stat_online_date<='$to'

				GROUP BY stat_online_date, stat_online_ip
				ORDER BY stat_online_date ASC, stat_online_ip ASC ";
	$sth=db_query($args);
	#
	$data_label[0]=SS_U1;
	$data_label[1]=SS_U2;
	$data_label[2]=SS_U3;
	#
	#	Load array data
	#
	if($sth[1]>0)
	{
		$rows=db_fetch($sth[0]);
		$i=0; $ii=0;
		foreach($rows as $key=>$val) 
		{
			unset($tmp_array); $tmp_array=$rows[$i]; $fields_record=count($tmp_array);	# Nr of fields per record
			reset($tmp_array); # Set to the first array field
			#
			while($tmp_next=each($tmp_array))
			{
				#	$labels[$ii]=$tmp_next['key'];	# Show fields names
				$labels[$ii]=$data_label[$ii];
				$table_field[$ii]=$tmp_next[value];
				if(strlen($table_field[$ii])>25) { $table_field[$ii]=SS_U4; }
				$ii++;
			}
			$i++;
		}
		DecodeIP(10,'',$data_label,$labels,$table_field,$fields_record,'ip');
		?><br />
		<fieldset class="sstat"><legend class="sstat" align="center">&nbsp;<?=SS_14?>&nbsp;</legend><?php ShowTable($labels,$table_field,$fields_record,'100%','center',true,'H','','Y'); ?></fieldset>
		<h6><?=SS_19?></h6><input class="button_sml" type="submit" name="submit" value="<?=SS_20?>" /><br />
		<?php
		return(true);
	}
	else
	{
		?><div align="center"><h3><?=SS_22?></h3></div><?php
		return(false);
	}
}
?>
Return current item: phpCAMALEO