vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Forum Display Enhancements - Move Sub-forums listing below threads... (https://vborg.vbsupport.ru/showthread.php?t=249626)

BirdOPrey5 08-29-2010 10:00 PM

Move Sub-forums listing below threads...
 
1 Attachment(s)
By default vBulletin shows the listing of sub-forums above all threads in a forum. This is OK if you have 1 or 2 sub-forums but if you have many sub-forums they can quickly fill the screen and user's won't see any threads at all without scrolling which is very annoying.

There are two ways to do this- the easy way will put ALL sub-forums below your threads... The second way is a little harder but will let you specify in which forums you want to keep the sub-forums on top and in which to move sub-forums below threads.

Live Demo: Here (No longer setup this way.)

Method 1 - Move sub-forums below threads for all forums.

Edit your forumdisplay template:

Find the code:
Code:

<if condition="$show['forumslist']">
<!-- sub-forum list  -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" style="border-bottom-width:0px">
<tr>
        <td class="tcat" width="100%">$vbphrase[subforums]<span class="normal"> : $foruminfo[title]</span></td>
        <if condition="$show['forumsearch']">
        <td class="vbmenu_control" id="forumsearch.subforums" nowrap="nowrap"><a href="search.php?$session[sessionurl]f=$foruminfo[forumid]" rel="nofollow">$vbphrase[search_this_forum]</a> <if condition="$show['quicksearch']"><script type="text/javascript"> vbmenu_register("forumsearch.subforums"); </script></if></td>
        </if>
</tr>
</table>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
        <tr align="center">
          <td class="thead">&nbsp;</td>
          <td class="thead" width="100%" align="$stylevar[left]">$vbphrase[forum]</td>
          <td class="thead">$vbphrase[last_post]</td>
          <td class="thead">$vbphrase[threads]</td>
          <td class="thead">$vbphrase[posts]</td>
          <if condition="$vboptions[showmoderatorcolumn]">
          <td class="thead">$vbphrase[moderator]</td>
          </if>
        </tr>
</thead>
$forumbits
</table>
<br />
<!-- / sub-forum list  -->
</if>

"Cut" the code so it gets deleted but copied to your "clipboard"

Now Find:

Code:

$ad_location[ad_forumdisplay_afterthreads
And above this code "paste" in the code you cut above.

Save the Template- now your sub-forums will show up below your threads in all forums that have sub-forums.


The Second Method:

If you want sub-forums to stay on top in some forums but below threads in others than do the following:

In the forumdisplay template:

Find the line:
Code:

<if condition="$show['forumslist']">
and change it to:
Code:

<if condition="$show['forumslist'] AND !in_array($GLOBALS[forumid], array(X, Y, Z))">
Where X, Y, Z are the forumid's of forums you want the sub-forums BELOW the threads. You can have as many or as few forumid's listed here as you want, just separate each with a comma.

Now copy the entire section of text:

Code:

<if condition="$show['forumslist'] AND !in_array($GLOBALS[forumid], array(X, Y, Z))">
<!-- sub-forum list  -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" style="border-bottom-width:0px">
<tr>
        <td class="tcat" width="100%">$vbphrase[subforums]<span class="normal"> : $foruminfo[title]</span></td>
        <if condition="$show['forumsearch']">
        <td class="vbmenu_control" id="forumsearch.subforums" nowrap="nowrap"><a href="search.php?$session[sessionurl]f=$foruminfo[forumid]" rel="nofollow">$vbphrase[search_this_forum]</a> <if condition="$show['quicksearch']"><script type="text/javascript"> vbmenu_register("forumsearch.subforums"); </script></if></td>
        </if>
</tr>
</table>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
        <tr align="center">
          <td class="thead">&nbsp;</td>
          <td class="thead" width="100%" align="$stylevar[left]">$vbphrase[forum]</td>
          <td class="thead">$vbphrase[last_post]</td>
          <td class="thead">$vbphrase[threads]</td>
          <td class="thead">$vbphrase[posts]</td>
          <if condition="$vboptions[showmoderatorcolumn]">
          <td class="thead">$vbphrase[moderator]</td>
          </if>
        </tr>
</thead>
$forumbits
</table>
<br />
<!-- / sub-forum list  -->
</if>

and paste the code above the line:

Code:

$ad_location[ad_forumdisplay_afterthreads
Now edit the line you just pasted in:

Code:

<if condition="$show['forumslist'] AND !in_array($GLOBALS[forumid], array(X, Y, Z))">
Make sure X, Y, Z are the same forumid's you specified in step 1... also remove the "!" from this line of code so you have:
Code:

<if condition="$show['forumslist'] AND in_array($GLOBALS[forumid], array(X, Y, Z))">
Save your template changes.

Now you will have some forums with sub-forums below the threads and some above the threads. If you ever edit this in the future be sure to edit the forumid's in both places.

Note also: The code I listed is for the default style, it's possible in a custom style your exact code may be a little different so please try to match it up best you can and always copy and paste the actual code from your template and not the code in this example.

---

Download the .txt file for a copy of the install instructions.

---

Please click Install if you use this. :)

SpikedRocker 11-25-2011 07:00 PM

If this could be updated for 4.X.X stuff that would be great :-P

BirdOPrey5 11-25-2011 08:42 PM

Quote:

Originally Posted by SpikedRocker (Post 2271903)
If this could be updated for 4.X.X stuff that would be great :-P

VB4 Version: https://vborg.vbsupport.ru/showthread.php?t=251127

fxwoody 12-19-2011 11:23 AM

Tks buddy, this is mostly useful if you have a chat box in thread views also since it's down under the main threads ;)

Cheers

BirdOPrey5 12-19-2011 11:52 AM

Quote:

Originally Posted by fxwoody (Post 2279068)
Tks buddy, this is mostly useful if you have a chat box in thread views also since it's down under the main threads ;)

Cheers

Please "mark as installed" if you are using it. Thanks.


All times are GMT. The time now is 04:24 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.01008 seconds
  • Memory Usage 1,742KB
  • 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
  • (8)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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