View Full Version : Guest/Member location on non-vb pages for who's online?
Kathy
06-17-2002, 07:40 PM
I know there is a hack for who's online to be displayed on non-vb page. But I think what I'm looking for is different.
I use php for the extension of all the pages of my website, non-vb, so that I use header.inc and footer.inc for those pages...to easily update the header and footers when needed.
Is there any way to add a snip of code to keep track of guests/members on those non-vb pages using their vb session hash?
I was just thinking if there was a simple way to add a bit of code to the header...it would then show those guests/members locations on "who's online" ?
Is this already done and I don't know what to call this?
Thanks for any help you can provide. :D
Chris M
06-17-2002, 07:55 PM
Im note sure what you exactly mean...
Do you use templates to power your pages? If you do, then they must be in the Forum directory, am I correct?
If that is the case, do the following :
Edit online.php
===========
FIND:
case 'gallery':
$userinfo[where] = "Viewing Picture <a href='gallery.php?s=$session[sessionhash]'>Gallery</a>";
break;
AFTER IT ADD:
case 'name of file':
$userinfo[where] = "Viewing <a href='name of file.php?s=$session[sessionhash]'>Name of the File</a>";
break;
THEN FIND:
case 'gallery.php':
$userinfo[activity] = 'gallery';
break;
AFTER IT ADD:
case 'name of file.php':
$userinfo[activity] = 'name of file';
break;
(Make sure you change all instances of "name of file.php" and "name of file" to the file name you chose)
Satan
Kathy
06-17-2002, 08:56 PM
Well, no....they aren't in the forum directory.
I have about 200 static pages of my website in addition to the vb forums. In order to ease the changes that I make to header and footer of my site, I made all the pages of my site to be like: index.php or fun.php (outside the forum directory) and I user header.inc and footer.inc.
I had just thought...in my php challenged brain of mine :D that I could add some php code to my headers to show members/guests on 'who's online' while viewing my static pages of the site.
So, this isn't possible? :/
Kathy
06-17-2002, 10:00 PM
OKay, what about this?
COuld I put my header.inc inside the forum directory (changing the path for the header.inc of course where needed)?
My header use the same links with session hash as my vbulletin....to make the site the same throughout all the pages, vb or static....
And once the header.inc is within the forum directory, could that then be a "file" so that I can keep track of guests/members on those pages generically like:
"Viewing website static page" (or something like that?)
Logician
06-19-2002, 08:19 AM
nope..
even if you put all your php files under your board directory this wont work..
Vb who's online system does not work by checking the files under certain directory, it has a completely different scheme.
To make it work your only chance would be to insert :
require("./global.php");
$action="your action here";
into all your php files then do what Hellsatan suggested and define all your new actions inside online.php.
Downsides:
* Adding this line to your existing files make them a part of vb system and by default add at least 10 SQL queries for every file called.
* since they become the part of vbsystem, the codes inside them may clash with vb codes after your adding this line. This wont effect vb, but some of your alien php files may stop working or give errors and you may need to remodify them.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.