X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fonline_functions.php;h=ec0dffee1fc24f135b9b8c0d9608275d24f1d796;hb=496a9a8159ba42133179e0535afbd5622c3b39d8;hp=fb7dfc7c89fec524e0bd8d56c46cbf2e4470e11b;hpb=1ebf518b9552f71ee95de6f4b80e6de3a27716d1;p=mailer.git diff --git a/inc/libs/online_functions.php b/inc/libs/online_functions.php index fb7dfc7c89..ec0dffee1f 100644 --- a/inc/libs/online_functions.php +++ b/inc/libs/online_functions.php @@ -1,7 +1,7 @@ 0) && (isMember())) { + if (isMember()) { // Is valid user - $userid = getUserId(); - $MEM = 'Y'; + $userid = getMemberId(); + $isMember = 'Y'; } // END - if if (isAdmin()) { // Is administrator - $ADMIN = 'Y'; + $isAdmin = 'Y'; } // END - if - // Get refid - $rid = determineReferalId(); - // Now search for the user $result = SQL_QUERY_ESC("SELECT `timestamp` FROM `{?_MYSQL_PREFIX?}_online` WHERE `sid`='%s' LIMIT 1", array(session_id()), __FUNCTION__, __LINE__); @@ -96,26 +95,26 @@ WHERE LIMIT 1", array( getModule(), - getAction(), + $action, getWhat(), $userid, - $rid, - $MEM, - $ADMIN, + makeDatabaseUserId(determineReferalId()), + $isMember, + $isAdmin, detectRemoteAddr(), session_id() ), __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(), + $action, getWhat(), $userid, - $rid, - $MEM, - $ADMIN, + makeDatabaseUserId(determineReferalId()), + $isMember, + $isAdmin, session_id(), detectRemoteAddr() ), __FUNCTION__, __LINE__); @@ -125,7 +124,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]