PDA

View Full Version : Show/Hide Sticky Posts (collapsible)


RMS-Chef
18 Dec 2005, 20:58
Made this for myself so decided to release here. Just tried it and it seems to work fine.

What does it do?
Many of my forums have a lot of sticky threads. For me, they were taking up too much of the FORUMDISPLAY view. Adding this code will allow you and your users to optionally collapse/expand all sticky posts on FORUMDISPLAY and adds a seperator when they are displayed thanks to Oblivion Knight (http://www.vbulletin.org/forum/showpost.php?p=757501&postcount=18).

What is left?
I have no clue how to do it but if someone would like to help out and tell me how to have the text "Show|Hide Sticky Threads" instead display "Show Sticky Threads" when they are hidden and "Hide Sticky Threads" when they are being displayed, that would be nice. It would also be nice if the could be on a per forum basis rather than always hide/show stickies across the board but that is well beyond me also.



Open FORUMDISPLAY template
Find:

$threadbits_sticky

Above it add:

<thead>
<tr>
<td class="thead" colspan="<if condition="$show['threadicons'] AND $show['inlinemod']">7<else /><if condition="($show['threadicons'] AND !$show['inlinemod']) OR (!$show['threadicons'] AND $show['inlinemod'])">6<else />5</if></if>">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('hidesticky')">Show|Hide Sticky Threads&nbsp;<img id="collapseimg_hidesticky" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_hidesticky].gif" alt="" border="0" /></a>
&nbsp;
</td>
</tr>
</thead>
<tbody id="collapseobj_hidesticky" style="$vbcollapse[collapseobj_hidesticky]">
<tr>
<td class="alt1">


Below it add:

<tr><td class="tcat" colspan="<if condition="$show['threadicons'] AND $show['inlinemod']">7<else /><if condition="($show['threadicons'] AND !$show['inlinemod']) OR (!$show['threadicons'] AND $show['inlinemod'])">6<else />5</if></if>"><img src="$vboptions[cleargifurl]" width="1" height="1" alt="" /></td></tr>
</td>
</tr>
</tbody>


EDIT:
Screens added.

harpez
18 Dec 2005, 21:59
Sounds very good, I will install it later!

Yaaaaaaay, first post :D

JsnakeJ
19 Dec 2005, 02:37
Doesn't come up yellow does it?

RMS-Chef
19 Dec 2005, 02:38
Doesn't come up yellow does it?

lol, no, that's just the default CSS hover color for alt1 text.

Snake
19 Dec 2005, 07:17
Nice little feature! :)

-=Sniper=-
19 Dec 2005, 11:01
very nice :)

utw-Mephisto
19 Dec 2005, 12:29
Very nice, I have only one problem, when the stickies are shown, it gives a gap between sticky and bar above :

http://img381.imageshack.us/img381/2766/untitled5th.jpg

utw-Mephisto
19 Dec 2005, 12:34
Also: What happens with new sticky, are they hidden as well ? So could they miss something ?

EDIT : Ok, I just tested it and it hides also new stickies, which is not good at all :(

RMS-Chef
19 Dec 2005, 17:33
Also: What happens with new sticky, are they hidden as well ? So could they miss something ?

EDIT : Ok, I just tested it and it hides also new stickies, which is not good at all :(

Yes, it hides all stickies. It's good for me since some of my forums have 8-10 sticky posts. It's up to your users to expand it once in a while to see if there is anything new. It's just a simple template mod so unless someone wants to take it to the next level where maybe it could display something like a New Thread notifacation of some kind when there are new posts or threads that are stickied, this is what I got. :)

KayDEE
04 Jan 2006, 08:59
@utw-Mephisto

to remove the "gap" find:


<tbody id="collapseobj_hidesticky" style="$vbcollapse[collapseobj_hidesticky]">
<tr>
<td class="alt1">
$threadbits_sticky


and remove ...


<tr>
<td class="alt1">


additionally you could extend it with replacing the <td> with


<td class="tcat" colspan="<if condition="$show['threadicons'] AND $show['inlinemod']">7<else /><if condition="($show['threadicons'] AND !$show['inlinemod']) OR (!$show['threadicons'] AND $show['inlinemod'])">6<else />5</if></if>"><img src="$vboptions[cleargifurl]" width="1" height="1" alt="" />


and add some text behind it like "Sticky Threads"

that will add another break-bar like the seperator above the stickies ... just play around with it a bit ;)

/me installs

thanks

Darat
16 Jan 2006, 12:18
Just noticed that after installing this that my thread/thread starter row has disappeared. (See attached jpeg or http://forums.randi.org/forumdisplay.php?f=26)

And it is weird - the "thread / thread starter" line still appears fine in forums without any stickies.

Darat
18 Jan 2006, 09:19
Anyone any suggestions for what I should look for to fix my problem?

Just realised this only seems to happen in Opera!

mmllc
06 Jun 2010, 06:19
Great mod! Thanks

JabirA
12 Sep 2012, 09:00
Can someone make this for vB 4? Or is it already available?