View Full Version : Add Your Homepage to Your "Who's Online" Locations
Brian
02-08-2004, 02:04 PM
This simple mod will allow you to add your homepage to the "Who's Online" locations on your forum.
First, open your includes/functions_online.php file and look for:
case 'index':
$userinfo['action'] = $vbphrase['viewing_index'];
$userinfo['where'] = "<a href=\"$vboptions[forumhome].php?$session[sessionurl]\">$vboptions[bbtitle]</a>";
break;
Right below that Add:
case 'home':
$userinfo['action'] = 'Viewing Homepage';
$userinfo['where'] = "<a href=\"$vboptions[homeurl]?$session[sessionurl]\">$vboptions[hometitle]</a>";
break;
Next, look for:
case 'cron.php': // this shouldn't occur but just to be sane
Replace that with:
case 'cron.php': // this shouldn't occur but just to be sane
$userinfo['activity'] = 'home';
break;
Upload your includes/functions_online.php file and you're done. :)
Zachery
02-08-2004, 03:48 PM
Mmm helpfull for me :D now i can modify vBXirc to do the same :D
Acido
02-10-2004, 12:33 AM
Mmm helpfull for me :D now i can modify vBXirc to do the same :D
Exactly !
Big thanx Brian !!! :cool: :cool:
Nice addon, it works a treat :)
hmm...i replace adv_index.php with index.php and the forum index is now index2.php. When a user is in FORUM INDEX (index2.php) i get this :
Unknown Location
/ro-hattrick/vb/index2.php
Do you know ho can i modify this to write Forum Index ?
P.S. Sorry for posting here...but i don't want to create another thread.
bigjay
02-19-2004, 07:45 PM
works thanks!
Morrus
03-04-2004, 01:11 PM
I'm having some difficulty getting this to work. It's not breaking anything, so no major worries, but users are still showing up as "Unknown Location".
Does it make a difference that my vBa homepage is called "news.php"?
For those who changed this to cover over pages, too (I have a links hack and vBXIRC installed), would you be so kind as to show me how you did it? I don't understand the phrasing system well enough to be able to tweak it. Thanks!
BNR34Freak
03-10-2004, 04:36 AM
I never got it to work it just shows "unknown location" in bold. I do have my vBA page named as home.php which may be a problem but I'm not 100% sure it could be.
Morrus
03-10-2004, 04:49 AM
Yeah, I'm still having that problem. It's not a major issue, though - I know what the displayed URL means.
Acido
03-21-2004, 10:29 PM
Is Not working for me :(
I have adv_index as forum home page, and users there show the correct location in Who's Online.
But user listing all the forums (index.php) are still showed as "Unknown Location" :mad:
can you give a hand ?
Preds
03-26-2004, 01:25 PM
Works great. Installed w/o difficulty on my vB 3.0.0 board.
Thanks! :D
FleaBag
03-28-2004, 03:11 PM
Thanks for this. :)
jluerken
03-28-2004, 03:32 PM
Hi Brian,
I set this
case 'home':
$userinfo['action'] = 'Viewing Homepage';
$userinfo['where'] = "<a href=\"$vboptions[homeurl]?$session[sessionurl]\">$vboptions[hometitle]</a>";
break;
to this
case 'home':
$userinfo['action'] = 'Viewing Portal';
$userinfo['where'] = "<a href=\"$vboptions[homeurl]?adv_index.php\">Portal</a>";
break;
But its not showing up?
Can you give me a hint please?
buro9
04-01-2004, 06:16 PM
Next, look for:
case 'cron.php': // this shouldn't occur but just to be sane
Replace that with:
case 'cron.php': // this shouldn't occur but just to be sane
$userinfo['activity'] = 'home';
break;
Upload your includes/functions_online.php file and you're done. :)
I found this end solution to that block of code worked better:
case '/':
case '':
case 'cron.php': // this shouldn't occur but just to be sane
case "$vboptions[forumhome].php":
// HACK : START : VBADVANCED
// $userinfo['activity'] = 'index';
if (strpos($userinfo['location'], "forum") === false) {
$userinfo['activity'] = 'home';
} else {
$userinfo['activity'] = 'index';
}
// HACK : END : VBADVANCED
break;
Essentially, I have these URL's:
http://www.bowlie.com/ - vBadvanced
http://www.bowlie.com/forum/ - vBulletin
The word "forum" that I search for is the directory name for the forum, by checking whether it exists in the users location (as per session db table) I can differentiate between the vbadvanced homepage and the forum index.
Note that this would also solve my other problem of how to recognise other pages such as the hosting page:
http://www.bowlie.com/hosting/
As I could just put a new switch within the 'false' block in the 'if' statement to check for the existence of other folder names.
Might be useful to someone :)
cLord
04-02-2004, 12:40 AM
ThanX!
Works 100%
cLord ;)
cLord
04-02-2004, 08:24 AM
Well...
It worked for a couple of minutes and then all of a sudden it stopped and I have the same problem as the other people in this thread! :(
Please help,
cLord
jluerken
04-07-2004, 08:36 AM
I always get this, no matter what I do:
Unknown Location
/forum/adv_index.php?
At the moment I am using this code:
case 'adv_index':
$userinfo['action'] = 'Viewing Portal';
$userinfo['where'] = "<a href=\"$vboptions[homeurl]?adv_index.php\">CFN Portal Page</a>";
break;
Can someone please tell me how I can get rid of this and exchange this that 'Portal Page' is displayed?
iguanairs
05-04-2004, 12:22 PM
Hello,
I believe I located what everyones problem is,however,I could be mistaken. Initially when I first installed this,I too had temporary and occasional success with it reading everything correctly,but I was also receiving the "unknown" as well. Today,I reinstalled this. This time however,I did something different. I open my "includes/functions_online.PHP file with word pad,and made the necessary changes using cut and paste. (I am lazy!) I DID NOT UPLOAD IT YET!
I then REOPENED it and looked for the code again. Well the cut and paste did not line up with the existing code and added a space under the line as well. I manually aligned everything so it matched the existing code,and removed the space after the "cron" change. I then installed it. I haven't received the unknown location error since.
This may be the same problem everyone else is having. Take a look! If i knew how to write the PHP in those blocks like all the advanced PHP writers do,I would have added some examples. Hope this description helps everyone!
ogetbilo
05-05-2004, 06:25 AM
Hi buro9,
To display other folders (like the ''hosting" one you did) on the who is online page, I modified this code
case '/':
case '':
case 'cron.php': // this shouldn't occur but just to be sane
case "$vboptions[forumhome].php":
// HACK : START : VBADVANCED
// $userinfo['activity'] = 'index';
if (strpos($userinfo['location'], "forum") === false) {
$userinfo['activity'] = 'home';
} else {
$userinfo['activity'] = 'index';
}
// HACK : END : VBADVANCED
break;
to
case '/':
case '':
case 'cron.php': // this shouldn't occur but just to be sane
case "$vboptions[forumhome].php":
// HACK : START : VBADVANCED
// $userinfo['activity'] = 'index';
if (strpos($userinfo['location'], "forum") === false) {
if (strpos($userinfo['location'], "ABCD"))
{
$userinfo['activity'] = 'ABCD';
}
else
{
$userinfo['activity'] = 'home';
}
} else {
$userinfo['activity'] = 'index';
}
// HACK : END : VBADVANCED
break;
I also added a
case 'ABCD':
$userinfo['action'] = $vbphrase['ABCD'];
under the $userinfo['activity'] switch (and added the necessary phrase of course). But I still couldn't get it work. It still shows me the 'home' page when somebody is in the ABCD.
Where am I wrong?
hkeleher
05-24-2004, 02:41 AM
I'm getting the following as well:
Unknown Location
/forum/forum_index.php?
I've tried tweaking it but I don't know php at all. Kinda lost on this one, heheh.
mholtum
05-24-2004, 11:21 AM
works for me, thanks!
vonedaddy
05-25-2004, 10:50 PM
Worked GREAT for me thanks!
Merjawy
06-11-2004, 05:10 AM
I was about to ask, thnx to search.. this worked fine for me :)
thanks Brian
Merjawy
06-12-2004, 07:10 PM
now I have a little problem I haven't really looked into it..
on forum, using /index.php or not
now if a user is on w$w.domian.com/forum/index.php it shows him/her on the forum
but if he/she on w$w.domain.com/forum it will show him/her on homepage instead
the homepage part w$w.domain.com or w$w.domain.com/index.php showing fine
PS.ignore the w$w part
himerus
06-17-2004, 02:07 PM
I've tried the same, and haven't got it to work...
case 'home':
$userinfo['action'] = "Viewing Homepage";
$userinfo['where'] = "<a href=\"home.php?$session[sessionurl]\">$vboptions[hometitle]</a>";
break;
case 'article':
$userinfo['action'] = "Viewing Articles Database";
$userinfo['where'] = "<a href=\"article.php?$session[sessionurl]\">Articles</a>";
break;
I'm trying to add both the homepage, and articles page, but both show up as Unknown Location.... ?????
Ashley
06-30-2004, 12:44 PM
I can't get it to work for me...
This is my home page url, do I need to change something to make that code work?
http://www.simply-baby.net/forum/vbaindex.php?page=welcome
BubbleHead
09-04-2004, 10:28 PM
I got it to work for me right off the bat, but if I click the link it takes me back to my homepage and adds a "?"... i.e. http://www.hotrodbiker.com/?
Any idea as to how to lose the question mark?
iguanairs
09-09-2004, 05:11 PM
I just got it to work with my new upload by making a simple change to one line.
case 'home':
$userinfo['action'] = 'Viewing Homepage';
$userinfo['where'] = "<a href=\index.php?$session[sessionurl]\">$vboptions[hometitle]</a>";
break;
cartman
10-01-2004, 12:14 PM
worked a treat - nice mod
Frankenberrie
10-01-2004, 04:44 PM
I tired all suggestions and still get this:
Unknown Location
/comcentral/index.php
MorrisMcD
10-08-2004, 02:30 AM
-Bump-
Me too :(
indie
10-21-2004, 02:32 AM
So what is the correct code?
thanks
indie
10-21-2004, 03:26 AM
OK i tried this code.
It works but i think something need to be changed for me.
I called my default index page "forum.php", and I named my portal "index.php" ...and now, when members are viewing the porta, it says they are viewing the "Index", when it should say "Homepage".
It only says they are viewing the homepage if the index.php is not in the url. only the domain name.
What can i change??
Thanks
indie
10-21-2004, 03:33 AM
Brian's code works...
try this!!!!!!!!!
The problem that's causing it is your links, not the code in this hack...
the links you created to your homepage portal, ie: yourdomain.com/index.php or whatever
CHANGE to the <a href="$vboptions[homeurl]"> code in your header etc...
worked for me!
MorrisMcD
10-23-2004, 12:17 AM
Brian's code works...
try this!!!!!!!!!
The problem that's causing it is your links, not the code in this hack...
the links you created to your homepage portal, ie: yourdomain.com/index.php or whatever
CHANGE to the <a href="$vboptions[homeurl]"> code in your header etc...
worked for me!
I know I am a dumbass for asking this, but can you explain what you just said.. I think you are saying change it in the admincp where forum home is designated maybe? But I am not sure.. Can you explain what you mean???
Thanks
indie
10-28-2004, 06:32 AM
No, just change it in the header where you link to the homepage..... in your logo, and in the text link. Then, you are set.
onetwothree
11-20-2004, 09:24 AM
Let say my forum is at www.mysite.com/forum and I added a new page www.mysite.com/forum/subdir/newpage.php. When a user is on newpage.php, the Who's Online would always shows that he is "Viewing Index". How would I make it so that Who's Online would show that he is "Viewing New Page"?
I tried the above mods but it only works if newpage.php is in the forum directory, not a subdirectory.
Any help is greately appreciated and thanks in advance!
MorrisMcD
11-21-2004, 10:45 AM
The wierdest thing happened.. Mine wasnt working after trying all the above.. So I gave up... Yesterday I noticed it IS working now? I may have restarted my server sometime since then.. Maybe restarting a service will get it to work????
JohnBee
12-17-2004, 08:16 AM
I have created a newspage as well using vBA.
so:
http://www.mysite/www/index.php?page=newspage
is my path how could I add this to my who's online also?
I would like people to see when users are viewing other
vBA generated pages if that is possible.
Thanks in advance
dsboyce8624
05-19-2005, 06:50 PM
This simple mod will allow you to add your homepage to the "Who's Online" locations on your forum.
First, open your includes/functions_online.php file and look for:
case 'index':
$userinfo['action'] = $vbphrase['viewing_index'];
$userinfo['where'] = "<a href=\"$vboptions[forumhome].php?$session[sessionurl]\">$vboptions[bbtitle]</a>";
break;
Right below that Add:
case 'home':
$userinfo['action'] = 'Viewing Homepage';
$userinfo['where'] = "<a href=\"$vboptions[homeurl]?$session[sessionurl]\">$vboptions[hometitle]</a>";
break;
Next, look for:
case 'cron.php': // this shouldn't occur but just to be sane
Replace that with:
case 'cron.php': // this shouldn't occur but just to be sane
$userinfo['activity'] = 'home';
break;
Upload your includes/functions_online.php file and you're done. :)
Okay, can sombody help me use this with different file names. I'm happy to edit whatever else I need to, just show me how.
All of my files are in the root. Forum home is /index.php and vBa home is cmps_index.php
Thanks,
Dennis
dsboyce8624
05-21-2005, 06:25 PM
Anybody out there?
JohnBee
06-28-2005, 09:41 PM
anyone?
l33ch
07-14-2005, 06:49 PM
Thank you so much!! :)
Gary Bolton
07-25-2005, 01:18 AM
I cannot seem to get this to work. I have vBindex 3.0.0 RC5 installed. I have the vbindex.php file in my forums folder and not in the root folder one level above my forums folder. I'm also using vBulletin 3.0.7.
Can you please try and advice me how I can get this working because I really want to fix this problem. Thanks!
~Xcalibur~
07-25-2005, 01:39 AM
Worked like a charm.Thanks :)
Brian
07-25-2005, 12:25 PM
I cannot seem to get this to work. I have vBindex 3.0.0 RC5 installed. I have the vbindex.php file in my forums folder and not in the root folder one level above my forums folder. I'm also using vBulletin 3.0.7.
Can you please try and advice me how I can get this working because I really want to fix this problem. Thanks!
This is the support forum for vBadvanced products, not vBindex.
Gary Bolton
07-25-2005, 06:08 PM
OK sorry, I'll post the problem in the vBindex 3.0.0 RC5 thread to see if I can get help there.
bouncingpeanut
11-06-2005, 11:29 PM
Can't find this code in my functions_include, assume that its changed (now using VB3.51 and Cmps 2 - searched the cmps mods and hacks, but no joy. Any chance of someone re-writing this for 351 and 2
Mikecp421
01-29-2006, 07:36 PM
this mod works great on my new 3.5.3 board thanks
Milad
01-29-2006, 09:17 PM
Why don't you make this as plugin?
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.