PDA

View Full Version : Condition to show post title only on 1st post.


Lautaro
10-03-2009, 11:56 PM
I want to show the post title only in the 1st post of the thread, even if the user added a title to his/her post.

here's the code i want to display if the post is the 1st one in the thread:


<!-- icon and title -->
<div class="smallfont">
<if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if>
<if condition="$post['title']"><strong>$post[title]</strong></if>
</div>
<hr size="1" style="color:$stylevar[tborder_bgcolor]; background-color:$stylevar[tborder_bgcolor]" />
<!-- / icon and title -->


thanks.

--------------- Added 1254619155 at 1254619155 ---------------

Never mind I figured out how to do this..

this is the condition I added:


<if condition="$post[postcount]==1">

<!-- icon and title -->
<div class="smallfont">
<if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if>
<if condition="$post['title']"><strong>$post[title]</strong></if>
</div>
<hr size="1" style="color:$stylevar[tborder_bgcolor]; background-color:$stylevar[tborder_bgcolor]" />
<!-- / icon and title -->

<else />

</if>

</if>


it worked perfectly !