View Full Version : Who's Online Assistance
Sylvus
08-27-2003, 09:20 PM
I integrated the Who's Online to generate the listing across the entire site and not just the forums using the require global.php line.
My question is, where do I start to make the changes so those viewing pages outside of the forum are not Unknown Location but shows the location?
In online.php I find:
case 'online':
$userinfo[where] = "Viewing <a href='online.php?s=$session[sessionhash]'>Who's Online</a>";
break;
Lines for each area of the forum. Where do I define a case if a member is viewing a page outside of the forum?
Thanks,
Syl...
Gary King
08-27-2003, 11:36 PM
Actually, it only shows Unknown Location for administrators, but regular members just see <forum_name> Index
Find case 'gallery.php':
$userinfo[activity] = 'gallery';
break;
in online.php, and you'll see that that's where you specify the filenames.
You have to add a new filename there, and also at the location you posted.
Sylvus
08-28-2003, 01:36 AM
Ok. The "case" confused me because I thought this was a variable of some sort, already pre-defined elsewhere and I couldn't understand how it was working.
I've spent so long reading other threads about getting the Who's Online to work across the entire site, tried FireFly's Who's Online Admin hack...nothing was working.
Got a fix for subdirectories?
yoursite.com/sub_dir/filename.shtml does not work via the online.php.
Files within the forum and root of the site work fine, anything in another directory do not.
Now I'm really stumped.
I am calling in the global.php as I am able to see that I'm listed in the Who's Online except whenever I am on a page that is within a sub-directory from the root of the site, it lists me as being at the Main Index.
I've tried
[code]case = '/directory/filename'[code] and nothing.
Syl...
Logician
08-28-2003, 08:46 AM
You first assign the variable value according to visited pages file name. See the lines around 580. Eg.
case 'memberlist.php':
$userinfo[activity] = 'memberlist';
break;
Then in the section you mentioned, you check the variable value and display the who is online text like:
case 'memberlist':
$userinfo[where] = "Viewing <a href='memberlist.php?s=$session[sessionhash]'>Memberlist</a>";
break;
This will work ok unless you have a file name clashing with a vbulletin file name. It is not very usual to have one except you are using "index.php" in your external directory. If this is the case rename it to "main.php" or something to avoid the clash.
Sylvus
08-28-2003, 11:25 AM
Alright, now it works! I had the second part that both you and Gary W. mentioned but I didn't have the first part in your post Logican.
Thanks for the help, working as it should and with sub-directories.
Syl...
Gary King
08-28-2003, 01:13 PM
Hey, I already had that part in my post as well :p
afterglow
08-30-2003, 04:13 AM
hi there! wonder if ur successful in putting the scripts to work in your page. if so, can u share? :)
regards,
afterglow
Sylvus
08-30-2003, 10:48 PM
Well all I did was use the Who's Online on Non-VB Pages hack that is found in the database. I don't have the link handy but you can do a search for it. Search for ONLINE and it's on the 1st or 2nd page.
Since the ./global.php function is already required for the Who's Online to display on all your non-vb pages, all you'll need to do is include it into those non-vb pages.
Syl...
afterglow
08-30-2003, 11:31 PM
Thanks. I'll do the search. Anyway, I can't find hacks that's made to work under vb 3.0 beta5 . most of the hacks available are made to work under 2.3 and below. :(
I just purchased ver 3 and found out there's not much hack available for this version.
Amori
Sylvus
08-31-2003, 03:01 AM
I'm sure there will be but the question still remains. Will the authors of the more popular hacks for 2.3.0 and below rewrite their code for VB 3? If not, I don't know how many people will want to switch over and possibly miss out on some of the better hacks currently available.
Only time will tell.
Syl...
Gary King
08-31-2003, 12:29 PM
Well we can't post our vB 3 hacks until vB.org allows it, which won't be til the RC of vB 3.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.