PDA

View Full Version : hide buttons


Sebastian
02-28-2004, 01:58 PM
anyone know if it's possible to hide the reply buttons on postbit when the thread is closed?

imported_uber
02-28-2004, 02:16 PM
What version are you running Sebastian? What you're asking for is native to vb3. If you've modified the reply button out of your showthread template, replace

<img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" />

with

<if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" ></if>

Sebastian
02-28-2004, 02:40 PM
i tried that before.. $show['closethread'] only works in the showthread template it appears.. doesnt have affect on postbit template. i wonder if there is a different conditional for postbit template.

i am using rc3

imported_uber
02-28-2004, 07:53 PM
Sorry I misunderstood your question.

I tried using the closthread condition and you're aboslutely right...

If you're using quickreply you can replace

<!-- controls -->
<if condition="$post['editlink']">
<a href="$post[editlink]"><img src="$stylevar[imgdir_button]/edit.gif" alt="$vbphrase[edit_delete_message]" border="0" /></a>
</if>
<if condition="$post['forwardlink']">
<a href="$post[forwardlink]"><img src="$stylevar[imgdir_button]/forward.gif" alt="$vbphrase[forward_message]" border="0" /></a>
</if>
<if condition="$post['replylink']">
<a href="$post[replylink]"><img src="$stylevar[imgdir_button]/reply_small.gif" alt="$vbphrase[reply_with_quote]" border="0" /></a>
</if>
<if condition="$SHOWQUICKREPLY AND !$show['threadedmode']">
<a href="$post[replylink]" onclick="return qr($post[postid]);"><img src="$stylevar[imgdir_button]/quickreply.gif" alt="$vbphrase[quick_reply_to_this_message]" border="0" /></a>
</if>
<!-- / controls -->

With

<!-- controls -->
<if condition="$SHOWQUICKREPLY">
<if condition="$post['editlink']">
<a href="$post[editlink]"><img src="$stylevar[imgdir_button]/edit.gif" alt="$vbphrase[edit_delete_message]" border="0" /></a>
</if>
<if condition="$post['forwardlink']">
<a href="$post[forwardlink]"><img src="$stylevar[imgdir_button]/forward.gif" alt="$vbphrase[forward_message]" border="0" /></a>
</if>
<if condition="$SHOWQUICKREPLY">
<if condition="$post['replylink']">
<a href="$post[replylink]"><img src="$stylevar[imgdir_button]/reply_small.gif" alt="$vbphrase[reply_with_quote]" border="0" /></a>
</if></if>
<if condition="$SHOWQUICKREPLY AND !$show['threadedmode']">
<a href="$post[replylink]" onclick="return qr($post[postid]);"><img src="$stylevar[imgdir_button]/quickreply.gif" alt="$vbphrase[quick_reply_to_this_message]" border="0" /></a>
</if>
</if>
<!-- / controls -->

And achive your desired results... Hopefully when the documentation is complete you'll find a condition to do this without having to check if the quickreply is enabled.

Dan
02-28-2004, 08:04 PM
that should work... I'll test it when I get home from work and update you on it.

Sebastian
03-01-2004, 10:19 PM
that won't work too well either. i allow unregistered members to post, so that will hide the reply button since non-members cant use quickreply..

anyhow, i found a variable that can be used in postbit to tell if a thread is open or closed: $thread[open]

cheers.