Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

Reply
 
Thread Tools
Forum Jump In Navbar Details »»
Forum Jump In Navbar
Version: 1.00, by P1erce P1erce is offline
Developer Last Online: Feb 2014 Show Printable Version Email this Page

Category: Mini Mods - Version: 3.6.7 Rating:
Released: 07-03-2007 Last Update: Never Installs: 24
Re-useable Code  
No support by the author.

Okay a few notes first.

A. I wont support this software
B. I dont plan to improve it unless I have a requirement to do so personally for www.minimins.com
C. If you want to modify it, change it, make it something like DigitalPoint.com drop down, and charge for the modification be my guest, ill even pay for it
D. Thanks to the original idea at http://forums.digitalpoint.com
E. I dont know how to make a plugin so dont say anything about it not being a plugin.
F. It wont work as guest on my forum for SEO reasons. But please dont register on my forum just to see it in action, the screenshot says it all.
G. Dont complaine about my code, it works, but I accept it may not be the best way to do this.
H. Its the code for the Forum Jump menu, so its dynamic. If you have admin forums thoes who can see thoes forums will be able to see it in the jump menu, thoes who dont, wont simple

So, right, theres various other attempts at making this dropdown but to be honest they were not adequait. As such I spent 4/5 hours making my own one from the Forum Jump menu function.

The code!

1. Plugin Mangager
2. Add New Plugin

hook location : global
name : whatever, i called it "navbar jump menu"

This is the code:

PHP Code:
//copyright MiniMins.com
function construct_jump2($parentid = -1$addbox true$prependchars ''$permission '')
{    
    global 
$vbulletin$optionselected$usecategories$jumpforumid$jumpforumtitle$jumpforumbits$curforumid$daysprune$jumpforumbits2;
    global 
$stylevar$vbphrase$defaultselected$forumjump$selectedone;
    global 
$frmjmpsel// allows context sensitivity for non-forum areas
    
global $gobutton;
    static 
$complete false;
    

    if (
$complete OR !$vbulletin->options['useforumjump'] OR !($vbulletin->userinfo['permissions']['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']))
    {
        return;
    }

    if (empty(
$vbulletin->iforumcache))
    {
        
// get the vbulletin->iforumcache, as we use it all over the place, not just for forumjump
        
cache_ordered_forums(01);
    }
    if (empty(
$vbulletin->iforumcache["$parentid"]) OR !is_array($vbulletin->iforumcache["$parentid"]))
    {
        return;
    }

    foreach(
$vbulletin->iforumcache["$parentid"] AS $forumid)
    {
        
$forumperms $vbulletin->userinfo['forumpermissions']["$forumid"];
        
#if ((!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums']) OR !($vbulletin->forumcache["$forumid"]['options'] & $vbulletin->bf_misc_forumoptions['showonforumjump']) OR !$vbulletin->forumcache["$forumid"]['displayorder'] OR !($vbulletin->forumcache["$forumid"]['options'] & $vbulletin->bf_misc_forumoptions['active']))
        
if ((!($forumperms $vbulletin->bf_ugp_forumpermissions['canview']) AND ($vbulletin->forumcache["$forumid"]['showprivate'] == OR (!$vbulletin->forumcache["$forumid"]['showprivate'] AND !$vbulletin->options['showprivateforums']))) OR !($vbulletin->forumcache["$forumid"]['options'] & $vbulletin->bf_misc_forumoptions['showonforumjump']) OR !$vbulletin->forumcache["$forumid"]['displayorder'] OR !($vbulletin->forumcache["$forumid"]['options'] & $vbulletin->bf_misc_forumoptions['active']))
        {
            continue;
        }
        else
        {
            
// set $forum from the $vbulletin->forumcache
            
$forum $vbulletin->forumcache["$forumid"];

            
$optionvalue $forumid;
            
$optiontitle $prependchars $forum[title_clean]";

            
$optionclass 'fjdpth' iif($forum['depth'] > 44$forum['depth']);

            if (
$curforumid == $optionvalue)
            {
                
$optionselected 'selected="selected"';
                
$optionclass 'fjsel';
                
$selectedone 1;
            }
            else
            {
                
$optionselected '';
            }

            
//eval('$jumpforumbits2 .= "' . fetch_template('option') . '";');
            //$jumpforumbits2 .= 
            
$jumpforumbits2[$optionvalue] .= "<a href=\"forumdisplay.php?f=".$forumid."\">".$optiontitle."</a>";
            
construct_jump2($optionvalue0$prependchars FORUM_PREPEND$forumperms);
            

        } 
// if can view
    
// end foreach ($vbulletin->iforumcache[$parentid] AS $forumid)

}

function 
jumpforumbits2html()
{
    global 
$jumpforumbits2;
    
    
$forumNavJumpMenu "<div class=\"vbmenu_popup\" id=\"navbar_forumjump_menu\" style=\"display:none; position:absolute; padding: 0px;\">\n";
    
$forumNavJumpMenu .= "\t<table cellpadding=\"4\" cellspacing=\"1\" border=\"0\">\n";
    
$forumNavJumpMenu .= "\t\t<tr><td class=\"tcat\" colspan=\"6\" style=\"padding: 4px\">Forums</td></tr>\n";
    
$forumNavJumpMenu .= "\t\t<tr class=\"fjump\">\n";
    
$forumNavJumpMenu .= "\t\t\t<td valign=\"top\">\n";
    
    
$start true;
    
    foreach(
$jumpforumbits2 AS $bit)
    {
        
$canArray explode("&nbsp;",$bit);
        if(
$canArray[1] != " ")
        {
            
//this is the table heading!
            //end previous table
            
if(!$start)
            {
                                                
//uncomment if you want multiple columns
                //$forumNavJumpMenu .= "\t\t\t\t</table>\n";
                //$forumNavJumpMenu .= "\t\t\t</td>\n";
                //$forumNavJumpMenu .= "\t\t\t<td valign=\"top\">\n";
            
}
            
//start table - uncomment the next 2 lines if you want.. multiple columns rather than 1 solid column
            //$forumNavJumpMenu .= "\t\t\t\t<table cellpadding=\"2\" style=\"border-bottom:1px solid #fff; border-collapse: collapse; padding:1px;\">\n";
            //$forumNavJumpMenu .= "\t\t\t\t<table cellpadding=\"0\" cellspacing=\"1\" border=\"0\">";
            //start header
            
$forumNavJumpMenu .= "\t\t\t\t\t<tr><td class=\"thead\">".$bit."</td></tr>\n";
        }
        else
        {
            
//just a normal heading
            
$forumNavJumpMenu .= "\t\t\t\t\t<tr><td class=\"vbmenu_option\">".$bit."</td></tr>\n";
        
        }
        
        
$start false;
    }
    
    
//end tables
    
$forumNavJumpMenu .= "\t\t\t\t</table>\n";
    
$forumNavJumpMenu .= "\t\t\t</td>\n";
    
$forumNavJumpMenu .= "\t\t</tr>\n";
    
$forumNavJumpMenu .= "\t</table>\n";
    
$forumNavJumpMenu .= "</div>";
    
    return 
$forumNavJumpMenu;
    
}
$forumNavJumpList construct_jump2();

$forumNavJumpMenujumpforumbits2html(); 
Now, heres the code for the navbar, place it where you want the dropdown.

Code:
<td id="navbar_forumjump" class="vbmenu_control"><a href="$show[nojs_link]#forumjump" accesskey="j">Forum Jump</a> <script type="text/javascript"> vbmenu_register("navbar_forumjump"); </script></td>
And place this before <!-- / PAGENAV POPUP -->

Code:
<!-- Forum Jump -->
$forumNavJumpMenu
<!-- /ForumJump -->
So you can format the HTML to change the format from single column to multi column. Just uncomment the lines required. (see the comments in the source). I used a single column because I have too many sub forums and I didnt want to negoicate on the size of the text and it was going off the screen, so a single column was better suited to my needs.

If you have any general questions about the code Ill try and help. But the one part and dont ask me, is the recursvie function in construct_jump2 I barely understand it myself.

Enjoy

Show Your Support

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

Comments
  #22  
Old 07-30-2007, 02:34 PM
voter's Avatar
voter voter is offline
 
Join Date: Dec 2006
Posts: 192
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SkyCatcher View Post
I took a look at it and made you a nice little product file. The code is unchanged from what you've posted. Users still need to make the 2 template edits.

I played with this for about an hour coming up with a simple if($i = 6) {$pagenavthingy .="<br />";} but it doesn't work that way :/

The way the HTML is coded, it will count the categories and forums as the same thing so:

Lobby (Category)
Forum1
Forum2

That would be 3 loops instead of 1

Which means it needs an extra check... if act as forum = 0 then counter+1.. then when counter = 6, throw in a <br /> and reset to 0. Then clean up the html code and you should be on your way if you care to make it resemble the other site.


Edit: Good lord my spelling is off!
Thanks for product xml.
Reply With Quote
  #23  
Old 07-30-2007, 03:30 PM
voter's Avatar
voter voter is offline
 
Join Date: Dec 2006
Posts: 192
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anybody idea - how to make the multicolumn version fluid - such that it not extend the width of used style? Or at least limit the number of columns to 4 at each row.
At forum.viparmenia.com/vb it is terrible, when table extended the width and one need horizontal scrolling
Reply With Quote
  #24  
Old 07-30-2007, 03:51 PM
voter's Avatar
voter voter is offline
 
Join Date: Dec 2006
Posts: 192
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To make it compatible with vbadvanced find in plugin code( AdminCP-> Plugins & Products -> Plugin Manager -> ForumJump (if you used productxml from SkyCatcher or the name you give to plugin)
Quote:
$jumpforumbits2[$optionvalue] .= "<a href=\"forumdisplay.php?f=".$forumid."\">".$option title."</a>";
and put {$vbulletin->options['bburl']}/ before forumdisplay.php
Quote:
$jumpforumbits2[$optionvalue] .= "<a href=\"{$vbulletin->options['bburl']}/forumdisplay.php?f=".$forumid."\">".$optiontitle." </a>";
Reply With Quote
  #25  
Old 08-07-2007, 05:01 PM
Ratman2050 Ratman2050 is offline
 
Join Date: Jul 2007
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not that good at coding, where exactly do I put the code in the navbar template if I want it right before the User CP??
Reply With Quote
  #26  
Old 08-07-2007, 06:06 PM
P1erce P1erce is offline
 
Join Date: Aug 2006
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by voter View Post
Anybody idea - how to make the multicolumn version fluid - such that it not extend the width of used style? Or at least limit the number of columns to 4 at each row.
At forum.viparmenia.com/vb it is terrible, when table extended the width and one need horizontal scrolling
I looked into it, but it drove me nuts, so i was happy with a single column.

Pierce
Reply With Quote
  #27  
Old 08-08-2007, 07:59 AM
voter's Avatar
voter voter is offline
 
Join Date: Dec 2006
Posts: 192
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by P1erce View Post
I looked into it, but it drove me nuts, so i was happy with a single column.

Pierce
Sure single column looks better.
But it would be nice to have multicolums version such that one can limt the colums say 4 and then next 4 starts from a new row.

The php script must put <tr> somehow checking by "if" do one reach the wished number of colums or better do one reach the WIDTH of window, to escape appearance of horizontal scrolling.

Multicolum and multirow -
Reply With Quote
  #28  
Old 08-08-2007, 08:11 AM
raiderlax's Avatar
raiderlax raiderlax is offline
 
Join Date: Sep 2006
Location: Ontario, Canada
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by voter View Post
Sure single column looks better.
But it would be nice to have multicolums version such that one can limt the colums say 4 and then next 4 starts from a new row.

The php script must put <tr> somehow checking by "if" do one reach the wished number of colums or better do one reach the WIDTH of window, to escape appearance of horizontal scrolling.

Multicolum and multirow -
Second that
Reply With Quote
  #29  
Old 08-08-2007, 02:24 PM
P1erce P1erce is offline
 
Join Date: Aug 2006
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It wouldnt be that hard.

Just add a counter outside the foreach,

and then an if statment, if($counter == 4)

before the two lines that append the bottom of a table, if its 4, you want end of table, else you want to end the column.

I am not going to add it because I would have to test it, and as I said I am happy with the script and felt like sharing it

Pierce
Reply With Quote
  #30  
Old 09-09-2007, 05:42 AM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A previous post that has instructions to get this to work with vbadvanced does not work for me. The menu will not pop open!

I got it to work with vBadvanced this way: In your vBa CMPS go to: Default Settings>Main Options >Portal Output Global Variables. In that box you must add: forumNavJumpMenu

Then the popup for the jump menu will work on your vBadvanced CMPS v3.0 RC1.

I am on vb3.6.4 and this works great now.

Then I noticed in my Links (vBadvanced Links Directory v2.0.1) the jump menu urls were wrong so I just hard coded the url to my forumdisplay.php in the product like this on line #75:

$jumpforumbits2[$optionvalue] .= "<a href=\"http://www.your.domain.com/forum/forumdisplay.php?f=".$forumid."\">".$optiontitle." </a>";

Just replace: http://www.your.domain.com/forum/ with your correct path.

All fixed!
Reply With Quote
  #31  
Old 11-07-2008, 08:42 PM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

would be great to have this working the best it could possibly be for when vb 3.8 goes gold. and to have it also have multiple columns would be ideal. Anyone?
Reply With Quote
Reply

Thread Tools

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 03:23 PM.


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.04956 seconds
  • Memory Usage 2,364KB
  • Queries Executed 25 (?)
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
  • (2)bbcode_code
  • (1)bbcode_php
  • (6)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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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