PDA

View Full Version : Check if thread is open.


vuzzupp
05-28-2011, 02:05 PM
I have been making a template and need to move the "reply" button from above the thread controls to besides the "quick reply". I have produced the following code which I believe should be correct, but it does not work for some reason:


<if condition="$show['closethread']">
<a href="newreply.php?$session[sessionurl]do=newreply&amp;noquote=1&amp;p=$thread[threadid]" rel="nofollow">
<img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /></a>
<else />
<img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" />
</if>


Can anyone help?

kh99
05-28-2011, 03:06 PM
Are you modifying the SHOWTHREAD templat eor making a new template? And if it's a new one, where in the php code is it being used?

vuzzupp
05-28-2011, 03:36 PM
It is in the postbit legacy template I am editing. Before the quick-reply icon.

kh99
05-28-2011, 03:46 PM
OK, the problem is that $show['closethread'] hasn't been set yet when the postbit template is processed. Try using $thread['open'] instead.

vuzzupp
05-29-2011, 10:12 AM
Thank you, that worked like a charm. :D