]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/online_functions.php
Failed SQL queries are now also reported in bug mails, SQL queries improved (more...
[mailer.git] / inc / libs / online_functions.php
index fb7dfc7c89fec524e0bd8d56c46cbf2e4470e11b..91c84f1158bb5984491dad8c3f0accc290acd9b6 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 12/18/2008 *
- * ================                             Last change: 12/18/2008 *
+ * Mailer v0.2.1-FINAL                                Start: 12/18/2008 *
+ * ===================                          Last change: 12/18/2008 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : online_functions.php                             *
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -53,14 +54,14 @@ function FILTER_UPDATE_ONLINE_LIST () {
        } // END - if
 
        // Initialize variables
-       $userid = 0;
+       $userid = '0';
        $MEM = 'N';
        $ADMIN = 'N';
 
        // Valid userid?
-       if ((isUserIdSet()) && (getUserId() > 0) && (isMember())) {
+       if ((isMemberIdSet()) && (getMemberId() > 0) && (isMember())) {
                // Is valid user
-               $userid = getUserId();
+               $userid = getMemberId();
                $MEM = 'Y';
        } // END - if
 
@@ -86,7 +87,7 @@ SET
        `action`='%s',
        `what`='%s',
        `userid`=%s,
-       `refid`=%s,
+       `refid`='%s',
        `is_member`='%s',
        `is_admin`='%s',
        `timestamp`=UNIX_TIMESTAMP(),
@@ -107,7 +108,7 @@ LIMIT 1",
                ), __FUNCTION__, __LINE__);
        } else {
                // No entry does exists so we simply add it!
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_online` (`module`, `action`, `what`, `userid`, `refid`, `is_member`, `is_admin`, `timestamp`, `sid`, `ip`) VALUES ('%s','%s','%s', %s, %s, '%s','%s', UNIX_TIMESTAMP(), '%s','%s')",
+               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_online` (`module`, `action`, `what`, `userid`, `refid`, `is_member`, `is_admin`, `timestamp`, `sid`, `ip`) VALUES ('%s','%s','%s', %s, '%s', '%s','%s', UNIX_TIMESTAMP(), '%s','%s')",
                        array(
                                getModule(),
                                getAction(),
@@ -125,7 +126,7 @@ LIMIT 1",
        SQL_FREERESULT($result);
 
        // Purge old entries
-       SQL_QUERY("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_online` WHERE `timestamp` <= (UNIX_TIMESTAMP() - {?online_timeout?})", __FUNCTION__, __LINE__);
+       SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_online` WHERE `timestamp` <= (UNIX_TIMESTAMP() - {?online_timeout?})', __FUNCTION__, __LINE__);
 }
 
 // [EOF]