View Full Version : What variables must I pass from page to page ?
mihai11
07-24-2007, 09:34 AM
Hi,
I developed a custom page and I see that I forgot to pass some parameters like "userid" to the page. I don't really need this one, but it looks like this parameter should not be lost because it is used on other VB pages. What are the parameters that must always be passed from page to page when a user is logged in ?
Regards,
Razvan M.
Dismounted
07-24-2007, 11:10 AM
You only have to call global.php, it will handle all that for you.
mihai11
07-24-2007, 11:15 AM
You only have to call global.php, it will handle all that for you.
Nope. If the user has disabled cookies, you must at least pass the session ID.
Actually, I am asking this because on a custom page the following:
$user_id = $vbulletin->userinfo['userid'];
is not defined while this:
$username = $vbulletin->userinfo['username'];;
is defined. Why is the "userid" not available ?
Dismounted
07-24-2007, 11:21 AM
How is your page coded?
mihai11
07-24-2007, 11:24 AM
How is your page coded?
This is happening inside a function:
function insert_story($thread_id, $story_url, $language_id, $category_id, $description, &$error_description)
{
global $vbulletin;
$username = $vbulletin->userinfo['username'];;
$user_id = $vbulletin->userinfo['userid'];
// first we must check if there is already a story with this thread ID
$sql_thread_id = ("SELECT thread_id FROM story WHERE (thread_id=$thread_id)");
$sql_thread_id_data = $vbulletin->db->query_first( $sql_thread_id );
. . .
The "$username" is OK while the "$user_id" is not.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.