]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-active.php
Casting added, fix for bigintval() verifcation
[mailer.git] / inc / modules / guest / what-active.php
index bf342cfea86888313db1b12d43ff4e6af3582ac8..945f6ef8a17af88517c7fda756eb44535c23dfd4 100644 (file)
  * $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 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -43,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Add description as navigation point
-addMenuDescription('guest', __FILE__);
+addYouAreHereLink('guest', __FILE__);
 
 if ((!isExtensionActive('active')) && (!isAdmin())) {
-       loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('active'));
+       displayMessage(generateExtensionInactiveNotInstalledMessage('active'));
        return;
 } // END - if
 
@@ -62,34 +60,31 @@ $result = SQL_QUERY("SELECT
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
-       `last_online` >= {?START_TDAY?} AND `status`='CONFIRMED'
+       `last_online` >= {?START_TDAY?} AND
+       `status`='CONFIRMED'
 ORDER BY
        `last_online` DESC
 LIMIT {?active_limit?}", __FILE__, __LINE__);
 
 // Entries found?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // At least one member was online so let's load them all
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while (list($userid, $nick, $last) = SQL_FETCHROW($result)) {
                $nick2 = '---';
                if (($nick != $userid) && (!empty($nick))) $nick2 = $nick;
 
                // Transfer data to array
                $content = array(
-                       'sw'          => $SW,
                        'userid'      => $userid,
                        'nickname'    => $nick2,
-                       'points'      => (countSumTotalData($userid, 'user_points', 'points') - countSumTotalData($userid, 'user_data', 'used_points')),
+                       'points'      => getTotalPoints($userid),
                        'last_online' => generateDateTime($last, 2),
                );
 
                // Load template
                $OUT .= loadTemplate('guest_active_row', true, $content);
-
-               // Switch colors
-               $SW = 3 - $SW;
-       }
+       } // END - while
 } else {
        // No member was online today! :-(
        $OUT = loadTemplate('guest_active_none_row', true);