View Full Version : How do I add the "Home" and "Forum" link on nav bar?
HuangA
07-16-2004, 08:17 PM
Hi;
I noticed on vBadvanced.com and vBadvanced.com/forums, the nav bar seem to recognize which page you are at and presents a different list of navigation options. How would I come about doing that?
Regards,
Andy Huang
mholtum
07-17-2004, 01:29 AM
In the navbar template find:
<!--<td class="vbmenu_control"><a href="$vboptions[forumhome].php?$session[sessionurl]">Home</a></td>-->
and replace with:
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]?$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]?$session[sessionurl]"> Home </if></a></td>
HuangA
07-17-2004, 01:43 AM
That worked great! Thanks :)
mholtum
07-17-2004, 02:09 AM
Glad to help.. :D Give us a link to your site
StevePJC
07-26-2004, 10:14 PM
If the folder that the forums are in is named /forums how would I get that to point to the right forum. Changing the name I've found screws up the front page.
DarknessDivine
07-26-2004, 10:47 PM
If the folder that the forums are in is named /forums how would I get that to point to the right forum. Changing the name I've found screws up the front page.
huh?
StevePJC
07-26-2004, 10:49 PM
Oh forget it. I'll find a way to fix it myself.
mholtum
07-26-2004, 11:00 PM
If the folder that the forums are in is named /forums how would I get that to point to the right forum. Changing the name I've found screws up the front page.
Shouldn't matter. My vb is installed in /forum. I dont think that the actually name of the dir is relevant.
Allen Mead
07-27-2004, 04:23 PM
Is that where 'forum' changes to 'home' on the nav bar when you click on forum?
mholtum
07-28-2004, 01:06 AM
Yes
Allen Mead
07-28-2004, 03:38 PM
Coolio! cheers mholtum!
mholtum
07-28-2004, 09:51 PM
I cant take credit for this one. Brian told me...
Allen Mead
08-07-2004, 07:03 PM
What do I need to do to this scrpit to change it to go back to my cmps_index.php page which is located at http://www.astra-mk2.com/forum/cmps_index.php ?
Cheers
mholtum
08-07-2004, 07:48 PM
What do I need to do to this scrpit to change it to go back to my cmps_index.php page which is located at http://www.astra-mk2.com/forum/cmps_index.php ?
Cheers
If you place the cmps_index.php file in your root and change it to index.php it will work. Other than that you would have to change the $vboptions[forumhome].php to point to the cmps_index.php file in your /forums/ dir.
Allen Mead
08-07-2004, 07:56 PM
Cool, cheers :cool: :cool:
Allen Mead
08-08-2004, 05:13 PM
I've now got an interesting problem with this. On anyother forum page the 'home' links works perfectly and returns you to our cmps_index.php home page. However, when you're in the links directory, the same link in the navbar points to here:
http://www.astra-mk2.com/forum/cmps_http://www.astra-mk2.com/forum/
hmmm??? Any help much appreciated.
mholtum
08-08-2004, 08:17 PM
I think it has something to do with the fact that you have the cmps_index.php file in the same directory as the forums
Allen Mead
08-09-2004, 04:12 PM
Could be I guess. Trouble is tho, now it's been installed there it'll mess everything up if I move it to my root folder.
mholtum
08-09-2004, 04:25 PM
Could be I guess. Trouble is tho, now it's been installed there it'll mess everything up if I move it to my root folder.No it wont. Just move it and insert put chdir('./forum'); back in. Replace the word forum with the name of your forum directory
Allen Mead
08-09-2004, 05:00 PM
you are a star!
mholtum
08-09-2004, 05:02 PM
you are a star!So I am assuming it worked? Link me so I can see your work
Allen Mead
08-09-2004, 05:11 PM
Haven't don it yet :o , am doing that calander pic mod, it's next on my list tho!!!!
Allen Mead
08-09-2004, 05:18 PM
ah, oops, I get the following error message
Oops, forgot link, http://www.astra-mk2.com
Warning: main(): Unable to access ./includes/init.php in /home/virtual/site111/fst/var/www/html/forum/global.php on line 51
Warning: main(./includes/init.php): failed to open stream: No such file or directory in /home/virtual/site111/fst/var/www/html/forum/global.php on line 51
Fatal error: main(): Failed opening required './includes/init.php' (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site111/fst/var/www/html/forum/global.php on line 51
Allen Mead
08-09-2004, 05:21 PM
this is a copy of my cmps_index.php file
<?php
// ++=========================================================================++
// || vBadvanced CMPS v1.0 RC2 ||
// || © 2003-2004 vBadvanced.com & PlurPlanet, LLC - All Rights Reserved ||
// || This file may not be redistributed in whole or significant part. ||
// || http://vbadvanced.com ||
// ++ ========================================================================++
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'adv_index');
define('VBA_PORTAL', true);
// ============================================
// Enter the full path to your forum here
// Example: /home/vbadvanced/public_html/forum
// ============================================
// chdir('./forum');
// ============================================
// No Further Editing Necessary!
// ============================================
require_once('./forum/global.php');
print_portal_output($home);
?>
mholtum
08-09-2004, 05:35 PM
change this:
require_once('./forum/global.php');
to
require_once('./global.php');
My vb is installed in the /forum/ dir as well. Here is what I have:
<?php
// ++=========================================================================++
// || vBadvanced CMPS v1.0 RC2 ||
// || © 2003-2004 vBadvanced.com & PlurPlanet, LLC - All Rights Reserved ||
// || This file may not be redistributed in whole or significant part. ||
// || http://vbadvanced.com ||
// ++ ========================================================================++
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'adv_index');
define('VBA_PORTAL', true);
// ============================================
// Enter the full path to your forum here
// Example: /home/vbadvanced/public_html/forum
// ============================================
chdir('./forum');
// ============================================
// No Further Editing Necessary!
// ============================================
require_once('./global.php');
print_portal_output($home);
?>
Allen Mead
08-09-2004, 05:44 PM
done. But am now getting the following error
Warning: main(): Unable to access ./global.php in /home/virtual/site111/fst/var/www/html/index.php on line 25
Warning: main(./global.php): failed to open stream: No such file or directory in /home/virtual/site111/fst/var/www/html/index.php on line 25
Fatal error: main(): Failed opening required './global.php' (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site111/fst/var/www/html/index.php on line 25
Allen Mead
08-09-2004, 06:11 PM
it's definately got me beat :o
mholtum
08-09-2004, 06:12 PM
hmmm.. You got me.. I am at a loss. Shoot Brian an IM and see what he says.
apokalupsis
08-09-2004, 11:12 PM
As per the instructions FAQ:
Q. I'm not sure how to find the path to my forums.
Or
I get an error like this when I first try to install the script:
Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/yoursite/html/cmps_index.php on line 8
A. The path to your forums directory is set wrong. Create a file called info.php with the following content:
<? phpinfo(); ?>
Then upload that file to your server and go to it in your browser. You will see a list of options that were set by your host. One of them is called:
_SERVER["PATH_TRANSLATED"]
Copy that path, paste it over what you currently have for your path in the cmps_index.php file, and add the name of your forums directory after it. Reupload your cmps_index.php file.
tygersclaw
08-10-2004, 01:55 PM
In the navbar template find:
<!--<td class="vbmenu_control"><a href="$vboptions[forumhome].php?$session[sessionurl]">Home</a></td>-->
and replace with:
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]?$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]?$session[sessionurl]"> Home </if></a></td>
Thanks for that. I was looking to do that too. Appreciate it muchly. :D
Allen Mead
08-10-2004, 05:33 PM
As per the instructions FAQ:
Hi fella, thanks for the help. did this tonight, unfortunately, it still don't work, getting to the point now where I give up!
cyclopes
08-10-2004, 06:38 PM
This work for me ;)
NAVBAR CODE
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]?$session[sessionurl]"> Forums <else /> <a href="http://www.your url.com/index.php"> Home </if></a></td>
Cyclopes
Allen Mead
08-16-2004, 05:47 PM
mholtum. It's all sorted now. Thanks go out to Zachery!! Top Dude, he's had a bit of a poke around and sorted some code out, not sure what exactly but it's done the trick.
Plus of course yourself for all your help and anyone else who contributed.
mholtum
08-16-2004, 08:15 PM
mholtum. It's all sorted now. Thanks go out to Zachery!! Top Dude, he's had a bit of a poke around and sorted some code out, not sure what exactly but it's done the trick.
Plus of course yourself for all your help and anyone else who contributed.
Glad you got it sorted out. I know first hand just how frustrating this can be.
yaaho
09-07-2004, 11:32 AM
This work for me ;)
NAVBAR CODE
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]?$session[sessionurl]"> Forums <else /> <a href="http://www.your url.com/index.php"> Home </if></a></td>
Cyclopes
This worked best for me b/c with the originally suggested code, the HOME link redirected to my Forums/index.php home rather than the root domain.com/index.php vBadvanced CMPS home. If that makes any sense.
My Website (http://www.shelbyforums.com)
Thanks to cyclopes, mholtum and others for the helpful info.!
Thanks for the tip. It's a great feeling when you can quickly find what you are looking for.
mlevenson
09-11-2004, 10:34 AM
In the navbar template find:
<!--<td class="vbmenu_control"><a href="$vboptions[forumhome].php?$session[sessionurl]">Home</a></td>-->
and replace with:
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]?$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]?$session[sessionurl]"> Home </if></a></td>
Nope doesn't work for me. :( off the cmps main nav menu any ideas? My members really liked being able to jump right into the forums easily.
dunno whats the problem, when i past this my linke changes to www.domain..com. notice the extra dot.
Grumpy ol' Jim
09-30-2004, 12:23 AM
I really hate having my first post in a forum a problem post. Oh well...
I've followed the directions of several people here who seemed to know what they were talking about -- and got a lot of props from users with similar problems as mine. Unfortunately, I have found no joy in getting my portal link to the forums to work right or my forums link to the portal to work right.
This is my own directory structure: ROOT=themadmodder.com SUBDOMAIN=forums.themadmodder.com and is located in a folder in ROOT. All my forum files, including the vB and vBa files and folders are located in the folder that is my SUBDOMAIN.
My forums index file is named "index.php" and the cmps_index is named "portal.php" -- they are both in the same SUBDOMAIN folder. I have defined my forum url as "http://forums.themadmodder.com" and I have defined my forums home page as "index" (default). My home page is defined as "http://themadmodder.com" because that is the home page (not to be confused with the portal or the forum index) and it said in the admin panel it would be a link at the bottom of every page.
I have added the script in the navbar settings that an awful lot of people say has worked, but it hasn't for me. I don't want to try the actual urls in there because no one has commented favorably on them or said they wouldn't screw up the cookie settings for my users (if I ever get any).
Please, I see this thread and several others have gone on for months. Some people still haven't gotten the links right. I came close once, but kept getting "Done, but with errors on the page" in the status bar. vB installed easier than any forum software I've ever used. vBa_cmps installed just fine, but the 2 links in question are a no go. I hope someone can help me out here.
Thank you,
Jim
Grumpy ol' Jim
09-30-2004, 01:08 PM
I was a little disappointed that no one replied to this, but never mind anyway. I tried several other things and completely munged the whole project, so I'm starting from scratch. It really is too bad that better instructions or even code for a couple of the more common structures (un-comment out the right one) wasn't included to have proper links to the forum, the portal and maybe even another home page like my situation.
Jim
KW802
09-30-2004, 01:16 PM
I was a little disappointed that no one replied to this, but never mind anyway.
If you post the code that you tried the first time I'm sure there's a fix that'll take care of your sub-domain issue.
Grumpy ol' Jim
10-01-2004, 12:11 AM
Thanks, Kevin, I would hope so. However, like I said, I munged the whole thing and have begun again. I have a friend helping (linear, if anyone knows him) and think we will get it going this time. I changed the site structure too -- it's now the more common http://[sitename]/forums, so I hope that also makes it easier (to manage and for SEO).
For anyone else with the same problem I had, I actually used the code written in the second post to this thread by mholtum. It didn't work for me, so I altered it according to other suggestions in this thread. I, unfortunately, lost track of all the changes and was finally unable to navigate to my forums page at all (blank page or error page, no matter what I did).
I'll be back if further problems arise. Thanks again for your reply.
Jim
Execution_Style
10-07-2004, 05:34 PM
This is the url to my vBadvanced http://www.sep.tngamer.com/cmps_index.php
How would I edit this..
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]?$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]?$session[sessionurl]"> Home </if></a></td>
to make it link back to the vBadvanced page?
The 'forums' works. It leads to the forums but, the 'home' also leads back to the forums.
Execution_Style
10-07-2004, 05:46 PM
n/m I think I did it. :)
Gronilot
10-10-2004, 01:05 PM
In the navbar template find:
<!--<td class="vbmenu_control"><a href="$vboptions[forumhome].php?$session[sessionurl]">Home</a></td>-->
and replace with:
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]?$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]?$session[sessionurl]"> Home </if></a></td>
For then new and ignorant..... how do I find the "navbar template"
I searched Language and phrases.. and came up with 4 files "setting_portal_shownavbar_desc" "setting_portal_shownavbar_title" "navbar_text" and "navbar_text_desc" and they don't seem to be the appropriate place.
Can someone give me more detailed instructions on how to get to the correct file and how to open it to edit?
Thanks
Gronilot
10-10-2004, 09:02 PM
disregard! I found it in the "style manager" ...
and it works great!
thejaxx
10-27-2004, 01:11 AM
Thanks. I was looking for the way to fix this. :)
Only thing i'm trying to fix right now is smilies on the home page. :/
THey show up fine in forums, but not in the news grabber up front.
To show you what I mean, visit http://69.93.58.107 *new host i'm setting up on*
bringindaruckus
01-10-2005, 06:19 PM
im usin vbulletin 3.0.5, and when i edit the navbar template, i dont have
<!--<td class="vbmenu_control"><a href="$vboptions[forumhome].php?$session[sessionurl]">Home</a></td>-->
in there. is it because im using 3.0.5??
thanks any help would be appreciated
HuangA
01-13-2005, 07:59 AM
Go through slowly, it should be in there; if not, just add what it says to replace with before the User CP link.
Sorry for the extremely late reply... my club's vba site is http://www.goanime.org Its an anime club we're running with our campus :)
lennyharvey85
01-14-2005, 11:00 AM
In the navbar template find:
<!--<td class="vbmenu_control"><a href="$vboptions[forumhome].php?$session[sessionurl]">Home</a></td>-->
and replace with:
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]?$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]?$session[sessionurl]"> Home </if></a></td>
Thanks for this - worked!
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.