Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #391  
Old 09 Feb 2011, 19:11
odln018's Avatar
odln018 odln018 is offline
 
Join Date: Mar 2006
Ok, I'm making progress with this.

What I'm trying to do is created a Special Access tab for those who have contributed and have access to more features of the site.

My link1.php page contains this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

When I click on the Nav link, I want that tab to be highlighted, with items in the sub for "sub link 1", sublink 2", etc.

Here's my plugin code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


When I click on the tab, I get taken directly to the contents of link1.php

Any corrections would be greatly appreciated.

Last edited by odln018; 09 Feb 2011 at 19:50.
Reply With Quote
  #392  
Old 09 Feb 2011, 19:58
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
You say that right now if you click on the tab, you get taken to link1.php. Isn't that what you want? I'm not understanding what the problem is that you are having.

And on link1.php, do you define THIS_SCRIPT?
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #393  
Old 16 Feb 2011, 23:30
wpeloquin wpeloquin is offline
 
Join Date: May 2006
Thumbs up

Hello.

I just wanted to say that I used a hybrid between yours and ragtek's. It allows the base of the navtab to be stored in the plugin, with a couple of things that can be edited in the Admin->Options->Plugin, and offloads the submenu into a template that can be edited as needed by the end-user.

Plugin PHP:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Template Code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #394  
Old 16 Feb 2011, 23:55
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
You ought to release that.
Reply With Quote
  #395  
Old 17 Feb 2011, 13:50
Hippy's Avatar
Hippy Hippy is offline
 
Join Date: Dec 2001
Originally Posted by Boofo View Post
You ought to release that.
I'll second that
Reply With Quote
  #396  
Old 21 Feb 2011, 02:25
Truth66 Truth66 is offline
 
Join Date: Oct 2010
To try and keep things simple, I just added a couple of tabs to the nav bar. The new tabs appear with the name that I want and are fully clickable to the link that I want.
However, when I click onto my new tab it highlights when it's supposed to and then when the new page appears, the tab is no longer highlighted after I move the cursor. The Forum tab automatically highlights, yet the page does not change to the Forum page.

This only happens with the new tabs that I created. I'm using v4.1.2

The tabs were created as a plugin and the hook location is process_templates_complete

Here's the html in the plugin that I used to create one of the new tabs:

$template_hook['navtab_middle'] .= '<li'.$tabselected.'><a class="navtab" href="http://www.voicescount.com/forumdisplay.php?589-Businesses-Sellers-Listings-U.S.A.-Nationwide-Statewide-and-by-American-Cities">U.S.A. Listings</a>'.$tablinks.'</li>';

Is there anything missing in this html?

Thanks Again

Last edited by Truth66; 21 Feb 2011 at 02:48.
Reply With Quote
  #397  
Old 21 Feb 2011, 03:59
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by Truth66 View Post
To try and keep things simple, I just added a couple of tabs to the nav bar. The new tabs appear with the name that I want and are fully clickable to the link that I want.
However, when I click onto my new tab it highlights when it's supposed to and then when the new page appears, the tab is no longer highlighted after I move the cursor. The Forum tab automatically highlights, yet the page does not change to the Forum page.

This only happens with the new tabs that I created. I'm using v4.1.2

The tabs were created as a plugin and the hook location is process_templates_complete

Here's the html in the plugin that I used to create one of the new tabs:

$template_hook['navtab_middle'] .= '<li'.$tabselected.'><a class="navtab" href="http://www.voicescount.com/forumdisplay.php?589-Businesses-Sellers-Listings-U.S.A.-Nationwide-Statewide-and-by-American-Cities">U.S.A. Listings</a>'.$tablinks.'</li>';

Is there anything missing in this html?

Thanks Again
You need to make sure that you wrote a valid, unique condition for when you tab is active - this is the example condition given and you will need to change it to be valid for your pages:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That is just an example and your condition will most likely look totally different.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #398  
Old 21 Feb 2011, 21:07
Truth66 Truth66 is offline
 
Join Date: Oct 2010
Hi Lynne,

I've spent countless hours on this today. In fact I've created three different plugins, using a different code fo each and tested each plugin seperately. All three plugins do the exact same thing. Yet all have the exact same problem. The problem is that the tab I create doesn't stay highlighted after a person clicks onto the tab. The tab that does stay highlighted after my new tab is clicked is the Forum tab.

Here's the three different types of code that I've tried:

Plugin A Code:

$template_hook['navtab_end'] = '<li><a class="navtab" href="forumdisplay.php?589">U.S.A. Listings';

Note: Plugin A Code was explained here:

http://www.vbulletin.org/forum/showt...67#post2149967

Plugin B Code:

$template_hook['navtab_middle'] .= '<li'.$tabselected.'><a class="navtab" href="http://www.voicescount.com/forumdisplay.php?589-Businesses-Sellers-Listings-U.S.A.-Nationwide-Statewide-and-by-American-Cities">U.S.A. Listings</a>'.$tablinks.'</li>';

Plugin C Code:

$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'Cdn Listings')
{
$vbulletin->options['selectednavtab']='Cdn Listings_tab';
$tabselected = ' class="selected"';
$tablinks = '
<ul class="floatcontainer">
<li><a href="http://www.voicescount.com/forumdisplay.php?2176-Businesses-Sellers-Listings-Canada-Nationwide-Provincewide-amp-by-Canadian-Cities">Cdn Listings</a></li>
</ul>
';
}
$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="http://www.voicescount.com/forumdisplay.php?2176-Businesses-Sellers-Listings-Canada-Nationwide-Provincewide-amp-by-Canadian-Cities">Cdn Listings'.$tablinks.'</li>' ;

As you can see I'm trying.

Please review the above codes and I appreciate any insite.

Thanks Again
Reply With Quote
  #399  
Old 21 Feb 2011, 22:55
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
For Plugin A & B, you have not posted your unique condition at all, so I don't know where the problem is. I do know that if you are linking to a forumdisplay page that you won't be able to use THIS_SCRIPT because all of the forumdisplay pages have that defined the same:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

As for the last, Plugin C, again, you are linking to a forumdisplay page and saying the condition is if THIS_SCRIPT equals 'Cdn Listings' but I don't see how you could possible define that since THIS_SCRIPT is already defined on the forumdisplay page to be 'forumdisplay' as I showed above.

You are going to have to use something like the forumid in the condition. Like:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #400  
Old 22 Feb 2011, 00:51
Truth66 Truth66 is offline
 
Join Date: Oct 2010
Thanks Lynne,

Your solution to Plugin C works:

I changed:
if (THIS_SCRIPT == 'Cdn Listings')

to:

if ($GLOBALS['forumid'] == 2176)

The single Tab now works the way it's supposed to.

Based on your solution, how would your original code at the start of this thread be changed so that I could do the following:

The main tab says Listings

A person clicks onto Listings and a drop menu appears containing three or more sub tabs listed. Each of these sub tabs is linked to a different forum id.

Thanks Again
Reply With Quote
  #401  
Old 22 Feb 2011, 02:42
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
You would need to write some condition that is unique to whatever "Listings" is. I don't know anything about that page since it isn't a default vb page (or is it and you are just calling it something else?), so I don't know what the condition would be. If it's a custom page, then define THIS_SCRIPT at the top of the php page, like it is defined on other vB pages, and then you can use that in the condition.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #402  
Old 23 Feb 2011, 00:37
Saviour's Avatar
Saviour Saviour is offline
 
Join Date: Apr 2007
Lynne,

Please be gentle with me on this...I've looked over your instructions...and I'm sitting here scratching my head.

I have a mod installed called Chatbox Evo. There is no option in this mod to add a link to the navbar, or to the community link menu.

I want to add a new tab on the navbar that opens the chatbox in full-page mode. I want to name this tab "Chat"...and it will be viewable by all who visit the site.

The link to call the full-size chatbox is as follows:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Now...can you give me step by step as to what I need to do? Thanks, in advance.
__________________
Free Computer Help
Reply With Quote
  #403  
Old 23 Feb 2011, 01:18
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Not really. I don't know anything about the code for that mod. You may want to ask the developer if there is a THIS_SCRIPT set on that page that you can use in the condition. Then you could do something like:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So, something like that may work.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #404  
Old 23 Feb 2011, 15:58
Saviour's Avatar
Saviour Saviour is offline
 
Join Date: Apr 2007
Originally Posted by Lynne View Post
Not really. I don't know anything about the code for that mod. You may want to ask the developer if there is a THIS_SCRIPT set on that page that you can use in the condition. Then you could do something like:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So, something like that may work.
Lynne...

Thank you for the reply...

Yes, there is a THIS_SCRIPT set on the page:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So...what I'd like to do is setup a tab (labeled "Chat"), with no sub-menu links...so that when a user clicks the "Chat" tab, they are directed to the chat, itself.

Can you provide me with the code, or the modifications from your code...in order for me to complete this? I don't want to remove any lines of code from what you have given us...and leave myself hanging. I do understand coding...a little, but don't want to leave myself in a bind.

Thanks, in advance...
__________________
Free Computer Help
Reply With Quote
  #405  
Old 23 Feb 2011, 17:25
davepkr davepkr is offline
 
Join Date: Oct 2010
This is PERFECT for creating only a TAB, this is what I was looking for.

Originally Posted by thunderclap82 View Post
Do you have to create your own vBulletin page to use this? I created a section and am trying to use this tutorial to go to that section, yet I can't get the navbar to highlight. Here is the code as I have it now (I removed the submenu link code):


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 18:12.

Layout Options | Width: Wide Color: