X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-active.php;h=f1602b3c077aeef6b8a2c3a5baaf94ea2322142c;hb=8def2eea23fae29ba4d86b4bf7df9307e62f61b7;hp=7b1b8c8e81c0a49b9ff05d924f6c3fd4ce848098;hpb=77cdaff2afb97ed32985ced906a3a95ee078c2ef;p=mailer.git diff --git a/inc/modules/guest/what-active.php b/inc/modules/guest/what-active.php index 7b1b8c8e81..f1602b3c07 100644 --- a/inc/modules/guest/what-active.php +++ b/inc/modules/guest/what-active.php @@ -10,9 +10,14 @@ * -------------------------------------------------------------------- * * 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 * + * Copyright (c) 2003 - 2009 by Roland Haeder * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -33,62 +38,64 @@ // Some security stuff... if (!defined('__SECURITY')) { - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; - require($INC); -} elseif ((!EXT_IS_ACTIVE("active")) && (!IS_ADMIN())) { - addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "active"); - return; -} + die(); +} // END - if // Add description as navigation point -ADD_DESCR("guest", __FILE__); +addMenuDescription('guest', __FILE__); -// Extra field to include is by default uid -$ADD = "userid"; +if ((!isExtensionActive('active')) && (!isAdmin())) { + loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('active')); + return; +} // END - if + +// Extra field to include is by default userid +$add = 'userid'; // If nickname is installed the extra field is the nickname of the user -if (EXT_IS_ACTIVE("nickname")) $ADD = "nickname"; +if (isExtensionActive('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_TDAY, getConfig('active_limit')), __FILE__, __LINE__); +$result = SQL_QUERY("SELECT + `userid`, `".$add."`, `last_online` +FROM + `{?_MYSQL_PREFIX?}_user_data` +WHERE + `last_online` >= {?START_TDAY?} AND `status`='CONFIRMED' +ORDER BY + `last_online` DESC +LIMIT {?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; - while (list($uid, $nick, $last) = SQL_FETCHROW($result)) { - $nick2 = "---"; - if (($nick != $uid) && (!empty($nick))) $nick2 = $nick; + $OUT = ''; $SW = 2; + while (list($userid, $nick, $last) = SQL_FETCHROW($result)) { + $nick2 = '---'; + if (($nick != $userid) && (!empty($nick))) $nick2 = $nick; // Transfer data to array $content = array( - '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"), + 'sw' => $SW, + 'userid' => $userid, + 'nickname' => $nick2, + 'points' => translateComma(countSumTotalData($userid, 'user_points', 'points') - countSumTotalData($userid, 'user_data', 'used_points')), + 'last_online' => generateDateTime($last, 2), ); // Load template - $OUT .= LOAD_TEMPLATE("guest_active_row", true, $content); + $OUT .= loadTemplate('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 = loadTemplate('guest_active_none_row', true); } -// Remember output in constant -define('__ACTIVE_ROWS', $OUT); - // Load template -LOAD_TEMPLATE("guest_active_table"); +loadTemplate('guest_active_table', false, $OUT); -// +// [EOF] ?>