Kod: Zaznacz cały
<?php
echo"<center>";
echo"<br><center><span class=mainmenu></center><br><table width=98% cellpadding=0 border=0 cellspacing=0 align=center><tr><td class=tableborder>";
echo"<table width=100% cellpadding=4 cellspacing=1 border=0 class=bodyline align=center>";
echo"<tr><td class=row3 align=center colspan=5><span class=genmed><B>Ostatnie 10 postów</B></span></td></tr><tr align=center>";
echo"<td class=row1><span class=genmed> Temat </span></td>";
echo"<td class=row1><span class=genmed> Ostatni Post </span></td></tr>";
//
//BEGINNING OF PAGE
//
$sql="SELECT " . FORUMS_TABLE . ".auth_read, " . FORUMS_TABLE . ".forum_id, " .FORUMS_TABLE . ".forum_name, " . TOPICS_TABLE . ".forum_id, " . TOPICS_TABLE . ".topic_views, " . TOPICS_TABLE . ".topic_replies, " . TOPICS_TABLE . ".topic_id AS topic_id, " . TOPICS_TABLE . " .topic_title AS topic_title, MAX(". POSTS_TABLE . ".post_time) AS post_time, " . USERS_TABLE . ".username, MAX(". POSTS_TABLE . ".post_id) AS post_id FROM " . TOPICS_TABLE . ", " . POSTS_TABLE . ", " . USERS_TABLE . ", " . FORUMS_TABLE . " WHERE " . TOPICS_TABLE . ".topic_id = " . POSTS_TABLE . ".topic_id and " . POSTS_TABLE . ".poster_id = " . USERS_TABLE . ".user_id AND " . TOPICS_TABLE . ".forum_id = " . FORUMS_TABLE . ".forum_id AND " . FORUMS_TABLE . ".auth_read = 0 GROUP BY " . POSTS_TABLE . ".post_id ORDER BY post_time DESC LIMIT 10;";
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
echo "<tr align=center><td align=left class=row2><span class=genmed><a href=forum/viewtopic.php?p=" .$row['post_id']. "#" .$row['post_id']. ">" .$row['topic_title']. "</span></td><td class=row2><span class=genmed> ".create_date("d M Y h:i a", $row['post_time'], +1) . " EDT </span></td></tr>";
}
//
//END OF PAGE
//
echo"</table></td></tr></table></center><br>";
?>