vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Mini Mods - Show/Hide Subforums (https://vborg.vbsupport.ru/showthread.php?t=304776)

ramesh_umk3 11-19-2013 11:00 PM

Show/Hide Subforums
 
1 Attachment(s)
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

faisaly.com 11-20-2013 05:02 PM

1 Attachment(s)
heres an attached image from the site.

snakedevil 11-20-2013 08:45 PM

Thanks !

Possible to exclude forum sections ? :)

Macgiber 11-21-2013 02:29 AM

good job friend, you would have to do to be centered under the subforum oh?

ramesh_umk3 11-21-2013 03:18 AM

Quote:

Originally Posted by snakedevil (Post 2462438)
Thanks !

Possible to exclude forum sections ? :)

Just go through VB Template Conditions you can apply it i think . Feel Free to try :)

Thanks

Quote:

Originally Posted by Macgiber (Post 2462513)
good job friend, you would have to do to be centered under the subforum oh?

Possible just add <center> above the code and </center> below the code it will work :)

Thanks

Macgiber 11-21-2013 03:27 AM

Thanks , ready.

puertoblack2003 11-24-2013 06:34 PM

nice setup looks like xda forum but the light version :D

ramesh_umk3 11-24-2013 07:08 PM

Quote:

Originally Posted by puertoblack2003 (Post 2463422)
nice setup looks like xda forum but the light version :D

Yeah we have a low budget :D but we did and still doing our best with model :up:

snakedevil 11-26-2013 10:41 AM

Quote:

Originally Posted by ramesh_umk3 (Post 2462525)
Just go through VB Template Conditions you can apply it i think . Feel Free to try :)

Does not work :(

tbworld 11-26-2013 10:52 AM

Quote:

Originally Posted by snakedevil (Post 2463813)
Does not work :(

Please post something helpful, your response does not help the author or other users as you gave no details on your experience using it. At least indicate what version of vbulletin you were using and any errors you received from your browser and/or server logs. This helps the whole community. Thank you! :)

Most likely the JavaScript is not executing, check your browser for JavaScript errors.

faisaly.com 11-26-2013 06:20 PM

This works great using vb4.2.0

no problems at all!

Leifer 12-13-2013 04:45 PM

Works on 4.2.1 too ;)
Thanks a lot

mohammed146 01-03-2014 12:56 PM

good work

mikez006 03-18-2014 06:22 PM

anyway to make this work on certain forums only?

ramesh_umk3 03-18-2014 08:57 PM

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,

Mr_Running 03-19-2014 01:24 AM

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?

mikez006 03-19-2014 03:47 AM

perfect, thanks :)

ramesh_umk3 03-19-2014 12:05 PM

Quote:

Originally Posted by Mr_Running (Post 2488245)
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...

Mr_Running 03-19-2014 03:00 PM

1 Attachment(s)
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...

Mr_Running 03-19-2014 03:03 PM

Show/Hide Subforums buttons removed from Demo site?

ramesh_umk3 03-19-2014 04:53 PM

Nope its still present see "Programming" Section

@Mr. Running give me your forum url so that i can check once

Regards,

M.C. 05-01-2014 05:58 PM

would be nice to have it in FORUMDISPLAY template too ;)

DemOnstar 05-02-2014 01:56 PM

That's a good looking site you got there ramesh_umk3.

I particularly like the collapsible postbit. Is that a mod from here or one of your own?

ramesh_umk3 05-02-2014 04:10 PM

Quote:

Originally Posted by M.C. (Post 2495702)
would be nice to have it in FORUMDISPLAY template too ;)

Like what bro so that i can help you in doing it.

Quote:

Originally Posted by DemOnstar (Post 2495832)
That's a good looking site you got there ramesh_umk3.

I particularly like the collapsible postbit. Is that a mod from here or one of your own?

Apply this modification code for postbit_legacy just small changes in CSS you will get what you see at our place bro ... :)

DemOnstar 05-02-2014 04:51 PM

1 Attachment(s)
I think you have me misunderstood kind sir..

I have applied the code above and see no changes. Perhaps this is because I have no sub forums to work with, I will create them tomorrow.

What I was referring to was this....

https://vborg.vbsupport.ru/attachmen...1&d=1399053032

Slightly confused here..:confused:

ramesh_umk3 05-02-2014 04:56 PM

Yes brother i understood what you asked just little changes of the code which i provided here and you will get it :)

Example:
Quote:

<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;">


POSTBIT_LEGACY CODE HERE


</div></div>
And change your desired value name in code

that's it

DemOnstar 05-02-2014 05:06 PM

Thanks for your patience old boy but I really have no idea what you are talking about.

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;">


Particularly this POSTBIT_LEGACY CODE HERE


</div></div>

Never mind, it will all be ok in the end.....lol

ramesh_umk3 05-02-2014 05:10 PM

Just Paste your complete POSTBIT_LEGACY code here it would be simple now :)

DemOnstar 05-02-2014 05:23 PM

Cheers Mr umk_3, I will give that a go in the morning...

My head is full of numbers and symbols right now and drinking beer doesn't make it any easier..


All times are GMT. The time now is 05:20 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.01441 seconds
  • Memory Usage 1,815KB
  • 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
  • (5)bbcode_code_printable
  • (2)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (29)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete