<?
$posts = 7;
$showtopiclength = 1;
$topiclength = 40;
$forumexclude = "62,8,74,48,46,61";
$datedisplay = 'd.n.Y';
$timedisplay = 'H:i:s';
require "ips_kernel/class_db_mysql.php";
require "conf_global.php";
$db = new db_driver_mysql;
$db->obj['sql_database'] = $INFO['sql_database'];
$db->obj['sql_user'] = $INFO['sql_user'];
$db->obj['sql_pass'] = $INFO['sql_pass'];
$db->obj['sql_host'] = $INFO['sql_host'];
$db->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix'];
$db->obj['mysql_codepage'] = $INFO['mysql_codepage'];
$db->connect();
$getposts = $db->query("SELECT posts, last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM ibf_topics WHERE (forum_id NOT IN ($forumexclude)) ORDER BY last_post DESC LIMIT $posts");
while ($post = $db->fetch_row($getposts)) {
$post[full_title] = $post[title];
if ($showtopiclength == 1 AND strlen($post[full_title]) > $topiclength) {
$post[short_title] = substr($post[full_title],0,$topiclength);
$post[short_title] = $post[short_title]."...";
}
else {
$post[short_title] = $post[full_title];
}
$posted_on = date($datedisplay, $post[last_post]);
$today_date = date($datedisplay, time());
If ($posted_on == $today_date) {
$datefield = "Сегодня";
$datefield = $datefield . ", " . date($timedisplay, $post[last_post]);
}
elseif (date('d F Y',strtotime("-1 day")) == $posted_on) {
$datefield = "Вчера";
$datefield = $datefield . ", " . date($timedisplay, $post[last_post]);
}
else {
$datefield = $posted_on;
}
echo
<<<EOD
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251' />
<style>
body {
background-color: #E7E5D5;
color: #303030;
font-family: Tahoma;
font-size: 12px;
}
a, a:visited, a:hover {
color: #111111;
border-bottom:1px dashed #778087;
font-family: Tahoma;
font-size: 11px;
text-decoration: none;
}
</style>
<tr><td> Тема: <a href="$INFO[board_url]/index.php?showtopic=$post[tid]&view=getnewpost" target="_blank">$post[short_title]</a>
<a href="$INFO[board_url]/index.php?showuser=$post[last_poster_id]" target="_blank">$post[last_poster_name]</a>
<small> $datefield, Ответов: $post[posts]</small>
</td>
<br> <br>
</tr>
EOD;
}
?>