Firefox PHP

display first post different style

Posted by artisites 
display first post different style
August 06, 2008 11:57AM
i've made a custom template for a news page, and would like to post the first news as an admin, with the replies having a different style.

im fine with changing the layout and styles in the read.tpl, but how would i get the first message of the thread to display? then the rest of the messages wrapped in a different style...

any help much appreciated :)
Re: display first post different style
August 06, 2008 11:58AM
by the way you've misspelled language on the downloads page.
Re: display first post different style
August 06, 2008 02:10PM
You can look at the parent_id field in the message to see if it's the first message in a thread. If parent_id is zero, then you have the parent. Based on that, you can produce different template code. You could assign an extra class to the container div or do a totally different block of HTML. That's up to you.

Inside the {LOOP MESSAGES} loop, you could use code like:

{IF NOT MESSAGES->parent_id}
   ... the code that you need for the thread starter ...
{/IF}

Possibily include an {ELSE} to also cover the case for reply messages.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login