tpl (+/-)
div class="nav-bar">
<a class="ajax" href="/forum/">Форум</a> <a class="ajax" href="/forum/{$forum.id}/">{$forum.forum_title}</a><span>{$thread.thread_title}</span>
</div>
<div class="forum-list">
<div class="forum-post">
<div class="post-author">
<a class="ajax post-author-name" href="/user/{$thread.user_id}/">{$thread.name}</a>
<div class="post-author-avatar">
<img src="{$thread.avatar}" alt="" />
</div>
<div class="forum-post-info">{$thread.time}</div>
</div>
<div class="post-text">
<div class="text">{$thread.thread_subject}</div>
<div class="attachments">
<foreach>thread.attach->attach</foreach>
<div>
<a target="_blank" class="attachment" href="/forum/file/{$attach.id}/">{$attach.file_name}</a>
<span>{$attach.size}</span>
</div>
</endforeach>
</div>
</div>
<div class="post-action">
<span class="view-post-action" onclick="viewAction(this)"></span>
<div class="post-action-events">{$thread.actions}</div>
</div>
</div>
<foreach>posts->post</foreach>
<div class="forum-post" id="post-{$post.id}">
<div class="post-author">
<a class="ajax post-author-name" href="/user/{$post.user_id}/">{$post.name}</a>
<div class="post-author-avatar"><img src="{$post.avatar}" alt="" /></div>
<div class="forum-post-info">{$post.time}</div>
</div>
<div class="post-text">
<div class="text">{$post.post_message}</div>
<div class="attachments">
<foreach>post.attach->attach</foreach>
<div>
<a target="_blank" class="attachment" href="/forum/file/{$attach.id}/">{$attach.file_name}</a>
<span>{$attach.size}</span>
</div>
</endforeach>
</div>
</div>
<div class="post-action">
<span class="view-post-action" onclick="viewAction(this)"></span>
<div class="post-action-events">{$post.actions}</div>
</div>
</div>
</endforeach>
{$block:addpost}
</div>
{$paginator}
<script src="/tpl/default/js/_forum.js"></script>
<script>scrollToForm();</script>
или все тот же пхп, слегка очищенный от логики?