vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Better Sub-Forum Placement (https://vborg.vbsupport.ru/showthread.php?t=100702)

Slave 11-12-2005 10:00 PM

Better Sub-Forum Placement
 
Hack:
Better Sub-Forum Placement

Inspired by the "Better Similar Threads Placement" hack which can be found at the following URL:
https://vborg.vbsupport.ru/showthread.php?t=81453

Author:
Slave

vBulletin Version:
Tested on 3.5.1 - but should work on all 3.5 versions.

Problem:
If you have a large amount of Sub-Forums within a forum users have to scroll past them to view threads.

Solution:
This hack places the list of Sub-Forums within a drop-down menu meaning no more scolling for your users. If the forum in question has no threads and only Sub-Forums, the Sub-Forums are shown as normal.

Install time:
About 2 mins, if that! :)

Number of Templates to edit:
1

Instalation Instructions:

Open your default FORUMDISPLAY template ..

----------------------------

FIND:
Code:

<if condition="$show['forumslist']">
<!-- sub-forum list  -->

ABOVE that add:
Code:

<if condition="$show['threadslist']">
<else />

----------------------------

FIND:
Code:

<br />
<!-- / sub-forum list  -->

BELOW that add:
Code:

</if>
----------------------------

FIND:
Code:

        <td class="vbmenu_control" id="forumsearch"><a href="#goto_forumsearch">$vbphrase[search_this_forum]</a> <script type="text/javascript"> vbmenu_register("forumsearch"); </script></td>
        </if>

BELOW that add:
Code:

        <if condition="$show['forumslist']"><td class="vbmenu_control" id="relatedtools"><a href="#goto_relatedtools">Sub Forums</a> <script type="text/javascript"> vbmenu_register("relatedtools"); </script></td></if>
----------------------------

FIND:
Code:

<!-- popup menu contents -->
BELOW that add:
Code:

<!-- related tools menu -->
<if condition="$show['forumslist']">
<div class="vbmenu_popup" id="relatedtools_menu" style="display:none">
        <table cellpadding="4" cellspacing="1" border="0">
<tr></td>
<!-- sub-forum list  -->

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" align="center">
<thead>
        <tr align="center">
          <td class="thead">&nbsp;</td>
          <td class="thead" align="$stylevar[left]">$vbphrase[forum]</td>
          <td class="thead" width="175">$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>
<!-- / sub-forum list  -->
</td></tr>
        </table>
</div>
</if>
<!-- / related tools menu -->

----------------------------

That it!
Save FORUMDISPLAY and you've done.

Slave 11-13-2005 10:38 AM

Here's a screen shot of how it looks once the hack is added ..

If you'd like to see it in action pop along to ..

http://www.savageforums.com

.. and pick any forum with a subforum within it ..

G-Force 199 11-13-2005 10:48 AM

Nice hack. Thank you
First clicked Install

Slave 11-13-2005 10:58 AM

Hey, thanks G-Force .. :)

This is my first "hack" .. so I'm glad you liked it.

Brent H 11-13-2005 04:42 PM

Any way to put this on the main forum index?

fyjpm 12-06-2005 06:23 PM

*NOTE* if you are using GARS, then the template you will need to change is GARS_forumdisplay not FORUMDISPLAY

First bug (well actually this is an instructions bug): for vB3.5.1 search phrase is wrong:

Code:

        <td class="vbmenu_control" id="forumsearch"><a href="#goto_forumsearch">$vbphrase[search_this_forum]</a> <script type="text/javascript"> vbmenu_register("forumsearch"); </script></td>
        </if>

Search for this instead:

Code:

        <td class="vbmenu_control" id="forumsearch" nowrap="nowrap"><a href="$show[nojs_link]#goto_forumsearch" rel="nofollow">$vbphrase[search_this_forum]</a> <script type="text/javascript"> vbmenu_register("forumsearch"); </script></td>
        </if>

Second bug: replace phrase is wrong:

Code:

        <if condition="$show['forumslist']"><td class="vbmenu_control" id="relatedtools"><a href="#goto_relatedtools">Sub Forums</a> <script type="text/javascript"> vbmenu_register("relatedtools"); </script></td></if>
Replace with this instead:

Code:

        <if condition="$show['forumslist']"><td class="vbmenu_control" id="relatedtools"><a href="$show[nojs_link]#goto_relatedtools">Sub Forums</a> <script type="text/javascript"> vbmenu_register("relatedtools"); </script></td></if>
Third bug: typo on <td> tag: the following is wrong (even check it on your board, does work right in FF)

Code:

<!-- related tools menu -->
<if condition="$show['forumslist']">
<div class="vbmenu_popup" id="relatedtools_menu" style="display:none">
        <table cellpadding="4" cellspacing="1" border="0">
<tr></td>
<!-- sub-forum list  -->

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" align="center">
<thead>
        <tr align="center">
          <td class="thead">&nbsp;</td>
          <td class="thead" align="$stylevar[left]">$vbphrase[forum]</td>
          <td class="thead" width="175">$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>
<!-- / sub-forum list  -->
</td></tr>
        </table>
</div>
</if>
<!-- / related tools menu -->

Add this instead:

Code:

<!-- related tools menu -->
<if condition="$show['forumslist']">
<div class="vbmenu_popup" id="relatedtools_menu" style="display:none">
        <table cellpadding="4" cellspacing="1" border="0">
<tr><td>
<!-- sub-forum list  -->

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" align="center">
<thead>
        <tr align="center">
          <td class="thead">&nbsp;</td>
          <td class="thead" align="$stylevar[left]">$vbphrase[forum]</td>
          <td class="thead" width="175">$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>
<!-- / sub-forum list  -->
</td></tr>
        </table>
</div>
</if>
<!-- / related tools menu -->

Now it works right! BTW, aside from the easy debugging, this script KICKS IT! Nice job!

-John

Oblivion Knight 12-06-2005 06:49 PM

Nice idea, but I'd imagine that a lot of users who are unfamiliar with forums (ok, so there's probably not going to be that many) wouldn't know those Sub-Forums existed.

Smiry Kin's 05-18-2006 12:05 PM

ermm looks kinda funny in FF, any chance on fixing?

Smiry Kin's 06-02-2006 04:09 AM

Quote:

Originally Posted by Smiry Kin's
ermm looks kinda funny in FF, any chance on fixing?

any help?

Slave 06-04-2006 09:19 PM

Quote:

Originally Posted by Smiry Kin's
any help?

I'm afriad I don't use FF .. so unless someone else has any suggestions ........

zippokid 04-03-2007 01:22 PM

Is there an easy way to add this as a dropdown on the navbar rather than in the obscure placement it has as it stands?

EDIT: nevermind, figured it out. also decided against this because my users are lazy and just want every topic dumped in one forum and this makes them more able to ignore subforums


All times are GMT. The time now is 03:35 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.01246 seconds
  • Memory Usage 1,758KB
  • 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
  • (14)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)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