vBulletin

Thank you for visiting. This is our website archive. Please visit our main website by clicking the banner above.
vBulletin FAQ is dedicated to helping the forum owner build, manage and profit from his vBulletin Forum
vBulletin Web Hosting - Free skins and styles for your vBulletin - Search Engine Optimization




Integrate my site

scotty2260
01-04-2006, 05:11 PM
Hello all,
I recently switched from PHPBB to vBulletin, and I need some help.

I used a code on every page of my site to integrate the login with my site. This also gave me access with PHP to call any sessionvariables I needed at any time. I need to do this with vBulletin.

It allows me to welcome people to my site by name, show links to registered users only, and unlock content to people based on posts. Below is the code I used for PHPBB, is there soemthing similar out there for vBulletin?

I code PHP, so I can make slight alterations if necessary.

Thank You!
define('IN_PHPBB',true);

$phpbb_root_path = "mgdb/"; // set path to phpBB files
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_LOGIN); // initiate session
init_userprefs($userdata); // load user prefs
//
// End session management
//
$userid = $userdata['user_id'];
$sql = "SELECT * FROM mgdb_users WHERE user_id = '$userid'";
$result = $db->sql_query($sql);
$isauth = 0;
while (@$row = $db->sql_fetchrow($result))
{
extract($row);

if ($isauth != '1')
{
extract($userdata);

mikelbeck
01-04-2006, 05:45 PM
Have a look at this thread, I think it's what you're looking for:

http://www.vbulletin.org/forum/showthread.php?t=98009

scotty2260
01-05-2006, 08:29 AM
Thank you for that link. it helped a LOT!

If anyone is looking for how to do something similar, you only need the couple lines of code below. This will make any page act like a part of VB, as in you will have access to all variables and functions.
<?php
chdir('./forums');
require_once('./global.php');
chdir('./../');
?>

mikelbeck
01-05-2006, 08:33 AM
Thank you for that link. it helped a LOT!

Ah, good. Glad I could help.

scotty2260
02-16-2006, 12:26 AM
ok, I hate to bring up an old thread, but I jsut switched from 3.0.8 (where the above code worked) to 3.5 and now the above code does not work?
I don't get any errors, it just doesnt get the bbuserinfo variable.


vBulletin

seo book

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum