Location: PHPKode > projects > eBlog > admin/online.php
<?php

/**************************************************************************
 *                                                                        *
 *                                                                        *
 *         Solution: eBlog                                                *
 *          Release: 1.7                                                  *
 *             File: admin/online.php                                     *
 *               By: Emuci inc.                                           *
 *          Website: http://www.emuci.com                                 *
 *        Copyright: (C) 2010 Emcui inc.                                  *
 *                                                                        *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *                                                                        *
 *   This script is NOT freeware and is subjected to Emuci terms of use   *
 *   located in the docs folder.                                          *
 *                                                                        *
 *                                                                        *
 *************************************************************************/


include 'global.php';

if($_SESSION['permission'] == 1){
	
	$conn = mysql_connect($dbhost, $dbuser, $dbpass);
	mysql_select_db($dbname);
	
	$query  = "SELECT id, ip, name, page FROM eblog_online ORDER BY id DESC";
	$result = mysql_query($query);	
	$onlineTable  = "
	
	<div><table bordercolor=\"#727272\" style=\"border-collapse: collapse\" width=\"100%\" cellSpacing=\"0\" cellPadding=\"3\"  border=\"1\">			
	<tr>
	<td align=\"center\" background=\"../images/icons/disc_bar.gif\"><font style=\"font-size: 0.8em;\" face=\"Tahoma\" color=\"#ffffff\">$lang_admin_id</font></td>
	<td align=\"center\" background=\"../images/icons/disc_bar.gif\"><font style=\"font-size: 0.8em;\" face=\"Tahoma\" color=\"#ffffff\">$lang_admin_ip</font></td>
	<td align=\"center\" background=\"../images/icons/disc_bar.gif\"><font style=\"font-size: 0.8em;\" face=\"Tahoma\" color=\"#ffffff\">$lang_admin_currentPage</font></td>
	</tr>
	";	
	while($row = mysql_fetch_array($result, MYSQL_ASSOC))
	{	
		$counter3++;
		
		$reminder = $counter3%2;
		if($reminder==0)
		$bgColor = "#f2f2f2";
		else
		$bgColor = "#dadada";
		
		$rowIP = $row['ip'];
		$rowPage = $row['page'];
		
		$onlineTable = $onlineTable . "<tr bgcolor=\"$bgColor\"><td align=\"center\"><font style=\"font-size: 0.8em;\" face=\"Tahoma\">".$counter3 . "</font></td><td align=\"center\"><font style=\"font-size: 0.8em;\" face=\"Tahoma\">". $rowIP . "</font></td><td align=\"center\"><font style=\"font-size: 0.8em;\" face=\"Tahoma\">" . $rowPage ."</font></td></tr>";
		
		
	}
	$onlineTable = $onlineTable . "</table></div>";
	echo $onlineTable;		
}
	
?>
Return current item: eBlog