Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

Reply
 
Thread Tools
Show/Hide Subforums Details »»
Show/Hide Subforums
Version: 1.00, by ramesh_umk3 ramesh_umk3 is offline
Developer Last Online: Jan 2023 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.x.x Rating:
Released: 11-19-2013 Last Update: Never Installs: 14
Template Edits
 
No support by the author.

Show/Hide Subforums & Save Page Load Time...!

Hello All,
Hope this mod is not present already and this mod will be useful to save page load time for busy/huge forums like ours.

Lets Start

GOTO --> Style Manager --> forumhome_forumbit_level1_post

Find:
Code:
{vb:raw forum.subforums}
Replace:
Code:
<div class="divspoiler">
<input type="button" class="mc" value="→ MORE SUBFORUMS" onclick="if (this.parentNode.nextSibling.childNodes[0].style.display != '') { this.parentNode.nextSibling.childNodes[0].style.display = ''; this.value = '↑ HIDE SUBFORUMS'; } else { this.parentNode.nextSibling.childNodes[0].style.display = 'none'; this.value = '↓ SHOW SUBFORUMS'; }" />
</div><div><div class="spoiler" style="display: none;">
                        
<div style="padding:1px;">{vb:raw forum.subforums}</div>

</div></div>


Button Style CSS: [Add below code any were in additional.css template]

Code:
.mc {
display: inline-block;
margin-top: 8px;
background: #f9f9f9;
background: -moz-linear-gradient(top,#f9f9f9 0,#eaeaea 100%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#f9f9f9),color-stop(100%,#eaeaea));
background: -webkit-linear-gradient(top,#f9f9f9 0,#eaeaea 100%);
background: -o-linear-gradient(top,#f9f9f9 0,#eaeaea 100%);
background: -ms-linear-gradient(top,#f9f9f9 0,#eaeaea 100%);
background: linear-gradient(top,#f9f9f9 0,#eaeaea 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#F9F9F9',endColorstr='#EAEAEA',GradientType=0);
height: auto;
border: 1px solid #cacaca;
border-radius: 3px;
padding: 7px;
text-align: left;
line-height: 23px;
box-shadow: inset 0 1px 2px white,0px 1px 1px rgba(0,0,0,0.12);
padding-left: 9px;
font-weight: bold;
text-transform: uppercase;
color: #6f6f6f;
text-shadow: 0 1px white;
margin-top: 10px;
cursor:pointer;
     -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    -khtml-border-radius: 5px;
    border-radius: 5px;
}

.mc:hover {
    background: #fefefe;
    background: -moz-linear-gradient(top, #fefefe 0, #fbfbfb 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fefefe), color-stop(100%, #fbfbfb));
    background: -webkit-linear-gradient(top, #fefefe 0, #fbfbfb 100%);
    background: -o-linear-gradient(top, #fefefe 0, #fbfbfb 100%);
    background: -ms-linear-gradient(top, #fefefe 0, #fbfbfb 100%);
    background: linear-gradient(top, #fefefe 0, #fbfbfb 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FEFEFE', endColorstr='#FBFBFB', GradientType=0);
}
.mc:active {
    box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.40), 0px 1px 1px rgba(0, 0, 0, 0.12);
}
Also follow same procedure in forumhome_forumbit_level2_post template

LIVE DEMO

Thanks All

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
sodasusu

Comments
  #12  
Old 11-26-2013, 06:20 PM
faisaly.com faisaly.com is offline
 
Join Date: Mar 2007
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This works great using vb4.2.0

no problems at all!
Reply With Quote
2 благодарности(ей) от:
mohammed146, ramesh_umk3
  #13  
Old 12-13-2013, 04:45 PM
Leifer Leifer is offline
 
Join Date: Sep 2012
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works on 4.2.1 too
Thanks a lot
Reply With Quote
2 благодарности(ей) от:
mohammed146, ramesh_umk3
  #14  
Old 01-03-2014, 12:56 PM
mohammed146 mohammed146 is offline
 
Join Date: Nov 2011
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

good work
Reply With Quote
Благодарность от:
ramesh_umk3
  #15  
Old 03-18-2014, 06:22 PM
mikez006 mikez006 is offline
 
Join Date: Mar 2008
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyway to make this work on certain forums only?
Reply With Quote
Благодарность от:
ramesh_umk3
  #16  
Old 03-18-2014, 08:57 PM
ramesh_umk3 ramesh_umk3 is offline
 
Join Date: Jul 2010
Location: Earth
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes possible just use if - else it will work below is example and demo

PHP Code:
<vb:if condition="in_array($forum['forumid'], array(9))">
<
div class="divspoiler">
<
input type="button" class="spb" value="→ MORE SUBFORUMS" onclick="if (this.parentNode.nextSibling.childNodes[0].style.display != '') { this.parentNode.nextSibling.childNodes[0].style.display = ''; this.value = '↑ HIDE SUBFORUMS'; } else { this.parentNode.nextSibling.childNodes[0].style.display = 'none'; this.value = '↓ SHOW SUBFORUMS'; }" />
</
div><div><div class="spoiler" style="display: none;">             
<
div style="padding:1px;">{vb:raw forum.subforums}</div>
</
div></div>

<
vb:else />

{
vb:raw forum.subforums}
</
vb:if> 
were 9 is my forum id for Programming. Just place comma after each forum id example below

PHP Code:
<vb:if condition="in_array($forum['forumid'], array(9,11,105,200))"
Regards,
Reply With Quote
  #17  
Old 03-19-2014, 01:24 AM
Mr_Running Mr_Running is offline
 
Join Date: May 2010
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent One thing I did notice: If there is no Forum Description entered the Button locates it self to the right but if there is a Description the button will stay under the Description.

Trying to figure out...How to keep the button under Forum Title without the forum Description?
Reply With Quote
Благодарность от:
ramesh_umk3
  #18  
Old 03-19-2014, 03:47 AM
mikez006 mikez006 is offline
 
Join Date: Mar 2008
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

perfect, thanks
Reply With Quote
  #19  
Old 03-19-2014, 12:05 PM
ramesh_umk3 ramesh_umk3 is offline
 
Join Date: Jul 2010
Location: Earth
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mr_Running View Post
Excellent One thing I did notice: If there is no Forum Description entered the Button locates it self to the right but if there is a Description the button will stay under the Description.

Trying to figure out...How to keep the button under Forum Title without the forum Description?
search and move below code in the mod which i released at 1st post

Code:
<vb:if condition="$show['forumdescription']"><p class="forumdescription">{vb:raw forum.description}</p></vb:if>
but that is not a proper style show description to users always so that they will find useful with subforums links...
Reply With Quote
  #20  
Old 03-19-2014, 03:00 PM
Mr_Running Mr_Running is offline
 
Join Date: May 2010
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I could be wrong but I believe the code would add a forum description?

Here is an image of what it looks like when there is No forum description...
Attached Images
File Type: png No Forum Description.png (21.4 KB, 0 views)
Reply With Quote
  #21  
Old 03-19-2014, 03:03 PM
Mr_Running Mr_Running is offline
 
Join Date: May 2010
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Show/Hide Subforums buttons removed from Demo site?
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 12:20 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.11867 seconds
  • Memory Usage 2,351KB
  • Queries Executed 28 (?)
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
  • (4)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (8)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (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_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
  • 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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete