PDA

View Full Version : Being Logged in When Outside of Forum Location


greenhybrid
02-21-2005, 01:22 PM
What would the necessary code be that would allow visitors to be "logged in" to vBulletin without actually accessing the forums? For instance, I have my forums located at http://www.greenhybrid.com/discuss but if a member goes straight to http://www.greenhybrid.com/compare , I'd still like them to show up as a "guest" or logged in member in the Who's Online list, etc. They don't have to be prompted to log in, though.

On a side note, is it possible to define additional locations for the Who's Online list instead of having it say "unknown location?" My section at http://www.greenhybrid.com/learn is a vBulletin hack, but the Who's Online list doesn't recognize it and places them at the "unknown location" of the URL of the last image to load (a PHP-generated avatar). I'd like to be able to define this section.

Thanks in advance.

DRJ
02-21-2005, 10:18 PM
you need to include global.php in the php pages you want to track where users are. then take a look at the code in functions_online.php and you need to add the location to case statements. Just copy one of the other cases and modify it.

greenhybrid
02-21-2005, 11:04 PM
Okay, well I'm partially there. I included global.php in certain pages outside of the forum directory, but it doesn't appear to be tracking visitors.

On the flipside, I was able to edit functions_online.php to define the Unknown Location for my article system. Since the mod is just one file, however, I haven't yet figured out how to tell the exact location. I basically just stated that if the visitor is at article.php, they're "Browsing the Learn Section."

Now that I know requiring 'global.php' isn't the only requirement, can anyone else please help?

greenhybrid
03-19-2005, 04:58 PM
It's now a month later. I've made modifications to the functions_online file for other reasons with success, but I still cannot figure this out. Global.php + adding the location is NOT doing enough.

greenhybrid
05-07-2005, 11:53 PM
It's been months and I'm still unable to find a way to do this. Can anyone please help?

Marco van Herwaarden
05-08-2005, 08:38 AM
To make this work you need 2 things:

In the new script you will need:
define('THIS_SCRIPT', 'PUTHEREYOURSCRIPTNAME');
$phrasegroups = array();
$specialtemplates = array();
$globaltemplates = array();
$actiontemplates = array();
require_once('./global.php');

Put your scriptname in the THIS_SCRIPT define.

Then edit functions_online.php, and add a case for your new scriptname.

greenhybrid
05-08-2005, 12:26 PM
Thank you thank you thank you!!!!!! Works perfectly. Exactly what I need. :)

There's also one related thing I'm trying to accomplish, if you don't mind. The system I'm using this for is a a script I coded myself that uses the user table to verify and "log in" members separately from the forums. Since I didn't know the vB code well, I had to make it separate. So, if they log in under this system, it won't be under the forum. This means they will always show up as a visitor in Who's Online.

Do you know how to drop vBulletin's user cookie and how to read it? If I can do this, I will be able to better integrate the system. Thanks.

Hmm interesting. When I put your code in a test page with nothing else, it works. But, when I put it at the top of my script, it doesn't work. Any idea why?

Marco van Herwaarden
05-08-2005, 01:25 PM
Your script is stored in a different directory then the test script?

greenhybrid
05-08-2005, 10:22 PM
No. But, both are outside the forums directory. That shouldn't make a difference, though.

The script does connect to a different database, though. Could this be related?

greenhybrid
05-15-2005, 12:57 AM
I hate to keep digging this up from the grave, but can anyone please help?

Umpakati
05-16-2005, 08:01 PM
The script does connect to a different database, though. Could this be related?

Actually, yes... I had a similar problem. I'm not too good with this stuff, so I just combined everything into a single database, and now I have no problems.

greenhybrid
05-16-2005, 10:18 PM
lol. I really don't think I can do that. Putting a million scripts in one database is asking for trouble.

Did you do testing to make sure that the multiple connections are causing the problem?