<div class="forum-category-topics">
    <?php if (!empty($data)): ?>
        <?php foreach ($data as $row): ?>
        <div class="forum-category-topic">
            <div class="forum-category-topic-title">
                <?php if ($row['sticked']): ?>
                <div class="forum-category-topic-sticked"></div>
                <?php endif; ?>
                <a href="<?php echo htmlspecialchars($row['link']) ?>"><?php echo htmlspecialchars($row['title']) ?></a>
                <?php if ($row['closed']): ?>
                <span class="forum-category-topic-title-closed">(тема закрыта)</span>
                <?php endif; ?>
            </div>
            <div class="forum-category-topic-author">
                Автор: <?php echo $row['author'] ?>, <span class="forum-category-topic-time"><?php echo $row['time_create'] ?></span>
            </div>    
            <div class="forum-category-topic-comments">
                Ответов: <?php echo $row['comments_count'] ?>
            </div>
            <?php if ($row['comments_count'] > 0): ?>
            <div class="forum-category-topic-last-answer">
                Последний ответ: <?php echo $row['last_comment_author'] ?>, <span class="forum-category-topic-time"><?php echo $row['time_update'] ?></span>
            </div>        
            <?php endif; ?>
            <?php if (!empty($row['admin_tools'])): ?>
            <?php echo $row['admin_tools'] ?>     
            <?php endif; ?>
        </div>
        <?php endforeach; ?>    
    <?php else: ?>
    Нет тем
    <?php endif; ?>
</div>

<?php if (!empty($pager)): ?>
<?php echo $pager; ?> 
<?php endif; ?>