vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Create a New Tab in the navbar (https://vborg.vbsupport.ru/showthread.php?t=226914)

worried 01-20-2010 01:25 PM

HTML Code:

$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'album.php')
{
    $vbulletin->options['selectednavtab']='for_pics';
    $tabselected = ' class="selected"';

}
$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="album.php">Albums</a>'.$tablinks.'</li>' ; 

What am I doing wrong here? All I want is a button (no sub menu). Everything works fine except the Forum button is selected instead when clicking the Albums button.

Lynne 01-20-2010 01:32 PM

Quote:

Originally Posted by foesracing (Post 1960719)
I understand that. I just want to see how another page is written, which variable is need to recreate the same page as forum.php but displaying a different information. I know how to code php but don't know the structure of how vbulletin assembles its code.

This may help - [HOW TO - vB4] Create a own vBulletin page

Quote:

Originally Posted by worried (Post 1961186)
HTML Code:

$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'album.php')
{
    $vbulletin->options['selectednavtab']='for_pics';
    $tabselected = ' class="selected"';

}
$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="album.php">Albums</a>'.$tablinks.'</li>' ; 

What am I doing wrong here? All I want is a button (no sub menu). Everything works fine except the Forum button is selected instead when clicking the Albums button.

If you look at the top of your album.php page, you will see THIS_SCRIPT defined here:
PHP Code:

define('THIS_SCRIPT''album'); 

You put 'album.php' instead of the correct 'album' in the conditional. Change it.

worried 01-20-2010 02:25 PM

Thank You! :)

Wormy! 01-21-2010 09:51 PM

I've just read this thread - and I may have missed something... in which case I apologise up front! Having said that... I'm also somewhat (ok, a lot) confused...

I would like to add a new tab called HOME and I would like to have it display on ALL pages throughout my site.

Could someone please help me with this? Or point me in the right direction pls?

Thanks in advance...

Lynne 01-21-2010 09:55 PM

If you create a new navtab via a plugin (like in this mod), it will show on all your pages.

Wormy! 01-21-2010 09:56 PM

Hi Lynne

Thanks... you mean as in the very first post? I hope you can understand I was a little confused by the time I had read all of the posts...

Cheers
Wormy

--------------- Added [DATE]1264122352[/DATE] at [TIME]1264122352[/TIME] ---------------

Wow... I followed the first post and bingo... all done in a matter of about 2 minutes.

Next time I'll give the opening post/tutorial a go before I read ALL of the posts in the thread :)

Thanks SO much Lynne!!

--------------- Added [DATE]1264122480[/DATE] at [TIME]1264122480[/TIME] ---------------

One QQ... is it possible to have the hiughlight line above the button appear (like the default buttons in VB)?

Lynne 01-21-2010 11:13 PM

Quote:

Originally Posted by Wormy! (Post 1962827)
One QQ... is it possible to have the hiughlight line above the button appear (like the default buttons in VB)?

You make the tab be active, or highlighted, by setting the condition correctly for the submenu.

Wormy! 01-21-2010 11:31 PM

Quote:

Originally Posted by Lynne (Post 1962899)
You make the tab be active, or highlighted, by setting the condition correctly for the submenu.

Hmmm... how/where do I do that? Please :)

I'm trying to get the standard highlight/floating bar which shows above the tab...

Thank you!!

--------------- Added [DATE]1264124054[/DATE] at [TIME]1264124054[/TIME] ---------------

If I follow your tutorial... should that not be the case? Apologies for all the questions...

Lynne 01-22-2010 01:49 AM

In my plugin is this line:
PHP Code:

if (THIS_SCRIPT == 'yourpage'

I later say that this must be a unique condition for your tab page to be highlighted. What do you have for that condition?

princeedward 01-22-2010 06:34 PM

Thanks Lynne...manage to create also this great tutorial from you....just can't figure it out how to hide this DropDown Menu to Guest...tried the one you mention above but no luck...

can you please assist me here...


PHP Code:

<li class="popupmenu">
                                <
a href="javascript://" class="popupctrl">Drop Down Menu</a>
                                <
ul class="popupbody popuphover"

<
li><a href="arcade.php?&act=Arcade&module=settings">Settings</a></li>

<
li><a href="arcade.php?&act=Arcade&module=favorites">Favorites</a></li>

<
li><a href="arcade.php?&act=Arcade&module=report">Rankings</a></li
                                </
ul>
                            </
li>
                        
                </
ul'; 

thanks and best regards...

;):up:


All times are GMT. The time now is 01:00 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.01590 seconds
  • Memory Usage 1,761KB
  • 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
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (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