Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-10-2013, 11:22 AM
Pieper Pieper is offline
 
Join Date: Dec 2012
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Hide specific subforums on forumhome

Hello,

Can't seem to find the right conditionals for hiding specific subforums ( not all). I want to hide it only on the forumhome and not one click down.

I add '<vb:if condition="!in_array($forumid, array(X))">' ( where X is the forumID) at the top of the forumhome_forumbit_level2_post template en close the template with '</vb:if>'

When I use the forumID from 'Test' (see screenshot)it's hiding correct. I can add several forumID's( separating them with commas). They are all hiding correct.

The problem is when I use a forumID from Test1, Test2 etc they are not hiding.

I'm pretty much a noob when it comes to conditionals so I hope someone can help me with this.

It's on VB 4.2.1

Thanks!
Attached Images
File Type: jpg screenshot.jpg (40.5 KB, 0 views)
Reply With Quote
  #2  
Old 11-10-2013, 12:18 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is untested, but it should work in theory.

In the template forumhome_forumbit_level2_post look for this code:
Code:
                     <vb:if condition="$show['subforums']">
                        <div class="subforums">
                            <h4 class="subforumlistlabel">{vb:rawphrase subforums}:</h4>
                            <ol class="subforumlist commalist">
                                {vb:raw forum.subforums}
                            </ol>
                        </div>
                    </vb:if>
And change it to this:
Code:
                     <vb:if condition="$show['subforums'] AND !in_array($forum['forumid'],array(1,2,3,))">
                        <div class="subforums">
                            <h4 class="subforumlistlabel">{vb:rawphrase subforums}:</h4>
                            <ol class="subforumlist commalist">
                                {vb:raw forum.subforums}
                            </ol>
                        </div>
                    </vb:if>
Change the ID's 1,2,3 to your forums.
Reply With Quote
  #3  
Old 11-10-2013, 12:27 PM
Pieper Pieper is offline
 
Join Date: Dec 2012
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you Ozzy

The problem with the solution you posted is that the code below is not in the forumhome_forumbit_level2_post template.

<vb:if condition="$show['subforums']">
<div class="subforums">
<h4 class="subforumlistlabel">{vb:rawphrase subforums}:</h4>
<ol class="subforumlist commalist">
{vb:raw forum.subforums}
</ol>
</div>
</vb:if>

The only thing with the condition 'subforums' is:

</vb:if>

<vb:if condition="$show['subforums']">

{vb:raw forum.subforums}
Reply With Quote
  #4  
Old 11-10-2013, 12:49 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Strange, but none the less change this line:
Code:
<vb:if condition="$show['subforums']">
To this:
Code:
<vb:if condition="$show['subforums'] AND !in_array($forum['forumid'],array(1,2,3,))">
Reply With Quote
Благодарность от:
Pieper
  #5  
Old 11-10-2013, 01:04 PM
Pieper Pieper is offline
 
Join Date: Dec 2012
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great!

When I change that code and use the Test forumID the subs are gone on the forumhome!

Thank you again Ozzy!
Reply With Quote
Благодарность от:
ozzy47
  #6  
Old 11-10-2013, 01:05 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not a problem, glad to help.
Reply With Quote
Reply


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 01:01 AM.


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.05334 seconds
  • Memory Usage 2,238KB
  • Queries Executed 14 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (2)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (1)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete