Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Design and Graphics Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-15-2011, 09:07 PM
christian gate christian gate is offline
 
Join Date: Aug 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 08-15-2011, 11:35 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #3  
Old 08-16-2011, 02:40 PM
christian gate christian gate is offline
 
Join Date: Aug 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
And

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
Reply With Quote
  #4  
Old 08-16-2011, 03:10 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the top thread you linked to, you will see this at the top of the plugin you need to create:
PHP Code:
if (THIS_SCRIPT == 'yourpage'
That needs to be a unique condition as stated in that thread:
Quote:
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.
Reply With Quote
  #5  
Old 08-16-2011, 07:49 PM
christian gate christian gate is offline
 
Join Date: Aug 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 08-17-2011, 01:35 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
$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.)
Reply With Quote
  #7  
Old 08-17-2011, 11:06 AM
christian gate christian gate is offline
 
Join Date: Aug 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

"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
Reply With Quote
  #8  
Old 08-17-2011, 11:37 AM
christian gate christian gate is offline
 
Join Date: Aug 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #9  
Old 08-17-2011, 02:19 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
define('THIS_SCRIPT''forumdisplay'); 
So, if you wanted something to only show on the top of all forumdisplay pages, you could use:
PHP Code:
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.
PHP Code:
if ($GLOBALS['forumid'] == xx
change xx to the forumid of your shop forum.
Reply With Quote
  #10  
Old 08-18-2011, 06:13 PM
christian gate christian gate is offline
 
Join Date: Aug 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 07:07 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.13551 seconds
  • Memory Usage 2,260KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (5)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete