function wsity($id = '') { //////////////////////////////////////////////////////////// // Счетчик Онлайн Города // //////////////////////////////////////////////////////////// global $realtime; $onltime = $realtime - 300; $count = 0; $qf = @mysql_query("select * from `users` where lastdate>='" . $onltime . "';"); while ($arrf = mysql_fetch_array($qf)) { $whf = mysql_query("select * from `count` where name='" . $arrf['name'] . "' order by time desc ;"); while ($whf1 = mysql_fetch_array($whf)) { $whf2[] = $whf1['where']; } $wherf = $whf2[0]; $whf2 = array(); $wherf1 = explode(",", $wherf); if (empty($id)) { if ($wherf1[0] == "sity") { $count = $count + 1; } } else { if ($wherf == "sity,$id") { $count = $count + 1; } } } return $count; }