The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#9
|
|||
|
|||
![]()
Thank you very much for your quick and thorough reply!
I have some more questions. How do you determine if a link needs the sessionurl? I think the bridge to coppermine does not initiate the vb engine. The aim of the bridge file was to connect to vb without "touching" the forum, meaning change any setting, change anything in the vb database tables or files. The original bridge file used the vb session cookie to recognize logged in users. This did not work 100%, because when the browser was closed and the user visited the gallery without entering the forum first, the user was classified as guest. The original cookie code looked like this: Code:
// definition of how to extract id, name, group from a session cookie function session_extraction() { if (isset($_COOKIE[$this->cookie_name . 'sessionhash'])) { $session_id = addslashes($_COOKIE[$this->cookie_name . 'sessionhash']); $sql = "SELECT u.{$this->field['user_id']}, u.{$this->field['password']}, u.{$this->field['grouptbl_group_id']}+100 AS usergroupid FROM {$this->usertable} AS u, {$this->sessionstable} AS s WHERE s.{$this->field['user_id']}=u.{$this->field['user_id']} AND s.sessionhash='$session_id'"; $result = cpg_db_query($sql, $this->link_id); if (mysql_num_rows($result)){ $row = mysql_fetch_array($result); return $row; } else { return false; } } } // definition of how to extract an id and password hash from a cookie function cookie_extraction() { return false; } Now the direct session extraction from the vb db looks like this: Code:
function cookie_extraction() { if (isset($_COOKIE[$this->cookie_name . 'userid'])) { $userFromCookie_id = addslashes($_COOKIE[$this->cookie_name . 'userid']); $sql = "SELECT u.{$this->field['user_id']}, u.{$this->field['password']}, u.{$this->field['grouptbl_group_id']}+100 AS usergroupid FROM {$this->usertable} AS u WHERE u.userid='$userFromCookie_id'"; $result = cpg_db_query($sql, $this->link_id); if (mysql_num_rows($result)){ $row = mysql_fetch_array($result); return $row; } else { return false; } } } But I like to enhance the bridge. If users only enter the gallery a session should be stored, too, so that they won' t face the problem of being logged out in the middle of viewing the gallery and also to be able to display people in the gallery in who is online. I think to achieve that you have to initiate the vb engine (eg by calling global.php) and linking with sessionurl should be mandatory again. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|