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


red_baron2000 06-26-2005 10:02 PM

excellent mod sir :)

thank you .

Loki12 07-13-2005 08:20 PM

It seems includes/functions_forumlist.php has changed in Beta 4... could anyone please help update this useful modification? ;)

tamarian 07-13-2005 08:46 PM

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.

Loki12 07-13-2005 09:05 PM

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;

}

tamarian 07-13-2005 09:10 PM

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.

Loki12 07-13-2005 09:27 PM

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.

slank 07-22-2005 02:30 PM

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

ConqSoft 07-30-2005 10:18 PM

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

Thanks

Boofo 07-30-2005 10:25 PM

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.

ConqSoft 07-30-2005 10:34 PM

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.

Rich 08-04-2005 08:34 PM

Hello,

Is it possible for us to make the <td> larger than what it is? I have 2 rows set, but it is cutting some of the names and starting a new line. I would prefer it didn't do that. How can this be modified so that it will allow larger forum names?

tamarian 08-04-2005 09:00 PM

You can try a nowrap attribute.

Find this:

PHP Code:

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

Replace with:


PHP Code:

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


Rich 08-04-2005 09:03 PM

Hello,

I new it was a simple edit. Thanks, it worked like a charm.

Boofo 08-04-2005 09:36 PM

Again, please make a text file for this. ;)

tamarian 08-05-2005 04:42 PM

Quote:

Originally Posted by Boofo
Again, please make a text file for this. ;)

I thought there was one alread :)

Rich 08-05-2005 06:21 PM

Hello,

Not sure if that was a joke or not, so I figured I would respond. When i downloaded it, there wasn't anything that informed to use a "noWrap" function. (I was over-thinking this to the extreme and was looking for a way to set widths. lol)

tamarian 08-05-2005 08:31 PM

Quote:

Originally Posted by iguanairs
Not sure if that was a joke or not, so I figured I would respond. When i downloaded it, there wasn't anything that informed to use a "noWrap" function. (I was over-thinking this to the extreme and was looking for a way to set widths. lol)

I think many are better off without the noWrap attribute, and it's only useful to those really need it. I don't use it, since it allows members with lower resolution to still be able to view the entire page without scrolling sideways.

Brinnie 08-10-2005 08:07 AM

Hey, was there a plug in for this?

I thought I saw another version of this, but I may be wrong.

Not that I'm implying anything, I'm just trying to figure out if there's another one, so I can make a choice.

Brinnie 08-10-2005 08:22 AM

Quote:

To install, edit the file includes/functions_forumlist.php

1. Find

PHP Code:
foreach($vbulletin->iforumcache["$parentid"] AS $forumid)
Yea, dude...
I have 2 instances of that exact code.

Replace them both?!?!?

Brinnie 08-10-2005 09:12 AM

Hi,

I applied this hack to RC2 and came out with this:

I don't know if it has anything to do with haveing multiple instnaces of that code or not, but I only replaced the first one. :)

tamarian 08-10-2005 02:43 PM

Quote:

Originally Posted by Brinnie
Hey, was there a plug in for this?

I thought I saw another version of this, but I may be wrong.

Not that I'm implying anything, I'm just trying to figure out if there's another one, so I can make a choice.

There's a template/CSS version here:

https://vborg.vbsupport.ru/showthread.php?t=91299

tamarian 08-10-2005 02:47 PM

Quote:

Originally Posted by Brinnie
Yea, dude...
I have 2 instances of that exact code.

Replace them both?!?!?

In the same file, functions_forumlist.php? There should be only one.

JirQUEST 08-16-2005 10:33 AM

Quote:

Originally Posted by Brinnie
Hi,

I applied this hack to RC2 and came out with this:

I don't know if it has anything to do with haveing multiple instnaces of that code or not, but I only replaced the first one. :)

having the same exact problem as u.

TosaInu 08-20-2005 08:44 PM

Neat.

:Judge: 10-08-2005 09:10 PM

Thank You!

I did all your adjustments and had no trouble at all.
http://www.cecilcountyx.com/forums/index.php

NxTek 10-09-2005 03:27 PM

Quote:

Originally Posted by JirQUEST
having the same exact problem as u.

I am as well with 3.5.0

tamarian 10-09-2005 03:44 PM

Quote:

Originally Posted by NxTek
I am as well with 3.5.0

Send me a PM containing your functions_forumlist.php file. There's probably and edit mistake.

Mr Chad 10-09-2005 04:31 PM

nice, i needed this.

vibe 10-10-2005 03:08 AM

looking nice... installed

NxTek 10-12-2005 04:03 PM

Quote:

Originally Posted by tamarian
Send me a PM containing your functions_forumlist.php file. There's probably and edit mistake.

Will do. Thanks.


All times are GMT. The time now is 04:50 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.02231 seconds
  • Memory Usage 1,853KB
  • 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
  • (8)bbcode_php_printable
  • (17)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
  • (40)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