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] Remove the vB Default Navtabs (https://vborg.vbsupport.ru/showthread.php?t=234220)

Laurent42 03-17-2011 09:28 PM

Quote:

So the MediaLibrary tab shows up if you have it set to navtab_middle but not if you have it set to navtab_left?
Exactly!

Quote:

Have you looked in your navbar template to verify you have that template_hook there?
There is no navtab_left hook called in the navbar template? It should? In the default template there is one??

I do not have modified my default template and by doing a search, I do not find navtab_left hook in the default navbar!

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

Ok, I have fixed the problem.

I just needed to hook navtab_start. =)
But I do not understand the difference of navtab_left/navtab_start.

So good to know => the first element is navtab_start and not navtab_left...

A big thanks to Lynne for his/her time!

Laurent42 03-19-2011 10:26 AM

1 Attachment(s)
So now my tabs in the correct order!

My custom tab is the first one.
The forum tab is the second one.

The new problem I have is...
That's the second tab that is selected by default.

What should I hook in order to have my first tab selected by default when I go on the site?

Laurent42 03-19-2011 11:50 AM

Maybe this can help, here is the plugin code:

Code:

    $perms = media_permissions();

    $vbulletin->options['selectednavtab'] = 'media';

    $categories = $vbulletin->db->query_read("
        SELECT * FROM ".TABLE_PREFIX."media_category
        WHERE catOrder != '0'
        ORDER BY catOrder
    ");

    $href['playlists'] = construct_href_playlists();
    $href['pmine'] = construct_href_playlists_mine();
    $href['pcreate'] = construct_href_playlists_create();
    $href['favorites'] = construct_href_favorites();
    $href['subscriptions'] = construct_href_subscriptions();
    $href['submit'] = construct_href_submit();
    $href['random'] = construct_href_random();
    $href['cats'] = construct_href_admin("cats");
    $href['tags'] = construct_href_admin("tags");
    $href['host'] = construct_href_admin("host");

    while ($category = $vbulletin->db->fetch_array($categories))
    {
        $category['href'] = construct_href_category($category);

        $category['align'] = "";
        for ($i = 0; $i < $category['catDepth']; $i++) { $category['align'] .= '-- '; }

        $templater = vB_Template::create('8WR_media_NAVTAB_cat');
        $templater->register('category', $category);
        $categorybits .= $templater->render();
    }
}

$templater = vB_Template::create('8WR_media_NAVTAB');
$templater->register('perms', $perms);
$templater->register('href', $href);
$templater->register('categorybits', $categorybits);
$template_hook['navtab_start'] .= $templater->render();


Lynne 03-19-2011 04:20 PM

You know this is an article about removing default navtabs, right? I just realized that you are talking about adding a navtab which has nothing to do with this article.

But anyway, if you need someone to try to debug your plugin, you should post your own thread. I do notice you have an extra } just sitting in there without a beginning.

Laurent42 03-19-2011 04:35 PM

Ok, I'm going to start a new thread.

For the '}' it's ok, the beginning of the code has not been pasted.

ps: It's not my plugin, but a well known (Media Library).

screenmates 04-02-2011 05:07 AM

Hi Lynne,

vB 4.1.2

We tried several times to remove the code precisely as you suggested from the navbar template but the What's New button remains intact. Also tried clearing CMS cache but no luck. Has something else changed in 4.1.2 and do we need to do anything special?

Please help...

Thanks!

Lynne 04-02-2011 03:40 PM

Make sure you are editing the correct style. There is no way you could remove all that code and still have the tab. If you are not using a default style, then make sure it isn't in there twice. And, make sure a modification is not adding the tab.

CardMafia 05-12-2011 10:43 PM

Thank you for this article! Very helpful and less involved than the first article I read on the subject.

sortega 07-25-2011 06:33 PM

I made the changes above as best I could and got the following error message when complete (it did remove my "Home" and "Blog" buttons which is what I wanted)

"Parse error: syntax error, unexpected '<' in /home2/hersheyi/public_html/forum/includes/class_bootstrap.php(537) : eval()'d code on line 9"

but how do I correct that?

I did notice that for your removing the Blog button code your code did not match mine (see both exampled below) so I commented out the section I thought applied.

Yours:
Code:

if (defined('VBBLOG_CACHED_TEMPLATES'))
{
    if (defined('VBBLOG_SCRIPT'))
    {
        $vbulletin->options['selectednavtab'] = 'vbblog';
    }
    $template_hook['navtab_middle'] .= vB_Template::create('blog_navbar_link')->render();
        $template_hook['navbar_getnew_menu'] .= vB_Template::create('blog_navbar_whatsnew_link')->render();
    if ($show['blog_search'])
    {
        $template_hook['navbar_search_menu'] .= vB_Template::create('blog_navbar_search')->render();
    }
}

Mine:
Code:

<!-- if (defined('VBBLOG_CACHED_TEMPLATES'))
{
        if (defined('VBBLOG_SCRIPT'))
        {
                $vbulletin->options['selectednavtab'] = 'vbblog';
        }
        $template_hook['navtab_middle'] .= vB_Template::create('blog_navbar_link')->render();
        $template_hook['navbar_getnew_menu'] .= vB_Template::create('blog_navbar_whatsnew_link')->render();
} -->


if (STYLEID != $vbulletin->userinfo['blogstyleid'])
{
        $vbulletin->userinfo['blocktext'] = '';
}

HELP!

Lynne 07-25-2011 10:40 PM

That is not how you comment out php. You use /* at the beginning and */ at the end. If you use those for that section that you showed, then it will work. <!-- and --> are used for commenting out html.


All times are GMT. The time now is 03:09 AM.

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.01534 seconds
  • Memory Usage 1,744KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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