X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-active.php;h=9fedf82f0e88305d0df42f35019fb7cac52852eb;hp=ec3a4601a6116130690439d8904576f27606a1d2;hb=ccc4a69ce9b17aa8d7b1554a3b2b017db091821b;hpb=fb7120ffa230b62b54895bcf95952e1cf30f8594 diff --git a/inc/modules/guest/what-active.php b/inc/modules/guest/what-active.php index ec3a4601a6..9fedf82f0e 100644 --- a/inc/modules/guest/what-active.php +++ b/inc/modules/guest/what-active.php @@ -38,35 +38,35 @@ // Some security stuff... if (!defined('__SECURITY')) { - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; + $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php'; require($INC); -} elseif ((!EXT_IS_ACTIVE("active")) && (!IS_ADMIN())) { - addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "active"); +} elseif ((!EXT_IS_ACTIVE('active')) && (!IS_ADMIN())) { + addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveMessage('active')); return; } // Add description as navigation point -ADD_DESCR("guest", __FILE__); +ADD_DESCR('guest', __FILE__); // Extra field to include is by default uid -$ADD = "userid"; +$add = 'userid'; // If nickname is installed the extra field is the nickname of the user -if (EXT_IS_ACTIVE("nickname")) $ADD = "nickname"; +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 +$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_TDAY, getConfig('active_limit')), __FILE__, __LINE__); +array(START_TDAY, getConfig('active_limit')), __FILE__, __LINE__); // Entries found? if (SQL_NUMROWS($result) > 0) { // At least one member was online so let's load them all - $OUT = ""; $SW = 2; + $OUT = ''; $SW = 2; while (list($uid, $nick, $last) = SQL_FETCHROW($result)) { - $nick2 = "---"; + $nick2 = '---'; if (($nick != $uid) && (!empty($nick))) $nick2 = $nick; // Transfer data to array @@ -74,26 +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 { // 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'); // ?>