![]() |
I need help Please
Hi,
I am new and need help please, I have created forums each with subforums, I know how to create a link in the navbar, I added the main forum link to the navbar to be accessbile from the navbar and from the admincp - setting - options - Fourm home page option - Show Forum Button - and I displayed the link to the Forum Page on the navigation bar. The problem: 1. Forum Page on the navigation bar is still showing. 2. When I select one of the new pages I created it shows that the Forum Page tab that I displayed is selected instead of the one I clicked. Can you please tell me how to correct this, Thanks:confused: |
What method did you use to add the navtab - there are several.
I would guess you need to use a unique condition to show your navtab as selected. Perhaps your condition isn't unique or isn't valid? |
Hi,
I have tried the following 2 methods but I get the same problem with both of them. HTML Code:
https://vborg.vbsupport.ru/showthread.php?t=226914 HTML Code:
https://vborg.vbsupport.ru/showthread.php?t=245826 Also would you please explain what did you mean by "you need to use a unique condition to show your navtab as selected" Thanks |
In the top thread you linked to, you will see this at the top of the plugin you need to create:
PHP Code:
Quote:
|
:confused:Here How I did it
$tabselected = ''; $tablinks = ''; if (THIS_SCRIPT == 'Shop') { $vbulletin->options['shop']='unique_name'; $tabselected = ' class="selected"'; $tablinks = ' <ul class="floatcontainer"> <li><a href="http://www.christian-gate.net/cgforum/forumdisplay.php?2-Christian-Gate-Main-Forum">shop</a></li> <li class="popupmenu"> <a href="javascript://" class="popupctrl">Drop Down</a> <ul class="popupbody popuphover"> <li><a href="sublink1.php">SubLink 1</a></li> <li><a href="sublink2.php">SubLink 2</a></li> <li><a href="sublink3.php">SubLink 3</a></li> </ul> </li> <li><a href="link2.php">Link 2</a></li> <li><a href="link3.php">Link 3</a></li> </ul> '; } $template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="http://www.christian-gate.net/cgforum/forumdisplay.php?2-Christian-Gate-Main-Forum">Shop Forum</a>'.$tablinks.'</li>' ; Thanks |
And you have a custom script that, in the custom php page, you define the variable THIS_SCRIPT to be Shop? I thought this was a forum? You can't use THIS_SCRIPT to be unique if it's a forum. You should look at the article on conditions to find a condition if it's a forumid you need.
You also shouldn't leave this line as is: PHP Code:
|
"And you have a custom script that, in the custom php page, you define the variable THIS_SCRIPT to be Shop? I thought this was a forum? You can't use THIS_SCRIPT to be unique if it's a forum.
Yes it's a forum made as a shop and named "shop" and has subforums. I have created 3 forums each with subforums, I need to use this script to add the 3 forums to the navbar each with it's own name ( Service) eg the forum for advertising stuff for sale will be called "shop" and so on, also I want it to be only be accessible from the navbar so I need to disable the "Forum Navbar" that give access to all the forums list. So this forums been created from the admincp - Forums & Moderators - add new forum Not as custom php page Thanks |
And you have a custom script that, in the custom php page, you define the variable THIS_SCRIPT to be Shop? I thought this was a forum? You can't use THIS_SCRIPT to be unique if it's a forum.
It's a forum not custom php page, Called "shop" You can't use THIS_SCRIPT to be unique if it's a forum, so what's it used for? Thanks |
THIS_SCRIPT is a variable that is defined on the top of most pages. Open the forumdisplay.php page and you'll see:
PHP Code:
PHP Code:
PHP Code:
|
Hi,
I have 3 questions, sorry I am taking a lot of your time. 1. when I change the if ($GLOBALS['forumid'] == xx) I will be able to make the forum name (shop) appear in the navbar? 2. What do I do when I need to add more forums in the same way? 3. Where can I find "if ($GLOBALS['forumid'] == xx)" Thanks so much |
1. Assuming you do this correctly, then yet.
2. Either create more plugins or just put the code for another one directly under each other making sure each one has it's own unique conditions! 3. That is the condition you would use for your plugin. Right now you have this which isn't a valid condition for what you want: PHP Code:
|
Hi,
Ok, I have done it, but the tab still not selected, but it goes to the correct pages when clicked. you can visit the site and have a look. HTML Code:
www.christian-gate.net |
Please post your *exact* code for the plugin. And, actually, we can't see whether anything is working or not since you have the board off. You'll need to turn it on for us to see anything.
|
Hi,
Here is the code, and the board is on $tabselected = ''; $tablinks = ''; if ($GLOBALS['forumid']==christianforum) { $vbulletin->options['selectednavtab']='christianforum'; $tabselected = ' class="selected"'; $tablinks = ' <ul class="floatcontainer"> <li><a href="http://www.christian-gate.net/cgforum/forumdisplay.php?2-Christian-Gate-Main-Forum">christian Forum</a></li> <li class="popupmenu"> <a href="javascript://" class="popupctrl">Drop Down</a> <ul class="popupbody popuphover"> <li><a href="sublink1.php">SubLink 1</a></li> <li><a href="sublink2.php">SubLink 2</a></li> <li><a href="sublink3.php">SubLink 3</a></li> </ul> </li> <li><a href="link2.php">Link 2</a></li> <li><a href="link3.php">Link 3</a></li> </ul> '; } $template_hook['navtab_start'] .= '<li'.$tabselected.'><a class="navtab" href="http://www.christian-gate.net/cgforum/forumdisplay.php?2-Christian-Gate-Main-Forum">Christian Forum</a>'.$tablinks.'</li>' ; Thanks |
You did not enter the forumid. The forumid is a number - it is the id number of the forum. You need to put that into the condition.
The Christian Forum navtab goes to this url -http://www.christian-gate.net/cgforum/forumdisplay.php?2-Christian-Gate-Main-Forum - so the forumid is 2. Please also use the code tags the next time you post code. It makes it much easier to read. |
Hi,
ok, so i have changed it to the following PHP Code:
Thanks |
PHP Code:
|
Finally, thanks very much for your help and time.
--------------- Added [DATE]1313797023[/DATE] at [TIME]1313797023[/TIME] --------------- Can I ask you how can I delete the Forum one, I have dispalyed it, but it's still appearing. Thanks |
You mean the Forum tab? That will require modifying the navbar template. I don't have instructions for doing that but I know they have been posted before so you may want to try a search.
|
You mean the Forum tab? yes
--------------- Added [DATE]1313798541[/DATE] at [TIME]1313798541[/TIME] --------------- I came across it, but I couldn't find it anymore, will try again, thanks very much |
All times are GMT. The time now is 12:14 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|