2011-03-28 14:21:28 +00:00
|
|
|
<?
|
|
|
|
function get_fls() {
|
|
|
|
global $Cache, $DB;
|
|
|
|
static $FLS;
|
2013-04-13 08:00:19 +00:00
|
|
|
if (is_array($FLS)) {
|
2011-03-28 14:21:28 +00:00
|
|
|
return $FLS;
|
|
|
|
}
|
2013-04-13 08:00:19 +00:00
|
|
|
if (($FLS = $Cache->get_value('fls')) === false) {
|
2011-03-28 14:21:28 +00:00
|
|
|
$DB->query("SELECT
|
2013-04-13 08:00:19 +00:00
|
|
|
m.ID,
|
|
|
|
p.Level,
|
|
|
|
m.Username,
|
|
|
|
m.Paranoia,
|
|
|
|
m.LastAccess,
|
|
|
|
i.SupportFor
|
2011-03-28 14:21:28 +00:00
|
|
|
FROM users_info AS i
|
2013-04-13 08:00:19 +00:00
|
|
|
JOIN users_main AS m ON m.ID=i.UserID
|
|
|
|
JOIN permissions AS p ON p.ID=m.PermissionID
|
|
|
|
JOIN users_levels AS l ON l.UserID = i.UserID
|
2013-02-07 08:00:47 +00:00
|
|
|
WHERE l.PermissionID = ".FLS_TEAM);
|
2011-12-02 08:00:15 +00:00
|
|
|
$FLS = $DB->to_array(false, MYSQLI_BOTH, array(3,'Paranoia'));
|
2011-03-28 14:21:28 +00:00
|
|
|
$Cache->cache_value('fls', $FLS, 180);
|
|
|
|
}
|
|
|
|
return $FLS;
|
|
|
|
}
|
|
|
|
|
2011-07-10 08:00:06 +00:00
|
|
|
function get_forum_staff() {
|
|
|
|
global $Cache, $DB;
|
|
|
|
static $ForumStaff;
|
2013-04-13 08:00:19 +00:00
|
|
|
if (is_array($ForumStaff)) {
|
2011-07-10 08:00:06 +00:00
|
|
|
return $ForumStaff;
|
|
|
|
}
|
2013-04-13 08:00:19 +00:00
|
|
|
if (($ForumStaff = $Cache->get_value('forum_staff')) === false) {
|
2011-07-10 08:00:06 +00:00
|
|
|
$DB->query("SELECT
|
2013-04-13 08:00:19 +00:00
|
|
|
m.ID,
|
|
|
|
p.Level,
|
|
|
|
m.Username,
|
|
|
|
m.Paranoia,
|
|
|
|
m.LastAccess,
|
|
|
|
i.SupportFor
|
2011-07-10 08:00:06 +00:00
|
|
|
FROM users_main AS m
|
2013-04-13 08:00:19 +00:00
|
|
|
JOIN users_info AS i ON m.ID=i.UserID
|
|
|
|
JOIN permissions AS p ON p.ID=m.PermissionID
|
2011-07-10 08:00:06 +00:00
|
|
|
WHERE p.DisplayStaff='1'
|
|
|
|
AND p.Level < 700
|
|
|
|
ORDER BY p.Level, m.LastAccess ASC");
|
2011-12-02 08:00:15 +00:00
|
|
|
$ForumStaff = $DB->to_array(false, MYSQLI_BOTH, array(3,'Paranoia'));
|
2011-07-10 08:00:06 +00:00
|
|
|
$Cache->cache_value('forum_staff', $ForumStaff, 180);
|
|
|
|
}
|
|
|
|
return $ForumStaff;
|
|
|
|
}
|
|
|
|
|
2011-03-28 14:21:28 +00:00
|
|
|
function get_staff() {
|
|
|
|
global $Cache, $DB;
|
|
|
|
static $Staff;
|
2013-04-13 08:00:19 +00:00
|
|
|
if (is_array($Staff)) {
|
2011-03-28 14:21:28 +00:00
|
|
|
return $Staff;
|
|
|
|
}
|
2013-04-13 08:00:19 +00:00
|
|
|
if (($Staff = $Cache->get_value('staff')) === false) {
|
2011-03-28 14:21:28 +00:00
|
|
|
$DB->query("SELECT
|
2013-04-13 08:00:19 +00:00
|
|
|
m.ID,
|
|
|
|
p.Level,
|
|
|
|
p.Name,
|
|
|
|
m.Username,
|
|
|
|
m.Paranoia,
|
|
|
|
m.LastAccess,
|
|
|
|
i.SupportFor
|
2011-03-28 14:21:28 +00:00
|
|
|
FROM users_main AS m
|
2013-04-13 08:00:19 +00:00
|
|
|
JOIN users_info AS i ON m.ID=i.UserID
|
|
|
|
JOIN permissions AS p ON p.ID=m.PermissionID
|
2011-03-28 14:21:28 +00:00
|
|
|
WHERE p.DisplayStaff='1'
|
2011-07-10 08:00:06 +00:00
|
|
|
AND p.Level >= 700
|
2011-03-28 14:21:28 +00:00
|
|
|
ORDER BY p.Level, m.LastAccess ASC");
|
2011-12-02 08:00:15 +00:00
|
|
|
$Staff = $DB->to_array(false, MYSQLI_BOTH, array(4,'Paranoia'));
|
2011-03-28 14:21:28 +00:00
|
|
|
$Cache->cache_value('staff', $Staff, 180);
|
|
|
|
}
|
|
|
|
return $Staff;
|
|
|
|
}
|
|
|
|
|
|
|
|
function get_support() {
|
|
|
|
return array(
|
2011-07-10 08:00:06 +00:00
|
|
|
get_fls(),
|
|
|
|
get_forum_staff(),
|
|
|
|
get_staff(),
|
2011-03-28 14:21:28 +00:00
|
|
|
'fls' => get_fls(),
|
2011-07-10 08:00:06 +00:00
|
|
|
'forum_staff' => get_forum_staff(),
|
2011-03-28 14:21:28 +00:00
|
|
|
'staff' => get_staff()
|
|
|
|
);
|
|
|
|
}
|