View Full Version : I need help Please
christian gate
08-15-2011, 08:07 PM
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:
Lynne
08-15-2011, 10:35 PM
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?
christian gate
08-16-2011, 01:40 PM
Hi,
I have tried the following 2 methods but I get the same problem with both of them.
https://vborg.vbsupport.ru/showthread.php?t=226914
And
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
Lynne
08-16-2011, 02:10 PM
In the top thread you linked to, you will see this at the top of the plugin you need to create:
if (THIS_SCRIPT == 'yourpage')
That needs to be a unique condition as stated in that thread:
Your condition MUST be unique! If you use a condition that is also going to evaluate to true for another tab, then they will both be highlighted and the wrong submenu may show up underneath.
It needs to be a condition that will only be true when you click on that tab.
christian gate
08-16-2011, 06:49 PM
: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
Lynne
08-17-2011, 12:35 AM
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:
$vbulletin->options['shop']='unique_name';
It should have a unique name also (although I guess if you only use the plugin once, it will be unique.)
christian gate
08-17-2011, 10:06 AM
"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
christian gate
08-17-2011, 10:37 AM
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
Lynne
08-17-2011, 01:19 PM
THIS_SCRIPT is a variable that is defined on the top of most pages. Open the forumdisplay.php page and you'll see:
define('THIS_SCRIPT', 'forumdisplay');
So, if you wanted something to only show on the top of all forumdisplay pages, you could use:
if (THIS_SCRIPT == 'forumdisplay')
But, that isn't going to help you since you don't want all forumdisplay pages, you only want one. I would use the forumid in your unique condition.
if ($GLOBALS['forumid'] == xx)
change xx to the forumid of your shop forum.
christian gate
08-18-2011, 05:13 PM
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
Lynne
08-18-2011, 07:35 PM
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:
if (THIS_SCRIPT == 'Shop')
Make sure you change the xx to the forumid though.
christian gate
08-18-2011, 08:34 PM
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.
www.christian-gate.net
Thanks
Lynne
08-18-2011, 11:40 PM
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.
christian gate
08-18-2011, 11:56 PM
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
Lynne
08-19-2011, 02:44 AM
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.
christian gate
08-19-2011, 02:04 PM
Hi,
ok, so i have changed it to the following
if ($GLOBALS['2']==christianforum)
But the tab still not selected, nothing changed with the chages above.
Thanks
Lynne
08-19-2011, 09:17 PM
if ($GLOBALS['forumid'] == 2)
christian gate
08-19-2011, 09:23 PM
Finally, thanks very much for your help and time.
--------------- Added 1313797023 at 1313797023 ---------------
Can I ask you how can I delete the Forum one, I have dispalyed it, but it's still appearing.
Thanks
Lynne
08-19-2011, 09:56 PM
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.
christian gate
08-19-2011, 10:01 PM
You mean the Forum tab? yes
--------------- Added 1313798541 at 1313798541 ---------------
I came across it, but I couldn't find it anymore, will try again, thanks very much
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.