The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[HOW TO - vB4] Remove the vB Default Navtabs
[HOW TO - vB4] Remove the vB Default Navtabs Here is a quick article on how to remove some of the default vbulletin navtabs from the navbar template. Removing the What's New navtab: Find (near the top of the template): Code:
<vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT != 'search'"> Code:
<vb:if condition="!$vboptions['selectednavtab']"> Code:
<vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT == 'search'"> <vb:if condition="$show['member']"> <li class="selected"><a class="navtab" href="search.php?{vb:raw session.sessionurl}do=getnew&contenttype=vBForum_Post">{vb:rawphrase getnew_tab}</a> ... a bunch more stuff inbetween to remove ... </li> </vb:if> <vb:elseif condition="$show['member']" /> <li><a class="navtab" href="search.php?{vb:raw session.sessionurl}do=getnew&contenttype=vBForum_Post">{vb:rawphrase getnew_tab}</a></li> <vb:else /> <li><a class="navtab" href="search.php?{vb:raw session.sessionurl}do=getdaily&contenttype=vBForum_Post">{vb:rawphrase getnew_tab}</a></li> </vb:if> In a default navbar template, after removing the chunk of code above, you should end up with this in the template where the code used to be: Code:
{vb:raw template_hook.navtab_middle} {vb:raw template_hook.navtab_end} Go to Plugins & Products > Plugin Manager > Product: vBulletin CMS > Navbar: Insert CMS Navbar Entry Plugin is Active: NO SAVE Removing the Blogs navtab: Go to Plugins & Products > Plugin Manager > Product: vBulletin Blog > Navbar: Eval Blog Link Template and Validate Styleid Find and Remove (or comment out): 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(); } } Removing the Forum navtab: Find and remove (starts near the very top): Code:
<vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT != 'search'"> ... a bunch more stuff inbetween to remove ... <vb:else /> <li><a class="navtab" href="{vb:link forumhome}">{vb:rawphrase forum}</a></li> </vb:if> Other related articles of possible interest: [HOW TO - vB4] Create a New Tab in the navbar [HOW TO - vB4] Create your own vBulletin page |
#72
|
|||
|
|||
Quote:
Quote:
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! |
#73
|
|||
|
|||
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? |
#74
|
|||
|
|||
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(); |
#75
|
||||
|
||||
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. |
#76
|
|||
|
|||
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). |
#77
|
|||
|
|||
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! |
#78
|
||||
|
||||
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.
|
#79
|
|||
|
|||
Thank you for this article! Very helpful and less involved than the first article I read on the subject.
|
#80
|
|||
|
|||
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(); } } 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'] = ''; } |
#81
|
||||
|
||||
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.
|
Благодарность от: | ||
sortega |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|