1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
|
/* ############## Who was here ############## */
if(!$date_today) die('Insert the php-code from the "who was here"- addon, in the global.php!!');
if(!$lang->items['LANG_START_WWH_USER_ONE']) die('Import the languages files from the "who was here"- addon, in the ACP!!');
if (isset($_REQUEST['wwh'])) $wwh = $_REQUEST['wwh'];
else $wwh = 'vistit';
if (isset($_REQUEST['sort'])) $sort = $_REQUEST['sort'];
else $sort = 'ASC';
if (isset($_REQUEST['decode'])) $decode = $_REQUEST['decode'];
else $decode = 'slap';
unset($count);
$count = 0;
$wwh_guestcount = 0;
$wwh_membercount = 0;
$wwh_invisiblecount = 0;
$result = $db->unbuffered_query("SELECT s.userid, s.vistit, u.username, u.useronlinegroupid, g.useronlinemarking, u.invisible FROM bb".$n."_wwh s LEFT JOIN bb".$n."_users u USING (userid) LEFT JOIN bb".$n."_groups g ON g.groupid=u.useronlinegroupid ".(($wbbuserdata['ignorelist']) ? ("WHERE s.userid NOT IN (".str_replace(" ", ",", $wbbuserdata['ignorelist']).")") : (""))." ORDER BY s.$wwh $sort");
while ($row = $db->fetch_array($result))
{
if ($row['userid'] == '0') $wwh_guestcount++;
else {
$wwh_membercount++;
if ($row['invisible'] == '1') $wwh_invisiblecount++;
$userid = $row['userid'];
$username = $row['username'];
$buddies = explode(' ', $row['buddylist']);
if (in_array($row['userid'], $buddies)) eval("\$username = \"".$tpl->get("useronline_buddy")."\";");
$wwh_user_time = formatdate($wbbuserdata['timeformat'],$row['vistit']);
if ($row['useronlinemarking'] != '') $username = sprintf($row['useronlinemarking'], $username);
if ($row['invisible'] == '1' AND $wbbuserdata['a_can_view_ghosts'] == '1') {
$invisible = '1';
$count++;
eval("\$wwh_useronlinebit_tpl = \"".$tpl->get("index_useronline_wwh")."\";");
if ($count>1) $wwh_useronlinebit .= ", ".$wwh_useronlinebit_tpl;
else $wwh_useronlinebit .= $wwh_useronlinebit_tpl;
}
if ($row['invisible'] == '0') {
$invisible = '0';
$count++;
eval("\$wwh_useronlinebit_tpl = \"".$tpl->get("index_useronline_wwh")."\";");
if ($count>1) $wwh_useronlinebit .= ", ".$wwh_useronlinebit_tpl;
else $wwh_useronlinebit .= $wwh_useronlinebit_tpl;
}
}
}
if($wwh_invisiblecount == '1') $wwh_GHOST = $lang->items['LANG_START_WWH_GHOST_ONE'];
else $wwh_GHOST = $lang->items['LANG_START_WWH_GHOST'];
if($wwh_membercount == '1') {
$wwh_USER = $lang->items['LANG_START_WWH_USER_ONE'];
$wwh_USER_BE = $lang->items['LANG_START_WWH_BE_ONE'];
} else {
$wwh_USER = $lang->items['LANG_START_WWH_USER'];
$wwh_USER_BE = $lang->items['LANG_START_WWH_BE'];
}
if($wwh_guestcount == '1') $wwh_GUEST = $lang->items['LANG_START_WWH_GUEST_ONE'];
else $wwh_GUEST = $lang->items['LANG_START_WWH_GUEST'];
if (($totaluseronline<$rekord OR $rekord==$totaluseronline) AND $wwh_membercount>$wwh_record_user AND ($wwh_record_gast>$wwh_guestcount OR $wwh_guestcount==$wwh_record_gast)) {
$db->unbuffered_query("UPDATE bb".$n."_options SET value='$wwh_membercount' WHERE varname='wwh_record_user'");
$db->unbuffered_query("UPDATE bb".$n."_options SET value=".time()." WHERE varname='wwh_record_usertime'");
require("./acp/lib/class_options.php");
$option = &new options("acp/lib");
$option->write();
}
if (($totaluseronline<$rekord OR $rekord==$totaluseronline) AND $wwh_guestcount>$wwh_record_gast) {
$db->unbuffered_query("UPDATE bb".$n."_options SET value='$wwh_guestcount' WHERE varname='wwh_record_gast'");
$db->unbuffered_query("UPDATE bb".$n."_options SET value=".time()." WHERE varname='wwh_record_gasttime'");
require("./acp/lib/class_options.php");
$option = &new options("acp/lib");
$option->write();
}
if ($wwh_record_gasttime) $wwh_record_gast_date = formatdate($wbbuserdata['dateformat'],$wwh_record_gasttime);
if ($wwh_record_usertime) $wwh_record_user_date = formatdate($wbbuserdata['dateformat'],$wwh_record_usertime);
$lang->items['LANG_START_WWH_DESC'] = $lang->get("LANG_START_WWH_DESC", array('$wwh_USER_BE' => $wwh_USER_BE, '$wwh_membercount' => $wwh_membercount, '$wwh_USER' => $wwh_USER, '$wwh_invisiblecount' => $wwh_invisiblecount, '$wwh_GHOST' => $wwh_GHOST, '$wwh_guestcount' => $wwh_guestcount, '$wwh_GUEST' => $wwh_GUEST, '$wwh_record_gast' => $wwh_record_gast, '$wwh_record_gast_date' => $wwh_record_gast_date, '$wwh_record_user' => $wwh_record_user, '$wwh_record_user_date' => $wwh_record_user_date));
$lang->items['LANG_START_WWH_SORT'] = $lang->get("LANG_START_WWH_SORT", array('$SID_ARG_2ND' => $SID_ARG_2ND)); |