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

Reply
 
Thread Tools
Arrange Sub-Forums in columns Details »»
Arrange Sub-Forums in columns
Version: 1.00, by tamarian tamarian is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.5.1 Rating:
Released: 06-09-2005 Last Update: 08-04-2005 Installs: 122
Template Edits
Code Changes  
No support by the author.

Better alternatives to this hack:
Quote:
3.6 plugin version by Cybernetec with more options:
https://vborg.vbsupport.ru/showthread.php?t=122996

3.5 plugin version by Atakan KOC: https://vborg.vbsupport.ru/showthread.php?t=118935

CSS/templates version by hpwilhelm:
https://vborg.vbsupport.ru/showthread.php?t=91299
Ported from 3.0.x.

What it does
This hack arranges sub-forums on the forum home into 2 columns, makeing large lists of sub-forums more presentable. You can see the before/after in the screenshots attached

Note:
1. You need to enable sub-forum display on the forum home from your vB admin panel
2. This hack is for the forum home page, not forum display.


To enable sub-forums on the forum home page
1. Go to your forum Admin panel
2. Click vBulletin Options
3. Select "Forum Listings Display Options" from the drop down list
4. In "Depth of Sub-Forums" replace 0 with 1

Installation
To install, edit the file includes/functions_forumlist.php

1. Find (there are two slightly different lines, differing by a space, the one in question is around line 552)

PHP Code:
    if (!isset($vbulletin->iforumcache["$parentid"]))
    {
        return 
$output;
    } 
Place this code below it:

PHP Code:
 $output .= "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" ><tr valign=\"top\"> ";
      
$cols 0
2. Find
PHP Code:
            if (!empty($output))
            {
                
$subforum $splitter["$canpost"] . $subforum;
            }
            if (
$depth $vbulletin->options['subforumdepth'])
            {
                
$output .= construct_subforum_bit($forumid$cancontainthreads$subforum$depthmark '--'$depth 1);
            }
        }
    }

    return 
$output;


Replace with
PHP Code:
                        //sub-forum hack
            
if ($depth $vbulletin->options['subforumdepth'])
                        {
                                
$cols++;
                                if (
$cols==3)
                                        {
                                        
$cols 1;
                                        
$output .=  "</tr><tr>";
                                        }

                        
$output .= '<td width="50%">' construct_subforum_bit($forumid$cancontainthreads$subforum$depthmark '--'$depth 1) . "</td>";
                        }
        }
    }

        if (
$cols ==1$output.="<td>&nbsp;</td></tr></table>";
    else 
$output.="</tr></table>";

        return 
$output;

}
//end hack 
Template modification (optional)
As this hack will list the sub-forums in a table, the font used is not effected by the <div> tag for subforums, which will cause the default font to be used instead of smallfont.

To use smallfont for sub-forum names, edit the "forumhome_subforumbit_post"

Change (this is the whole template)
Code:
 <img class="inlineimg" src="$stylevar[imgdir_statusicon]/subforum_$forum[statusicon].gif" alt="" /> <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
To:
Code:
 <img class="inlineimg" src="$stylevar[imgdir_statusicon]/subforum_$forum[statusicon].gif" alt="" /> <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><span class="smallfont">$forum[title]</span></a>

And for those who want to edit or remove the "Sub-forum" word, just remove (or edit, if you just want to change it) "<strong>$vbphrase[subforums]</strong>:" from the "forumhome_forumbit_level2_post" template.

handling of sub-forums.

Show Your Support

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

Comments
  #12  
Old 06-26-2005, 10:02 PM
red_baron2000's Avatar
red_baron2000 red_baron2000 is offline
 
Join Date: Jul 2002
Location: EU
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

excellent mod sir

thank you .
Reply With Quote
  #13  
Old 07-13-2005, 08:20 PM
Loki12 Loki12 is offline
 
Join Date: Jul 2004
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems includes/functions_forumlist.php has changed in Beta 4... could anyone please help update this useful modification?
Reply With Quote
  #14  
Old 07-13-2005, 08:46 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Loki12
It seems includes/functions_forumlist.php has changed in Beta 4... could anyone please help update this useful modification?
The file itself has changed, but not the portions involved. Steps 1 and 2 will be the same.
Reply With Quote
  #15  
Old 07-13-2005, 09:05 PM
Loki12 Loki12 is offline
 
Join Date: Jul 2004
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tamarian
The file itself has changed, but not the portions involved. Steps 1 and 2 will be the same.
I can't find this in the new file:

Quote:
if (!empty($output))
{
$subforum = $splitter["$canpost"] . $subforum;
}
if ($depth < $vbulletin->options['subforumdepth'])
{
$output .= construct_subforum_bit($forumid, $cancontainthreads, $subforum, $depthmark . '--', $depth + 1);
}
}
}

return $output;

}
Reply With Quote
  #16  
Old 07-13-2005, 09:10 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Loki12
I can't find this in the new file:
Should be there around line 561

If you're using the editor's search function, try looking for the first line, some times the tabs and white space effect the results for mult-line search.
Reply With Quote
  #17  
Old 07-13-2005, 09:27 PM
Loki12 Loki12 is offline
 
Join Date: Jul 2004
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tamarian
Should be there around line 561

If you're using the editor's search function, try looking for the first line, some times the tabs and white space effect the results for mult-line search.
Thanks, you're right! I edited instead with Wordpad, which worked better.
Reply With Quote
  #18  
Old 07-22-2005, 02:30 PM
slank slank is offline
 
Join Date: May 2005
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

am gonna do this right now, had it for 3.0.7 and loved it, now will try it out on 3.5.4 cheers
Reply With Quote
  #19  
Old 07-30-2005, 10:18 PM
ConqSoft's Avatar
ConqSoft ConqSoft is offline
 
Join Date: Jul 2003
Location: Raleigh, NC
Posts: 686
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice. This should definately be in vBulletin as default.

Thanks
Reply With Quote
  #20  
Old 07-30-2005, 10:25 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please make a text file for this so others can download and have it in case of an upgrade or re-install.

And is there any way to set it to how many subforum columns you want? I tried this mod and it looked really bad as I had some long subforum names and it went to 3 columns that were not spaced apart evenly.
Reply With Quote
  #21  
Old 07-30-2005, 10:34 PM
ConqSoft's Avatar
ConqSoft ConqSoft is offline
 
Join Date: Jul 2003
Location: Raleigh, NC
Posts: 686
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To change the number of columns, you should be able to just change this line:

if ($cols==3)

Change it to 2 for 1 column. 3 for 1 columns. 4 for 3 columns. Etc.
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 02: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.65208 seconds
  • Memory Usage 2,328KB
  • 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
  • (4)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