vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Arrange Sub-Forums in columns (https://vborg.vbsupport.ru/showthread.php?t=82845)

tamarian 06-09-2005 10:00 PM

Arrange Sub-Forums in columns
 
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.

eXtremeTim 06-10-2005 05:32 PM

Good work. I might play with it later.

alderwazeh 06-10-2005 06:32 PM

very nice idea and end product but I didnt found the codes you mentioned in this template ?! May be it is for VB3.0.5 only since I am running 3.0.7 ? I dont know but i wish i could install that hack in any event

tamarian 06-10-2005 06:42 PM

Quote:

Originally Posted by alderwazeh
very nice idea and end product but I didnt found the codes you mentioned in this template ?! May be it is for VB3.0.5 only since I am running 3.0.7 ? I dont know but i wish i could install that hack in any event

This is for vB 3.5. You can get the 3.0.7 version from here:

https://vborg.vbsupport.ru/showthrea...threadid=63498

Erwin 06-10-2005 10:45 PM

Good job. :)

TCattitude 06-10-2005 11:33 PM

Nice!
This is a great mod for vb, any version.
Thanks :)

Neutral Singh 06-11-2005 08:20 AM

** Aman Clicks Installed **

Excellent !! :) This will, perhaps, be the first modification in my forums, once the stable vB 3.5.0 is released. :) This mod should always have been a default option in vBulletin... makes the look of the forum so much professional and presentable.

Kudos, for sharing it first thing up !!

Snake 06-26-2005 11:21 AM

That is sweet. Thank you.

taffy056 06-26-2005 09:46 PM

Hi,

Thanks for sharing this hack :) One question about it though, how do I get the subforum list to show on 3 lines instead of two?

taffy

tamarian 06-26-2005 09:50 PM

Quote:

Originally Posted by taffy056
Hi,

Thanks for sharing this hack :) One question about it though, how do I get the subforum list to show on 3 lines instead of two?

taffy

edit this line:
PHP Code:

if ($cols==3

to:
PHP Code:

if ($cols==4



All times are GMT. The time now is 03:22 AM.

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.01122 seconds
  • Memory Usage 1,765KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (6)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete