X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-active.php;h=d41f722fe495d0c7665b123d1f848b94126596a4;hp=99838f8d9c234d009cdc66ee6567eeff698b12ab;hb=1e2a4228e071a67a2d79e970a843e3e30476cfb8;hpb=60494e212a67fe360bfbb481eb4928480a6f379b diff --git a/inc/modules/guest/what-active.php b/inc/modules/guest/what-active.php index 99838f8d9c..d41f722fe4 100644 --- a/inc/modules/guest/what-active.php +++ b/inc/modules/guest/what-active.php @@ -10,7 +10,12 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Liste heutiger aktiver Mitglieder * * -------------------------------------------------------------------- * - * * + * $Revision:: $ * + * $Date:: $ * + * $Tag:: 0.2.1-FINAL $ * + * $Author:: $ * + * Needs to be in all Files and every File needs "svn propset * + * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2008 by Roland Haeder * * For more information visit: http://www.mxchange.org * @@ -32,40 +37,36 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; +if (!defined('__SECURITY')) { + $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php'; require($INC); -} - elseif ((!EXT_IS_ACTIVE("active")) && (!IS_ADMIN())) -{ - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "active"); +} elseif ((!EXT_IS_ACTIVE('active')) && (!IS_ADMIN())) { + addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveNotInstalledMessage('active')); return; } // Add description as navigation point -ADD_DESCR("guest", basename(__FILE__)); +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()); +// Extra field to include is by default uid +$add = 'userid'; -// Check for members who were active only this day -$ADD = "uid"; -if (EXT_IS_ACTIVE("nickname")) $ADD = "nickname"; +// If nickname is installed the extra field is the nickname of the user +if (EXT_IS_ACTIVE('nickname')) $add = 'nickname'; -$result = SQL_QUERY_ESC("SELECT userid, ".$ADD.", last_online -FROM "._MYSQL_PREFIX."_user_data -WHERE last_online >= %s AND status='CONFIRMED' +// 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, getConfig('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)) - { - $nick2 = "---"; + $OUT = ''; $SW = 2; + while (list($uid, $nick, $last) = SQL_FETCHROW($result)) { + $nick2 = '---'; if (($nick != $uid) && (!empty($nick))) $nick2 = $nick; // Transfer data to array @@ -73,28 +74,26 @@ if (SQL_NUMROWS($result) > 0) 'sw' => $SW, 'uid' => $uid, 'nick' => $nick2, - 'points' => TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "points") - GET_TOTAL_DATA($uid, "user_data", "used_points")), - 'last' => MAKE_DATETIME($last, "2"), + 'points' => translateComma(GET_TOTAL_DATA($uid, 'user_points', 'points') - GET_TOTAL_DATA($uid, 'user_data', 'used_points')), + 'last' => generateDateTime($last, '2'), ); // Load template - $OUT .= LOAD_TEMPLATE("guest_active_row", true, $content); + $OUT .= LOAD_TEMPLATE('guest_active_row', true, $content); // Switch colors $SW = 3 - $SW; } -} - else -{ +} else { // No member was online today! :-( - $OUT = LOAD_TEMPLATE("guest_active_none_row", true); + $OUT = LOAD_TEMPLATE('guest_active_none_row', true); } // Remember output in constant define('__ACTIVE_ROWS', $OUT); // Load template -LOAD_TEMPLATE("guest_active_table"); +LOAD_TEMPLATE('guest_active_table'); // ?>