X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-active.php;h=69a16d1de0f8fcc8473ed2dd6fe57afc7fecd248;hb=56b24f7a0fb2373847ecf00d08cfb52a0ffb5d28;hp=2d701c2ddcdc6ea37054cf5455f39d0a06aa8caf;hpb=db9da972dbe9dcd68b7f937f1c6474e680c7386b;p=mailer.git diff --git a/inc/modules/guest/what-active.php b/inc/modules/guest/what-active.php index 2d701c2ddc..69a16d1de0 100644 --- a/inc/modules/guest/what-active.php +++ b/inc/modules/guest/what-active.php @@ -35,7 +35,7 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif (!EXT_IS_ACTIVE("active")) +} elseif ((!EXT_IS_ACTIVE("active")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "active"); return; } @@ -43,25 +43,24 @@ if (!defined('__SECURITY')) { // Add description as navigation point ADD_DESCR("guest", __FILE__); -// The day normally starts on 00:00:00, so let's subtract current hours/minutes/seconds from current time stamp! -$START = time() - date("H", time())*60*60 - date("m", time())*60 - date("s", time()); - -// Check for members who were active only this day +// Extra field to include is by default uid $ADD = "uid"; + +// If nickname is installed the extra field is the nickname of the user if (EXT_IS_ACTIVE("nickname")) $ADD = "nickname"; +// Check for members who were active only this day $result = SQL_QUERY_ESC("SELECT userid, ".$ADD.", last_online FROM "._MYSQL_PREFIX."_user_data WHERE last_online >= %s AND status='CONFIRMED' ORDER BY last_online DESC LIMIT %s", - array($START, $_CONFIG['active_limit']), __FILE__, __LINE__); + array(START_TDAY, $_CONFIG['active_limit']), __FILE__, __LINE__); -if (SQL_NUMROWS($result) > 0) -{ +// Entries found? +if (SQL_NUMROWS($result) > 0) { // At least one member was online so let's load them all $OUT = ""; $SW = 2; - while(list($uid, $nick, $last) = SQL_FETCHROW($result)) - { + while(list($uid, $nick, $last) = SQL_FETCHROW($result)) { $nick2 = "---"; if (($nick != $uid) && (!empty($nick))) $nick2 = $nick; @@ -80,9 +79,7 @@ if (SQL_NUMROWS($result) > 0) // Switch colors $SW = 3 - $SW; } -} - else -{ +} else { // No member was online today! :-( $OUT = LOAD_TEMPLATE("guest_active_none_row", true); }