View Single Post
  #1  
Old 06-15-2010, 07:32 AM
Webbstre Webbstre is offline
 
Join Date: Nov 2009
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [Guide][Help Request]How to customize your menu into dropdown menus

Ok, I've been spending a while trying to figure this out, and while I am not a programmer by any means I have made progress and want to share it. Hopefully someone will be able to fill in the final pieces so that I can turn this into a complete guide for others.

Here is what I am trying to do:
  1. Drop all Tabs in the Navbar
  2. Replace the Tabs with dropdown menu tabs via the mod Tabs Add System for vBulletin 4 (sstab advanced)
  3. Preserve the sub-navbar menus when on the pages specific to the dropped

The Problem: Normally when you remove a tab from the navbar it completely removes the sub-navbar, even when on the pages. Most people recommend removing the tabs by disabling a plug-in, or by using a different modification (such as one that removes the Home, Forum, Blog, or What's New tabs), but those tend to remove the sub-navbars as well.

For example, let's say you are using DownloadsII. If you want to remove the tab, you can go into your plug-ins list and disable "DownloadsII: Add a Downloads tab." If you do this, and then go to your downloads page, it no longer displays anything in the sub-navbar.


Here is what I have done so far:
  1. Edited the Tab Add System's plug-in so that instead of linking the new drop-down menu tabs to navtab_start, navtab_middle, and navtab_end, it instead inserts menus into navtab2_start, navtab2_middle, and navtab2_end. (notice the 2 in the new name)
  2. Edited the navbar template so that it now has the following hooks right next to the original counterparts: {vb:raw template_hook.navtab2_start}, {vb:raw template_hook.navtab2_middle}, and {vb:raw template_hook.navtab2_end}
  3. Enclosed the original hooks within the following code:
    Code:
    <div style="display:none"></div>
    in order to hide the original menus.

After that it starts to get tricky. The dropdown menus are the only menus that load, which is half of the effect that I wanted to achieve. The problem here is that the sub-navbars do not load. I have added the removed tabs' links into the new dropdown menus via the modification's Admin CP area, so the links are all there to the original pages, but enclosed within the dropdown menus.

I discovered that after the {vb:raw template_hook.navtab_start} hook, as well as the others, there is a line of code that looks like this:
Code:
<vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT != 'search'">
I have come to the conclusion that this is what I need to edit to reproduce the sub-navbar. I tried changing that line of code (after the first hook) to this:
Code:
<vb:if condition="THIS_SCRIPT != 'search'">
The end result was that the forum's sub-navbar menu now loads everywhere. I fixed the code, but I have come to the following conclusions:
  1. That line of code needs to be edited to only go into effect when on the page appropriate to what is currently loaded
  2. I suspect that a related line of code must exist within the various modifications that may need to be modified as well, or instead of the code mentioned above.


With all of that said, is there anyone out there with the code understanding to tell me what I am missing at the end of all of this? I feel like I'm so close to reaching my goal.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01221 seconds
  • Memory Usage 1,780KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete