From 4fc3f99bbe67520fedd08e015a88b678834fe60e Mon Sep 17 00:00:00 2001 From: Aleksei Miheev Date: Sun, 31 Jan 2016 07:55:58 +0000 Subject: [PATCH] Use mongodb instead of MySQL for user UIDs tracking --- forum/Sources/Load.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/forum/Sources/Load.php b/forum/Sources/Load.php index 33327a7..c184364 100644 --- a/forum/Sources/Load.php +++ b/forum/Sources/Load.php @@ -75,6 +75,7 @@ function loadUserSettings() { global $modSettings, $user_settings; global $ID_MEMBER, $db_prefix, $cookiename, $user_info, $language; + global $mongodb; // Check first the cookie, then the session. if (isset($_COOKIE[$cookiename])) @@ -149,9 +150,11 @@ function loadUserSettings() ); $__uid = str_replace("uid=","",$_SERVER['USERID']); - db_query(" - INSERT IGNORE INTO smf_member_uids VALUES('{$ID_MEMBER}', '{$__uid}')", - __FILE__, __LINE__); + $mongodb->rock->memberUids->update( + array('member' => $ID_MEMBER), + array('$addToSet' => array('uids' => $__uid)), + array('upsert' => true) + ); } // If the user is a guest, initialize all the critial user settings.