vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Arrange Sub-Forums in columns (https://vborg.vbsupport.ru/showthread.php?t=63498)

tamarian 04-04-2004 10:00 PM

Arrange Sub-Forums in columns
 
There's also a vB 3.5 version here: https://vborg.vbsupport.ru/showthrea...threadid=82845

What it does
This hack arranges sub-forums on the forum home into 2 (or more) columns, makeing large lists of sub-forums more presentable. You can see it in action on my forums here:

Demo
http://forum.lowcarber.org

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 functions_forumlist.php (in the includes directory)

1. Find

PHP Code:

      foreach($vbulletin->iforumcache["$parentid"] AS $forumid

Place this code above it:

PHP Code:

$output .= "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" ><tr valign=\"top\"> ";
      
$cols 0

2. Find
PHP Code:

            eval('$subforum = "' fetch_template("forumhome_subforumbit_$canpost") . '";');
            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:

            eval('$subforum = "' fetch_template("forumhome_subforumbit_$canpost") . '";');
                    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;



To put them in 3 columns, instead of t2, just edit this line "if ($cols==3)" to "if ($cols==4)" and change this line:

PHP Code:

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

To this:
PHP Code:

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

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

Screen shots, before/after

diettalk 04-05-2004 09:36 PM

Works great.. thanks.

Tradjick 04-05-2004 10:10 PM

Excellent superb idea! :)
Would it be possible to determine the screen resolution from the visitor? Depending on whether to display the subforums the default or your hacked way??? I could need this because I have 7 subforums including 70 sub-sub forums.

Vb-Hispano 04-05-2004 11:19 PM

nice idea ;)

thanks good job

INSTALLED

sabret00the 04-05-2004 11:40 PM

screenshot?

Fi_InCogNiTo 04-05-2004 11:47 PM

I made the changes, but nothing happens. It doesn't arrange my forums in sub-columns like on your site=\

It just looks the same as standard vB3 subforums.

I'm 100% sure I made the changes correctly.

EDIT: Maybe this conflicts with the category image or the Forums arranged in columns on forumhome hacks?

tamarian 04-05-2004 11:51 PM

Quote:

Originally Posted by sabret00the
screenshot?

http://forum.lowcarber.org/

tamarian 04-05-2004 11:55 PM

Quote:

Originally Posted by Fi_InCogNiTo
I made the changes, but nothing happens. It doesn't arrange my forums in sub-columns like on your site=\

It just looks the same as standard vB3 subforums.

I'm 100% sure I made the changes correctly.

Hmm, that's weird. Are you sure you saved your changes? Refreshed the page?

Fi_InCogNiTo 04-05-2004 11:56 PM

Sorry, edited the post... look again =D

Here is what that hack changed.. (attached)

Itworx4me 04-06-2004 12:01 AM

Quote:

Originally Posted by Fi_InCogNiTo
Sorry, edited the post... look again =D

Here is what that hack changed.. (attached)

Just an FYI

This hack that you have here isn't for this one in this thread. They are two separate hacks.

Fi_InCogNiTo 04-06-2004 12:03 AM

I know they are 2 seperate hacks. Im asking if it will conflict with this hack because I have both installed and this is not working for me ;)

tamarian 04-06-2004 12:09 AM

Quote:

Originally Posted by Fi_InCogNiTo
Sorry, edited the post... look again =D

Here is what that hack changed.. (attached)

That might be it, I don't have those other hacks installed.

I haven't checked in details the code for the other hack, but they do seem incompatible, as one lists the forums as columns, and this one lists the sub-forums as columns. Having both working together may make it look quite confusing, as it would be hard to tell, which is a forum, and which is a sub-forum :)

Fi_InCogNiTo 04-06-2004 12:12 AM

OK, thanks for the reply =D

Nice hack btw

/me wishes he could install

Buczilla 04-06-2004 12:21 AM

Nice work :)

sabret00the 04-06-2004 12:22 AM

Quote:

Originally Posted by tamarian

ooooh good thing i saw that, i thought this was xenons hack but for forumdisplay rather than forumhome

Itworx4me 04-06-2004 12:38 AM

anyway to make this hack selectable in the forum setup? I don' t want all my sub forums showing on the forumhome. Would be nice to have a option to choose if you can select which forums this will work in.

Red Blaze 04-06-2004 01:14 AM

I honestly see no changes and I don't have that hack Fi_InCogNiTo has. Am I missing something?

tamarian 04-06-2004 01:41 AM

Quote:

Originally Posted by Sonikku
I honestly see no changes and I don't have that hack Fi_InCogNiTo has. Am I missing something?

If you tried it on the forum in your profile, I think the problem is that you need to enable display of sub-forums from your admin panel :)

Red Blaze 04-06-2004 01:58 AM

Do you mean this only affects forum home (index page)? If that's the case then I don't really need this. lol

But a good one for those that do have subs in forum home. :)

tamarian 04-06-2004 02:06 AM

Quote:

Originally Posted by Sonikku
Do you mean this only affects forum home (index page)? If that's the case then I don't really need this. lol

Yes :)

Floris 04-06-2004 08:22 AM

Once we apply the update further on this year on vbulletin.nl THIS will be one of the few hacks we WILL install most likely. It helps us organize quite a lot!! This looks amazing.

My absolute goal is to have a icon that reads subs.. and when pressed on has a drop down like in the postbit for username, for subforums (if any).

joeychgo 04-06-2004 09:01 AM

did do anything!!!!!!

Im lost. Im sre I did as you instructed -- I have attached the file you said to edit, maybe you can see something I cant, im still very new at this...

surfhog 04-06-2004 01:52 PM

yup I tried this as well and did not work for me either.

joeychgo 04-06-2004 11:23 PM

any ideas on what the problem is?

tamarian 04-06-2004 11:54 PM

Quote:

Originally Posted by joeychgo
any ideas on what the problem is?

I think the problem is that you don't have sub-forum display enabled on your forum home.

There seem to be a misunderstanding that this hack is for forum display, but it is for forum home. If you do not display sub-forums on the forum home, then this hack won't work.

I'll add a comment to the first post, to make this clear.

joeychgo 04-07-2004 12:52 AM

Are you saying it not working cause I have a VBA homepage?
-- If so, isnt there a simple way to alter it?

tamarian 04-07-2004 01:01 AM

Quote:

Originally Posted by joeychgo
Are you saying it not working cause I have a VBA homepage?
-- If so, isnt there a simple way to alter it?

No, what I'm saying is that you have sub-forum listing disabled in your control panel.

You just need to enable it, to see the sub-forums in columns on the forum homepage. :)

joeychgo 04-07-2004 01:03 AM

OK -- cool, now how do I do that? Im a newbie remember... :)

tamarian 04-07-2004 01:16 AM

Quote:

Originally Posted by joeychgo
OK -- cool, now how do I do that? Im a newbie remember... :)

1. Go the 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
Save, and you should be set.

Fi_InCogNiTo 04-08-2004 02:38 AM

Hey, once I changed the options like you said, it works now. Thanks a bunch ;)

Nj?rd Eriksson 04-08-2004 06:46 AM

Awesome. Works great for me. Thanks for this one.

Nj?rd Eriksson 04-08-2004 07:13 AM

@tamarian:

Okay, for some or other reason the subforums don't align nicely when the forum description doesn't fill a whole line (it seems to work on your site, though.)

What could the issue be? Do you have a fix for this?

GamerJunk.net 04-08-2004 12:39 PM

Awesome hack I love it!

tamarian 04-08-2004 10:23 PM

Quote:

Originally Posted by Nj?rd Eriksson
@tamarian:

Okay, for some or other reason the subforums don't align nicely when the forum description doesn't fill a whole line (it seems to work on your site, though.)

What could the issue be? Do you have a fix for this?

Yes, it looks like some HTML is messed up. Click on view source, and see where the width is getting screwd up. This hack essentially adds 2 TD's of 50% width each.

tamarian 04-09-2004 09:42 PM

I just added a little note on how to fix the font size for sub-forums. A minor template edit.

draculanowaday 04-10-2004 04:27 AM

thanks
/me installed

obsidian 04-26-2004 02:36 PM

Whats the easiest way to remove the "Sub-Forums:" text. I am trying to remove some of the vertical space that each forum takes up and that is unnecessary in my opinion. I can not seem to find where it comes from though :)

tamarian 04-26-2004 02:54 PM

Quote:

Originally Posted by obsidian
Whats the easiest way to remove the "Sub-Forums:" text. I am trying to remove some of the vertical space that each forum takes up and that is unnecessary in my opinion. I can not seem to find where it comes from though :)


Remove "<strong>$vbphrase[subforums]</strong>:" from the "forumhome_forumbit_level2_post" template

obsidian 04-26-2004 03:35 PM

Great hack....Thanks for the help

ph03nIX 04-29-2004 10:58 PM

Hi!
I was in the middle of installing it when I came across a problem. For some reason CuteHTML cannot find this code:

PHP Code:

eval('$subforum = "' fetch_template("forumhome_subforumbit_$canpost") . '";'); 
                if (!empty(
$output)) 
                { 
                    
$subforum $splitter["$canpost"] . $subforum
                } 
                if (
$depth $vboptions['subforumdepth']) 
                { 
                    
$output .= construct_subforum_bit($forumid$cancontainthreads$subforum$depthmark '--'$depth 1); 
                } 
            } 
        } 
    } 

    return 
$output



What could be the reason for this? It had never had a problem before finding code that was there. Has the code changed or something?

Thanks :)


All times are GMT. The time now is 05:56 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.01355 seconds
  • Memory Usage 1,862KB
  • 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
  • (7)bbcode_php_printable
  • (12)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