X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Faction-online.php;h=b398f9f035cb3fda7814c3318a18aae5d6956eb3;hb=1c4f807554d765e3d6767634f997c960477f3c1d;hp=a1c0135b6e19b228a6d4ce61551fc5398c80eea9;hpb=747c49b9f46a3d7d1d881c9e1c273ecf107f8d8b;p=mailer.git diff --git a/inc/modules/guest/action-online.php b/inc/modules/guest/action-online.php index a1c0135b6e..b398f9f035 100644 --- a/inc/modules/guest/action-online.php +++ b/inc/modules/guest/action-online.php @@ -10,7 +10,12 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Wer ist wo? (KEINE Untermenues anhaengen!) * * -------------------------------------------------------------------- * - * * + * $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 * @@ -38,34 +43,29 @@ if (!defined('__SECURITY')) { } elseif ((!EXT_IS_ACTIVE("online")) && (!IS_ADMIN())) { // Just skip this extension return; -} elseif (defined('GUESTS_ONLINE_CNT')) { - // Skip it if already executed - return; } -$result_guests = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_online` WHERE is_admin='N' AND is_member='N'", __FILE__, __LINE__); -$result_members = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_online` WHERE is_admin='N' AND is_member='Y'", __FILE__, __LINE__); -$result_admins = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_online` WHERE is_admin='Y'", __FILE__, __LINE__); - // Total visitors online -$total = SQL_NUMROWS($result_guests) + SQL_NUMROWS($result_members) + SQL_NUMROWS($result_admins); +$total = GET_TOTAL_DATA("", "online", "id", "userid", true); + if (getConfig('mad_count') < $total) { // Update counter UPDATE_CONFIG(array("mad_timestamp", "mad_count"), array(time(), $total)); - $_CONFIG['mad_count'] = $total; - $_CONFIG['last_mad'] = time(); } // END - if -// Put all values in constants for the template -define('GUESTS_ONLINE_CNT' , SQL_NUMROWS($result_guests)); -define('MEMBERS_ONLINE_CNT', SQL_NUMROWS($result_members)); -define('ADMINS_ONLINE_CNT' , SQL_NUMROWS($result_admins)); +// Prepare content +$content = array( + 'guests' => TRANSLATE_COMMA(GET_TOTAL_DATA("N", "online", "id", "is_admin", true, " AND is_member='N'")), + 'members' => TRANSLATE_COMMA(GET_TOTAL_DATA("N", "online", "id", "is_admin", true, " AND is_member='Y'")), + 'admins' => TRANSLATE_COMMA(GET_TOTAL_DATA("Y", "online", "id", "is_admin", true)), + 'total' => TRANSLATE_COMMA($total) +); // Output table -LOAD_TEMPLATE("online_now"); +LOAD_TEMPLATE("online_now", false, $content); // Add more links in this block -RUN_FILTER('online_extra_links'); +runFilterChain('online_extra_links'); // ?>