View Full Version : Help with a simple "Logged in User" hack
YellowKard
03-28-2001, 07:28 AM
I was wondering if someone could throw together a simple hack which would show the users name on a non-vb page if they logged in onto your forums, so you could great them on say your sites homepage if they logged in onto your forums ealier.
Just try this:
require("path/to/vb/global.php");
echo "Welcome back " . $bbuserinfo[username];
Yeah, that doesn't work, it gives an error message that says "Warning: Failed opening '/home/sites/site38/forums/global.php' for inclusion (include_path='') in /home/sites/site38/web/beta/index.php on line 4
Warning: Cannot add header information - headers already sent by (output started at /home/sites/site38/web/beta/index.php:4) in /home/sites/site38/web/beta/config/header.php on line 12", I made one before for 1.x.x where I just made a new file and deleted code until it started working then I just started deleteing code till it stopped working so there wouldn't be uneeded code called, but as you can tell thats very sloppy and theres got to be simple way to just get that info outta the database.
The reason why the above does not work is because the code that was posted requires that a visitor already have a "cooke" from your forums. If they do not then they get the error you described.
No, I don't have a fix, the cookie problem has been a problem with a lot of the hacks posted here. Sorry....
Well I did it before so I know its possible, it's just kinda sloppy with a lot of un-needed code and it was for version 1.1.3
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.