View file system/inc/classes/guest.class.php

File size: 856B
<?php
/**
 * @name SHCMS Engine
 * @copyright Shamsik © 2012
 */
 


abstract class  guest_listing
{
     public function online_guest()
    {
	global $user_id,$vi_shcms,$ua;
	
          $sys = mysql_fetch_array(mysql_query("SELECT * FROM `online_guest` WHERE `ip` = '$vi_shcms'"));
       if(!$user_id)
	   {
       if($sys['ip'] == $vi_shcms)
	    {
          mysql_query("UPDATE `online_guest` SET `ip`='$vi_shcms',`time`='".time()."',`ua`='$ua' WHERE `ip` = $sys[ip]");
        }
       else
        {
          mysql_query("INSERT INTO `online_guest` (`ip`,`time`,`ua`) VALUES ('$vi_shcms','".time()."',`ua`='$ua')");
        }
       }
          mysql_query("DELETE FROM `online_guest` WHERE `time` < '".(time()-600)."' AND `ip`='$vi_shcms'");
          mysql_query("OPTIMIZE TABLE `online_guest`");

    }
}




?>