<?php
/// MASTERSCLIQ USER ONLINE ///
$online = array();
$users = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `lastdate` > '" . (time() - 300) . "'"), 0);
$guests = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > '" . (time() - 300) . "'"), 0);
if ($users >= 1)
echo 'Currently:&#160;<span class="green">' . $users . '</span>&#160;user online<br/>Active User:&#160;';
else
echo 'Active User:&#160;No user online..';
$cox = @mysql_query("SELECT * FROM `users` WHERE `lastdate` >= '" . intval(time() - 300) . "' ORDER BY RAND() LIMIT 10;");
$count = mysql_num_rows($cox);
while ($arr = mysql_fetch_array($cox)) {
$where = explode(",", $arr['place']);
switch ($where[0]) {
case 'blogs' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/blogs/index.php"><font color="red">Blogs</a></font>]';
break;

case 'load' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/download/index.php"><font color="red">Download</a></font>]';
break;

case 'forum' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/forum/index.php"><font color="red">Forum</a></font>]';
break;

case 'friend' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/friend.php"><font color="red">Friend list</a></font>]';
break;

case 'album' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/album.php"><font color="red">User album</a></font>]';
break;

case 'myguests' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/my_guests.php"><font color="red">My guest</a></font>]';
break;

case 'birth' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/index.php?act=birth"><font color="red">User birth</a></font>]';
break;

case 'admlist' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/index.php?act=admlist"><font color="red">Admin list</a></font>]';
break;

case 'karma' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/profile.php?act=karma"><font color="red">Karma</a></font>]';
break;

case 'usertop' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/index.php?act=top"><font color="red">Top user</a></font>]';
break;

case 'info' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/profile.php?act=info"><font color="red">User info</a></font>]';
break;

case 'userban' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/profile.php?act=ban"><font color="red">List ban</a></font>]';
break;

case 'forumfiles' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/forum/index.php?act=files"><font color="red">Forum files</a></font>]';
break;

case 'gallery' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/gallery/index.php"><font color="red">Gallery</a></font>]';
break;

case 'password' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/profile.php?act=password"><font color="red">Change pass</a></font>]';
break;

case 'guestbook' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/guestbook/index.php"><font color="red">Guestbook</a></font>]';
break;

case 'stat' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/profile.php?act=stat"><font color="red">Statistic</a></font>]';
break;

case 'library' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/library/index.php"><font color="red">Library</a></font>]';
break;

case 'mail' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/mail/index.php"><font color="red">Mail service</a></font>]';
break;

case 'news' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/news/index.php"><font color="red">News</a></font>]';
break;

case 'shoutbox' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/shoutbox/index.php"><font color="red">Shoutbox</a></font>]';
break;

case 'my_guest' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/profile.php?act=guestbook"><font color="red">My guestbook</a></font>]';
break;

case 'forumwho' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/forum/index.php?act=who"><font color="red">Forum online</a></font>]';
break;

case 'profile' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/profile.php?act=office"><font color="red">Profile</a></font>]';
break;

case 'edit' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/profile.php?act=edit"><font color="red">Setting</a></font>]';
break;

case 'cpanel' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/profile.php?act=settings"><font color="red">Cpanel</a></font>]';
break;

case 'activity' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/profile.php?act=activity"><font color="red">Activity</a></font>]';
break;

case 'online' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/index.php?act=online"><font color="red">Who online</a></font>]';
break;

case 'userlist' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/index.php?act=userlist"><font color="red">User list</a></font>]';
break;

case 'faq' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/pages/faq.php"><font color="red">Smileys</a></font>]';
break;

case 'admin' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/panel/index.php"><font color="red">Admin panel</a></font>]';
break;

case 'message' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/users/pradd.php?act=write"><font color="red">Send message</a></font>]';
break;

case 'mainmenu' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/index.php?act=cab"><font color="red">Main menu</a></font>]';
break;

case 'mainpage' :
$place = '[<a href="' . core::$system_set['homeurl'] . 'index.php"><font color="red">Home</a></font>]';
break;

case 'friendssite' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/pages/friendssite.php"><font color="red">Friend site</a></font>]';
break;

case 'read' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/pages/faq.php?act=forum"><font color="red">Rules</a></font>]';
break;

case 'bbcode' :
$place = '[<a href="' . core::$system_set['homeurl'] . '/pages/faq.php?act=tags"><font color="red">BBcode</a></font>]';
break;

case '' :
$place = '[<a href="http://facebook.com/aderibigbep"><font color="red">Owner</a></font>]';
break;
}
$online[] = '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?user=' . $arr['id'] . '">' . nick($arr['id']) . '</a>';
}
if (($users >= 1) && ($users <= 10)) {
echo implode(', ',$online).'';
}
elseif ($users >= 20) {
$minus = $users - 10;
echo implode(', ',$users).'';
echo ' <a href="' . core::$system_set['homeurl'] . '/users/index.php?act=online">' . $minus . '&nbsp;user more..</a>';
}
//guest//
echo '<br/>Guest view:&#160;';
if ($guests >= 1)
echo '<a href="' . core::$system_set['homeurl'] . '/users/index.php?act=online&amp;mod=guest"><span class="red">' . $guests . '</a></span>&#160;visitor<br/>';
else
echo 'No visitor online..<br/>';
//new member//
echo 'New Joined Member:&#160;';
$req = mysql_query("SELECT `id`, `name`, `datereg` FROM `users` WHERE (preg='1') ORDER BY `datereg` DESC LIMIT 1; ");
$arr = mysql_fetch_array($req);
echo '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?user=' . $arr['id'] . '"><font color="blue">'.$arr['name'] .'</font></a>';
?>