]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/action-online.php
A lot double-quotes rewritten to single-quotes, some redirect URLs fixed
[mailer.git] / inc / modules / guest / action-online.php
index e8df9e777748f31878233bc4d8ef0e5e4eda2e5f..55001d10d7a9e5d4d1c67b74cd8dad44c44c23bb 100644 (file)
  * -------------------------------------------------------------------- *
  * 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                  *
  ************************************************************************/
 
 // 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("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_counter'] < $total)
-{
-       // Update counter
-       $_CONFIG['mad_counter'] = $total;
-       $_CONFIG['last_mad']    = time();
-       $result_mad = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET mad_timestamp=%d, mad_count='%s' WHERE config=0 LIMIT 1",
-        array($_CONFIG['last_mad'], $_CONFIG['mad_counter']), __FILE__, __LINE__);
+$total = GET_TOTAL_DATA("", 'online', "id", 'userid', true);
 
-       // Destroy cache
-}
+if (getConfig('mad_count') < $total) {
+       // Update counter
+       UPDATE_CONFIG(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'  => 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);
 
-if (EXT_IS_ACTIVE("active"))
-{
-       // Add link to "we were active today" page
-       LOAD_TEMPLATE("guest_menu_bottom", false, "<A class=\"menu_blur\" href=\"".URL."/modules.php?module=index&amp;what=active\">".$_CONFIG['menu_blur_spacer'].GUEST_ACTIVE_LINK."</A>");
-}
+// Add more links in this block
+runFilterChain('online_extra_links');
 
 //
 ?>