1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| <table width="600" border="0" bgcolor="#FFFFFF" STYLE="background-image: url(pict/Cadre1-fond.gif); background-repeat: no-repeat; background-position: center">
<tr>
<td align="left" class="atype2">
<?php
$auth->acl($user->data);
$user->setup();
$forum_id = request_var('forum_id', 0);
$where = ($forum_id) ? "WHERE forum_id=$forum_id" : '';
$sql = 'SELECT forum_id, topic_id, topic_time, topic_title, topic_views, topic_replies, topic_poster, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour, topic_last_post_time FROM ' . TOPICS_TABLE . $where . ' ORDER BY topic_last_post_time DESC ' . ' LIMIT 0 , 5 ';
$result = $db->sql_query($sql);
echo '<table width="100%" class="newsforum">';
echo '<tr>';
echo '<th align="left">Sujets</th>';
echo '<th align="center">Réponses</th>';
echo '<th align="center">Vus</th>';
echo '<th align="right">Dernier message</th>';
echo '</tr>';
$i=0;
while($row = $db->sql_fetchrow($result))
{
$row['topic_title'] = utf8_decode($row['topic_title']);
$row['topic_first_poster_name'] = utf8_decode($row['topic_first_poster_name']);
$row['topic_last_poster_name'] = utf8_decode($row['topic_last_poster_name']);
$row['topic_time'] = utf8_decode($row['topic_time']);
$topic_id = $row['topic_id'];
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $topic_id);
//$row_colour = ($i % 2) ? '#FFFFCC' : '#99FFFF';
//echo '<tr bgcolor="' . $row_colour .'">';
echo '<tr>';
echo '<td align="left">';
echo '<a href="' . $view_topic_url . '">' . censor_text($row['topic_title']) . '</a><br />';
echo $user->lang['POST_BY_AUTHOR'] . ' ' . get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']);
echo ' ' . $user->lang['POSTED_ON_DATE'] . ' ' . $user->format_date($row['topic_time']) . '</td>';
echo '<td align="center">' . $row['topic_replies'] . '</td>';
echo '<td align="center">' . $row['topic_views'] . '</td>';
echo '<td align="left">' . $user->lang['POST_BY_AUTHOR'] . ' ' . get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']);
echo ' <a href="' . $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'] . '"><img src="' . $phpbb_root_path . 'styles/' . $user->theme['imageset_path'] . '/imageset/icon_topic_latest.gif" border="0" alt="' . $user->lang['VIEW_LATEST_POST'] . '" title="' . $user->lang['VIEW_LATEST_POST'] . '" />' . '</a><br />';
echo $user->lang['POSTED_ON_DATE'] . ' ' . $user->format_date($row['topic_last_post_time']) . '</td>';
echo '</tr>';
$i++;
}
echo '</table>';
?>
</td>
</tr>
</table> |
Partager