X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Faction-online.php;h=d3844e778e2ec00d2180b8843e6af81534db0984;hb=36c3c8b749a88ce05ad0fda81e00047f9cb5433f;hp=07fbcec63bad705e2be00944b7b8359f4ed0ae81;hpb=690c48be1c6447146d98235a5dba39596ada7c6f;p=mailer.git diff --git a/inc/modules/guest/action-online.php b/inc/modules/guest/action-online.php index 07fbcec63b..d3844e778e 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 * @@ -33,44 +38,34 @@ // 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("online")) { +} elseif ((!EXT_IS_ACTIVE('online')) && (!IS_ADMIN())) { // Just skip this extension 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); -if ($_CONFIG['mad_count'] < $total) { +$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(); -} + updateConfiguration(array('mad_timestamp', 'mad_count'), array(time(), $total)); +} // 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' => translateComma(GET_TOTAL_DATA('N', 'online', 'id', 'is_admin', true, " AND `is_member`='N'")), + 'members' => translateComma(GET_TOTAL_DATA('N', 'online', 'id', 'is_admin', true, " AND `is_member`='Y'")), + 'admins' => translateComma(GET_TOTAL_DATA('Y', 'online', 'id', 'is_admin', true)), + 'total' => translateComma($total) +); // Output table -LOAD_TEMPLATE("online_now"); - -if (EXT_IS_ACTIVE("active")) { - // Init content - $content = array( - 'menu' => "".$_CONFIG['menu_blur_spacer'].GUEST_ACTIVE_LINK."", - 'what' => "active" - ); +LOAD_TEMPLATE('online_now', false, $content); - // Add link to "we were active today" page - LOAD_TEMPLATE("guest_menu_bottom", false, $content); -} // END - if +// Add more links in this block +runFilterChain('online_extra_links'); // ?>