View Full Version : Dynamic Forum / Home Link in Navbar
mholtum
07-26-2005, 06:22 PM
Taken from this (http://www.vbadvanced.com/forum/showthread.php?t=41&highlight=dynamic+forum+home) post. Numerous people have been saying "the code isn't there in 3.5, what do I do?" SO I thought I would help them out.
In the Navbar template find:
<if condition="$show['member']">
it is aprox. line number 91.
Above that add:
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]/$vboptions[forumhome].php?$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]?$session[sessionurl]"> Home </if></a></td>
There you have it. Easy money.
banuchi2
07-27-2005, 10:11 PM
Thank you very much.
mholtum
07-27-2005, 10:13 PM
No Problem.
hotrod1
07-28-2005, 12:06 PM
Thanks, it is so simple to install and it saves having to display a messy link somewhere else.
civicowners.com
08-04-2005, 10:00 PM
Worked great for me. Thank for a hack!
jwhysleep
08-05-2005, 06:59 PM
Beautiful now how about one for the gallery lol
mholtum
08-05-2005, 07:24 PM
Beautiful now how about one for the gallery lol
Why didnt you say so?
<if condition="THIS_SCRIPT != 'adv_index'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]?$session[sessionurl]">Home</a></td>
</if>
<if condition="defined('VBA_SCRIPT')">
<td class="vbmenu_control"><a href="$vboptions[bburl]/$vboptions[forumhome].php?$session[sessionurl]">Forums</a></td>
</if>
<if condition="VBA_SCRIPT != 'gallery'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]/gallery/?$session[sessionurl]">Gallery</a></td>
</if>
Home / Forums / Gallery ;)
pioneer
08-08-2005, 09:41 PM
Great! Thank you!
eclectica
08-09-2005, 11:38 PM
If you take out the two question marks of the added modification in the navbar template as posted above by mholtum, then you will have the link to your forum without them, so you will have a link to http://www.vbadvanced.com/ for your Home instead of http://www.vbadvanced.com/?
Dorfdad
08-12-2005, 10:43 PM
Im having a slight problem there.
I renamed the Vbulletin index.php to forums.php and renamed the cmps_index.html to index.html in the root of my public_html folder. The site works BUT in the index.php (which is the portal) I see a link in the Nav Bar to Forum (but the hover shows the path as index.php? which just keeps looping it back to itself.. (this is the problem it needs to point to the FORUM)
Now I created a Link on the site menu to forums that points to http://www.gamereports.net/forum.php?page=home
and it goes to the forums and than in the Nav bar I see HOME which just paths back to www.gamereports.net
Here is the info I entered in Navbar
<td class="vbmenu_control"><if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]/$vboptions[forumhome].php?$session[sessionurl]"> Forums <else /> <a href="$vboptions[homeurl]$session[sessionurl]"> Home </if></a></td>
my path in the setup for the forum is http://gamereports.net
I turned off the site right now so no users can login while I fix this..
Please Help
Thanks in Advance
Dorfdad
hmm, wers the navbar template :s
mholtum
08-15-2005, 04:55 PM
admincp / Style Manager / Edit Styles /Navigation & Breadcrumbs / navbar
Dorfdad
08-15-2005, 10:36 PM
Got it working now, but having a little problem with the recent threads IMAGES there poinintg to the wrong location. I made sure in the vbc install the paths were correct can someone point me where I need to change something?
www.gamereports.net you can see the recent threads are missing images.
mholtum
08-15-2005, 11:51 PM
All I see is a blank page.
Dorfdad
08-15-2005, 11:52 PM
try now was fixing somethings
\Sorry
www.gamereports.net at bottom in recent threads Images are missing from posts.
can someone tell me where to change that?
in forums there fine..
scoles15
08-25-2005, 12:29 PM
Thank you from too, I just brought up my gallery
Steve Coles
mholtum
08-25-2005, 12:33 PM
try now was fixing somethings
\Sorry
www.gamereports.net at bottom in recent threads Images are missing from posts.
can someone tell me where to change that?
in forums there fine..Run the vbacmps_install.php script again and choose update image paths.
ninni
08-27-2005, 03:21 PM
I have the same problem, but its only the avatar and ranks that don't show.
If I run the install script again, there are no options for avatar and ranks.
I cant find any option on my admin cp to change the path either.
puertoblack2003
08-31-2005, 04:14 PM
good day everyone,
i'm a neebie learning the ropes, how can you config when someone goes to my site it'll take them straight to the portal and from there have them to go to the forum by pressing the navbar link.right now it's configured that when u go to my site it takes them straight to the forum and not the portal and tutorial will be great. click on the link to help answer my question www.nievesidenshop.com
mholtum
08-31-2005, 04:28 PM
Considering you installed vb in the root directory you will need to do a couple things.
1: Rename the index.php file that is from the vb install to forums.php or whatever you wish.
2: Name the cmps_index.php file index.php
3: In the options section change the word index to forums or whatever you named the file.
or
you could setup a redirect from http://www.yoursite.com to http://www.yoursite.com/cmps_index.php
puertoblack2003
08-31-2005, 04:57 PM
Considering you installed vb in the root directory you will need to do a couple things.
1: Rename the index.php file that is from the vb install to forums.php or whatever you wish.
2: Name the cmps_index.php file index.php
3: In the options section change the word index to forums or whatever you named the file.
or
you could setup a redirect from http://www.yoursite.com to http://www.yoursite.com/cmps_index.php
thank you sir for your quick respond i will give it a go
SelRahc
09-08-2005, 07:42 PM
Hey Mho,
When I search my navbat template for vb3.5 I find 4 locations with
<if condition="$show['member']">
in my navbar template. Do I add the line above all of them or is it just the first one?
SelRahc
09-08-2005, 08:31 PM
Never mind Mho. I added it only above the first and it seems to be working just fine. What would the line be to also add a link for the Links Directory?
SelRahc
09-08-2005, 08:38 PM
I got the links to work. If you need link to the Links Directory to work like the others above add the following code:
<if condition="THIS_SCRIPT != 'linksindex'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]/links/$session[sessionurl]">Links</a></td>
</if>
I didnt get it at first because I didn't notice tha the defines wern't the same between modules. The gallery uses VBA_SCRIPT where the cmps and link directory uses THIS_SCRIPT definitions.
Loco Macheen
09-11-2005, 11:39 PM
thank you mholtum , i needed something like this :)
swimclub
09-18-2005, 01:14 PM
My users have been pestering me for this for a while.
Thanks guys!
Chris
Black Cobra
09-25-2005, 12:35 PM
thanks for this, came in handy.
Rukas
09-29-2005, 10:49 PM
Thanks!
Thank you. This is very helpful.
Yorixz
10-01-2005, 05:13 AM
Thanks, works perfectly.
xtremeoff-road
10-01-2005, 05:18 AM
Don't listen to Mike, he is just excited that his son got a promotion.
Damn rangers ;)
Hey Mike....HOOAAHHH!
mholtum
10-01-2005, 05:58 AM
Don't listen to Mike, he is just excited that his son got a promotion.
Damn rangers ;)
Hey Mike....HOOAAHHH!
Enlighten me. It is 0212 and I get to pickup my wife from the airport tomorrow at 0800. She has been on a business trip for the past 18 days. She then leaves Monday at 1100 to return to Chicago for another 2 weeks..
I have no friggin idea as to what you are talking about MIke.. Please enlighten me..
Oh, get this, I am finally getting my my insurance check! Woo Hoo. I am ordering my M4 on Wednesday!
pennylessz28
10-01-2005, 08:15 PM
Nice little trick ;) I used the same code to turn off certain links to help show where the user was.
xtremeoff-road
10-02-2005, 04:02 AM
Well this is odd, this script worked fine in one of my forums, however, it does not work in my newest one:
http://www.pbfan.com/gallery/?
Hoover over the FORUMS link in the navbar and you will see what the URL that it is giving is.
I have the navbar replacements in there the same as my other site.
Help please :)
HansMuenchen
10-02-2005, 08:38 PM
How must I do it if my forumshomefile is called forum.php?
Thnx for help me :)
Greetings
Hans
karrerax
10-04-2005, 03:20 AM
The hack its awesome and run correctly.
But when I click in "home" link the link goes to www.myweb/?
How can I remove the ? please?
xtremeoff-road
10-04-2005, 08:11 PM
Well this is odd, this script worked fine in one of my forums, however, it does not work in my newest one:
http://www.pbfan.com/gallery/?
Hoover over the FORUMS link in the navbar and you will see what the URL that it is giving is.
I have the navbar replacements in there the same as my other site.
Help please :)
** BUMP **
Any thoughts on this???
blikos
10-05-2005, 02:53 PM
If you take out the two question marks of the added modification in the navbar template as posted above by mholtum, then you will have the link to your forum without them, so you will have a link to http://www.vbadvanced.com/ for your Home instead of http://www.vbadvanced.com/?
I think this is the answer you are looking for :)
xtremeoff-road
10-05-2005, 08:20 PM
I think this is the answer you are looking for :)
Naw my friend, my understanding is those '?' are needed for the sessions.
My one site has this same code and it works, for some reason it is not working on my new site??
vanayr
10-07-2005, 12:51 AM
It's odd, I did the mod, and I get the link, but instead of getting a link to www.pandemonium.cc/forums, I get a link to www.pandemonium.cc. This aint gonna work :(
Any idea how I get get it to link right? The mod I saw for 1.0 does not work anymore.
-V.
darcon
10-08-2005, 06:00 PM
Thanks! Works great
ciocsy
10-13-2005, 10:20 PM
worked great, thanks!
cbr929rrerion
10-22-2005, 12:39 AM
I need help with links.. I added the gallery and now my search and links "links" point to the gallery folder not my main forum folder.. which is up one level, they are in JS so I can get them to work.. help please..
www.crotchrocketracing.com/vbforum/gallery
HansMuenchen
10-22-2005, 09:16 PM
How can I hide the Link from guests? Because normaly I only want that guests see registration but not forums or gallery.
Thny for helping me.
Greetings out of Munich (sorry for my bad english)
Hans
carvster
10-26-2005, 02:47 PM
Well this is odd, this script worked fine in one of my forums, however, it does not work in my newest one:
http://www.pbfan.com/gallery/?
Hoover over the FORUMS link in the navbar and you will see what the URL that it is giving is.
I have the navbar replacements in there the same as my other site.
Help please :)
I couldn't check the gallery listed above but am wondering if it's the same problem I'm having since upgrading to vB 3.5, vBadvanced 2.0, and vBgallery 1.0.1.
When I'm on forum pages or the vBadvanced pages the links are correct, however, the Forum link on the gallery pages is wrong. It's appending the home page link to the forum page link.
If someone can help, I'd really appreciate it. I had the script installed before the upgrade.
Take a look here: http://www.thepetsforums.com/gallery/?
HansMuenchen
10-27-2005, 02:08 PM
I couldn't check the gallery listed above but am wondering if it's the same problem I'm having since upgrading to vB 3.5, vBadvanced 2.0, and vBgallery 1.0.1.
When I'm on forum pages or the vBadvanced pages the links are correct, however, the Forum link on the gallery pages is wrong. It's appending the home page link to the forum page link.
If someone can help, I'd really appreciate it. I had the script installed before the upgrade.
Take a look here: http://www.thepetsforums.com/gallery/?
Here at me it's the same :(
Greetings
Hans
Thanx
I used the one with the three links, but as I use photopost for my gallery, in gallery I have Gallery and Home instead of Forum and Home.
How can I fix this please?
regards
Watson
11-02-2005, 10:08 AM
Thanks for porting this over
Watson
ihatetyping
11-21-2005, 01:47 AM
I'm only posting this in the hopes it might help someone else.
To be sure I don't know jack about php so forget probing my lack of skills there ....it's huge.:)
Before I upgraded to vB 3.5 the dynamic nav bar hack worked great for CMPS & the Gallery.
After the upgrade to 3.5 I tried to follow the instructions posted by mholtum to a T at least a dozen times.
But each time I did it from a clean install all my links would work until I tried to go to the Forums from inside of the Gallery.
I would always get http://localhost/forum/http://localhost/gallery/index.php?
This was the only messed up URL and I checked my CMPS default page & all the threads related to this here.
Anyways after hours of playing with this I've got it working now.
I took the original code and removed a few characters.
This code (below) is working both on my develpment (localhost) server & my live site.<if condition="THIS_SCRIPT != 'adv_index'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]?$session[sessionurl]">Home</a></td>
</if>
<if condition="defined('VBA_SCRIPT')">
<td class="vbmenu_control"><a href="$vboptions[bburl]?$session[sessionurl]">Forums</a></td>
</if>
<if condition="VBA_SCRIPT != 'gallery'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]/gallery/?$session[sessionurl]">Gallery</a></td>
</if>
The code I deleted is below and was removed from the second if statement in mholtum's original code for dynamic nav bar links to : CMPS-Forum-Gallery.
/$vboptions[forumhome].php
Unmodifed code I could not get to work (below).
<if condition="THIS_SCRIPT != 'adv_index'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]?$session[sessionurl]">Home</a></td>
</if>
<if condition="defined('VBA_SCRIPT')">
<td class="vbmenu_control"><a href="$vboptions[bburl]/$vboptions[forumhome].php?$session[sessionurl]">Forums</a></td>
</if>
<if condition="VBA_SCRIPT != 'gallery'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]/gallery/?$session[sessionurl]">Gallery</a></td>
</if>
I now get a working http://localhost/forum/? URL for my Forums nav bar link dynamically any time/place I choose to use it!!
I'm sure my fix is probably the wrong thing to do but then again this thread seemed dead and maybe someone that knows of a prefered solution will see this and feel compeled to give us the correct code.
BTW: if this did help anyone I'm thrilled. :D
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.