//====[Если не знаем PHP - дальше ничего не трогаем ]=========
$link = mysqli_connect("$host", "$username", "$password", "$database");
mysqli_set_charset($link, "utf8");
$resultf = mysqli_query($link, "SELECT tid, title, state, posts, starter_id, last_poster_id, last_post, starter_name, last_poster_name, views, topic_hasattach FROM {$prefix}topics WHERE forum_id NOT IN ({$forumexclude}) ORDER BY last_post DESC LIMIT {$num}");
$totalRows_resultf = mysqli_num_rows($resultf);
$row_resultf = mysqli_fetch_assoc($resultf);
do {
$topicstrip = $row_resultf['title'];
if (strlen($topicstrip) > $topic_num_sym) {
$topicstrip = substr($topicstrip,0,$topic_num_sym);
$topicstrip = $topicstrip."...";
}
$status = ($row_resultf['state'] == "closed") ? "<img src=\"forum/style_images/".$img_path."/f_closed.gif\" border=\"0\" alt=\"Тема закрыта\">" : "";
$attach = ($row_resultf['topic_hasattach'] == "1") ? "<img src=\"temp/A-Vector/images/files.gif\" border=\"0\" alt=\"В сообщении есть прикрепленные файлы\"> " : "";
$last_date = date($time,$row_resultf['last_post']);
$bt.= "<small class=\"3\">".$last_date.":</small> <b><a title=\"".$row_resultf['title']."\" href=\"forum/index.php?showtopic=".$row_resultf['tid']."&view=getlastpost\">".$topicstrip."</a></b><br>";
} while($row_resultf = mysqli_fetch_assoc($resultf));
mysqli_free_result($resultf);
echo $bt;
return $bt;
?>