Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
navbar forumjump dropdown Details »»
navbar forumjump dropdown
Version: 1.00, by Floris Floris is offline
Developer Last Online: Mar 2021 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.4 Rating:
Released: 12-20-2006 Last Update: Never Installs: 12
Uses Plugins Template Edits
Is in Beta Stage  
No support by the author.

This is beta, and I won't support it.

What does this do?

This will add a dropdown to your navbar that lists the forums below a parent forum.

On my bro's site we have a list of 12 worksheets, and each worksheet is a forum. We needed a list of all 12 worksheets for quick navigation. Instead of me getting emails every time they make a forum change, the dropdown is now auto updated, populated and I don't have to worry those emails anymore.

It uses forumcache (tnx danny) so it won't add a query to each page, unless it needs to.

===== TEMPLATE CHANGES =====
Open the template: navbar, and find this code:
Code:
<if condition="$show['registerbutton']">
Above this, add the following code:
Code:
<td id="navforums" class="vbmenu_control"><a href="$show[nojs_link]#navforums">Pick a Forum!</a> <script type="text/javascript"> vbmenu_register("navforums"); </script></td>
Then find this code:
Code:
<!-- / NAVBAR POPUP MENUS -->
And above this, add the following code:
Code:
<!-- popup navforums -->
    <div class="vbmenu_popup" id="navforums_menu" style="display:none">
        <table cellpadding="4" cellspacing="1" border="0">
            <tr><td class="thead">Quickly jump to one of the forums</td></tr>
                $navbarforum
        </table>
    </div>
    <!-- / popup navforums -->
And save the template.

===== PLUGIN =====
Create a new plugin in the global_start hook location, call it navbarforums and give it this code:
Code:
if (is_array($vbulletin->forumcache))
{
    foreach ($vbulletin->forumcache AS $forum)
    {
          if ($forum[parentid] == 7)
          {
        $navforumid = $forum[forumid];
                $navforumtitle = $forum[title]; 
                $navbarforum .= "<tr><td class=\"vbmenu_option\"><a href=\"forumdisplay.php?f=".$navforumid."\" rel=\"nofollow\">".$navforumtitle."</a></td></tr>";
          }
    }
}
else
{
       $navbarforums = $db->query_read("
        SELECT forumid, title
        FROM " . TABLE_PREFIX . "forum
        WHERE parentid = '7'
        ");

        while ($navbarresult = $db->fetch_array($navbarforums))
        {
            $navforumid = $navbarresult[forumid];
            $navforumtitle = $navbarresult[title];
            $navbarforum .= "<tr><td class=\"vbmenu_option\"><a href=\"forumdisplay.php?f=".$navforumid."\" rel=\"nofollow\">".$navforumtitle."</a></td></tr>";
        }
}
Find the if ($forum[parentid] == 7) to point to your forumid
(that means, change the 7 to your PARENT forumid, as it will get all the childforums below this parent)

And you're done.

Q : Does it list the subforums below the forums too?
A : No, only the first level forums below the parentid.

Q : My list is too long!
A : Your parentid has a lot of forums.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 12-31-2006, 03:56 AM
teeech teeech is offline
 
Join Date: Dec 2006
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any update on getting it to work on an cmps index page or what I should change in the plugin?

Very useful feature, but not so helful unless it works on my portal page. Any help is appreciated.

Also, what section of the code would be changed/repeated in the instance of multiple parent forums?
Reply With Quote
  #13  
Old 03-12-2007, 06:01 PM
4x4 Mecca 4x4 Mecca is offline
 
Join Date: Feb 2007
Posts: 396
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can't you make it list all forums? There may already be a hack for that, I'm not sure.
Reply With Quote
  #14  
Old 04-03-2007, 01:57 AM
MelH MelH is offline
 
Join Date: Feb 2007
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by teeech View Post
Any update on getting it to work on an cmps index page or what I should change in the plugin?

Very useful feature, but not so helful unless it works on my portal page. Any help is appreciated.

Also, what section of the code would be changed/repeated in the instance of multiple parent forums?
I agree, it?s a great hack but it needs to work on vBadvanced CMPS pages and show all forums, not just those in one category.

Usually with vBa CMPS the fix is to put the full url somewhere in the navbar code additions but I cant see where to do that.

Can anyone help?
Reply With Quote
  #15  
Old 04-03-2007, 02:28 AM
MelH MelH is offline
 
Join Date: Feb 2007
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Woo hoo!

I was digging around in the vBa CMPS forums and found the solution to the problem of this menu not working from their pages.

Go to Admin CP => vBa CMPS => Default Settings => Portal Output Global Variables

Add the word 'navbarforum' (without the quotes) to that setting. That just gets the drop down working.

Then, to make the links work -

In the plug in you created find the two instances of 'forumdisplay.php' and add the full url before.

This means change this:

$navbarforum .= "<tr><td class=\"vbmenu_option\"><a href=\"forumdisplay.php?f=".$navforumid."\" rel=\"nofollow\">".$navforumtitle."</a></td></tr>";

to this in two places.

$navbarforum .= "<tr><td class=\"vbmenu_option\"><a href=\"http://yourwebsite/forum/forumdisplay.php?f=".$navforumid."\" rel=\"nofollow\">".$navforumtitle."</a></td></tr>";
Reply With Quote
  #16  
Old 04-03-2007, 12:29 PM
MelH MelH is offline
 
Join Date: Feb 2007
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just edited the fix for vBadvanced CMPS in the previous post of mine. The drop down works fine now.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:28 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.07243 seconds
  • Memory Usage 2,258KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete