HTML interesse |
|
Beste Leden,
Ik heb onderstaande code om de forum berichten als nieuws te weergeven op mijn website. Hij pakt nu alleen alle forum berichten en ik wil dat hij alleen de berichten pakt uit het nieuws forum, welke de ID 1 heeft. Hoe krijg ik dat voor elkaar:
<!-- NEWS -->
<?php for ($i = 0; $i < count($news); $i++) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<th class="thTop" height="28"><?php echo $news[$i]['topic_title']; ?><?php if ($news[$i]['topic_trimmed']) { echo '...'; } ?></th>
</tr>
<tr>
<td class="row1" align="left" width="100%">
<span class="gensmall">
<?php echo $lang['Author']; ?>:
<a href="<?php echo append_sid($phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $news[$i]['user_id']); ?>">
<?php echo $news[$i]['username']; ?></a> ::
<?php echo $lang['Posted']; ?>:
<?php echo create_date($board_config['default_dateformat'], $news[$i]['post_time'], $board_config['board_timezone']); ?>
</span>
<span class="gen">
<hr size="1"/>
<?php echo $news[$i]['post_text']; ?><?php if ($news[$i]['trimmed']) { echo '...'; } ?>
</span>
<hr size="1"/>
<span class="gensmall">
<div align="right"><font color="#333333" face="Verdana" size="1">(<?php echo $news[$i]['topic_replies']; ?>)
<a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[$i]['topic_id']); ?>">
<?php echo $lang['Replies']; ?></a></font></div>
</span>
</td>
</tr>
</table>
<br />
<?php } ?>
<!-- NEWS -->
<!-- NEWS --> <?php for ($i = 0; $i < count($news); $i++) { ?> <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline"> <tr> <th class="thTop" height="28"> <?php echo $news[$i]['topic_title']; ?><?php if ($news[$i]['topic_trimmed']) { echo '...'; } ?></th> </tr> <tr> <td class="row1" align="left" width="100%"> <span class="gensmall"> <?php echo $lang['Author']; ?>: <a href=" <?php echo append_sid ($phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $news[$i]['user_id']); ?>"> <?php echo $news[$i]['username']; ?></a> :: <?php echo $lang['Posted']; ?>: <?php echo create_date ($board_config['default_dateformat'], $news[$i]['post_time'], $board_config['board_timezone']); ?> </span> <span class="gen"> <hr size="1"/> <?php echo $news[$i]['post_text']; ?><?php if ($news[$i]['trimmed']) { echo '...'; } ?> </span> <hr size="1"/> <span class="gensmall"> <div align="right"><font color="#333333" face="Verdana" size="1">( <?php echo $news[$i]['topic_replies']; ?>) <a href=" <?php echo append_sid ($phpbb_root_path . 'viewtopic.php?t=' . $news[$i]['topic_id']); ?>"> <?php echo $lang['Replies']; ?></a></font></div> </span> </td> </tr> </table> <br /> <?php } ?> <!-- NEWS -->
Ik wil dus alleen de berichten van forum/viewforum.php?f=1 laten zien.
// edit
Toen ik het hier zo had neergezet zag ik meteen de oplossing
<?php for ($i = 1; $i < count($news); $i++) { ?>
Die regel moest veranderd worden.
|