vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=253)
-   -   I need help Please (https://vborg.vbsupport.ru/showthread.php?t=268587)

christian gate 08-15-2011 08:07 PM

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:

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.

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

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:
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.

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:
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.)

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:
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.

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


All times are GMT. The time now is 06:32 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01767 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (5)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete