Try this, not tested but should work.
In member2.php replace this:
Code:
if (!$checkid=$DB_site->query_first("SELECT $tableid FROM $table WHERE userid=$bbuserinfo[userid] AND $typeid=".intval($id))) {
$id=verifyid($type,$id);
$DB_site->query("INSERT INTO $table ($tableid,userid,$typeid) VALUES (NULL,$bbuserinfo[userid],".intval($id).")");
}
$url = str_replace("\"", "", $url);
eval("standardredirect(\"".gettemplate("redirect_subsadd")."\",\"\$url\");");
With this:
Code:
if (!$checkid=$DB_site->query_first("SELECT $tableid FROM $table WHERE userid=$bbuserinfo[userid] AND $typeid=".intval($id))) {
$id=verifyid($type,$id);
$DB_site->query("INSERT INTO $table ($tableid,userid,$typeid) VALUES (NULL,$bbuserinfo[userid],".intval($id).")");
}
vbsetcookie("bbuserid","",1);
vbsetcookie("bbpassword","",1);
vbsetcookie("bbstyleid","",1);
if ($bbuserinfo[userid]!=0 and $bbuserinfo[userid]!=-1) {
$DB_site->query("UPDATE user SET lastactivity='".(time()-$cookietimeout)."',lastvisit='".time()."' WHERE userid='$bbuserinfo[userid]'");
}
//$DB_site->query("UPDATE session SET userid=0 WHERE sessionhash='".addslashes($session[sessionhash])."'");
$DB_site->query("DELETE FROM session WHERE sessionhash='".addslashes($session[dbsessionhash])."'");
// make sure any other of this user's sessions are deleted (incase they ended up with more than one)
$DB_site->query("DELETE FROM session WHERE userid='$bbuserinfo[userid]'");
$session['sessionhash']=md5(uniqid(microtime()));
$session['dbsessionhash']=$session['sessionhash'];
$DB_site->query("INSERT INTO session (sessionhash,userid,host,useragent,lastactivity,styleid) VALUES ('".addslashes($session['sessionhash'])."','0','".addslashes($session['host'])."','".addslashes($session['useragent'])."','".time()."','0')");
vbsetcookie("sessionhash",$session['sessionhash'],0);
eval("standarderror(\"".gettemplate("redirect_subsadd")."\");");