Waarom krijg ik hier het nieuws en aantal berichten van het laatste nieuwsbericht?
---
Voorbeeld @ http://www.saiyanarena.com/nl/?id=nieuws (nieuwsberichten zijn 2x hetzelfde, tijd is wel goed)
PHP:
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
| <?php $select = "SELECT * FROM nieuws ORDER BY id desc limit 0,5"; $query = mysql_query($select); while ($list = mysql_fetch_object($query)) { $id = $list->id; $select2 = "SELECT * FROM nieuws_reacties WHERE nieuwsid = '$id'"; $query2 = mysql_query($select2); $aantal = mysql_num_rows($query2); if ($aantal == "1") { $aantalreacties = "$aantal"; } else { $aantalreacties = "$aantal"; } $nieuws = "$list->nieuws"; $nieuws = eregi_replace("http://[^[:space:]]+","<a href=\"\\0\" target=\"_blank\">\\0</a>",$nieuws); $nieuws = eregi_replace("([a-zA-Z0-9_-]+)@([a-zA-Z0-9\._-]+)(\.[a-zA-Z]+)", "<a href=\"mailto:\\1@\\2\\3\">\\1@\\2\\3</a>", $nieuws); $nieuws = eregi_replace("\n","<br>", $nieuws); $nieuws = str_replace(":(", "[img]../images/smileys/boosrood.gif[/img]", $nieuws); $nieuws = str_replace(":)", "[img]../images/smileys/smile.gif[/img]", $nieuws); $nieuws = str_replace(":-)", "[img]../images/smileys/smile.gif[/img]", $nieuws); $nieuws = str_replace(":D", "[img]../images/smileys/smile.gif[/img]", $nieuws); $nieuws = str_replace(":d", "[img]../images/smileys/smile.gif[/img]", $nieuws); $nieuws = str_replace(";)", "[img]../images/smileys/knipoog_dicht.gif[/img]", $nieuws); $nieuws = str_replace(":S", "[img]../images/smileys/verbaasd.gif[/img]", $nieuws); $nieuws = str_replace(":s", "[img]../images/smileys/verbaasd.gif[/img]", $nieuws); $nieuws = str_replace(":p", "[img]../images/smileys/hamer.gif[/img]", $nieuws); $nieuws = str_replace(":P", "[img]../images/smileys/hamer.gif[/img]", $nieuws); $select = "SELECT * FROM nieuws ORDER BY id desc limit 0,5 "; $query = mysql_query($select)or die (mysql_error()); while ($toon = mysql_fetch_object($query)) { $id = $toon->id; $titel = $toon->titel; $datum = $toon->datum; $tijd = $toon->tijd; $gebruiker = $toon->gebruikersnaam; $nieuws = "$list->nieuws"; $nieuws = eregi_replace("([a-zA-Z0-9_-]+)@([a-zA-Z0-9\._-]+)(\.[a-zA-Z]+)", "<a href=\"mailto:\\1@\\2\\3\">\\1@\\2\\3</a>", $nieuws); $nieuws = eregi_replace("\n","<br>", $nieuws); $nieuws = str_replace(":(", "[img]../images/smileys/boosrood.gif[/img]", $nieuws); $nieuws = str_replace(":)", "[img]../images/smileys/smile.gif[/img]", $nieuws); $nieuws = str_replace(":-)", "[img]../images/smileys/smile.gif[/img]", $nieuws); $nieuws = str_replace(":D", "[img]../images/smileys/smile.gif[/img]", $nieuws); $nieuws = str_replace(":d", "[img]../images/smileys/smile.gif[/img]", $nieuws); $nieuws = str_replace(";)", "[img]../images/smileys/knipoog_dicht.gif[/img]", $nieuws); $nieuws = str_replace(":S", "[img]../images/smileys/verbaasd.gif[/img]", $nieuws); $nieuws = str_replace(":s", "[img]../images/smileys/verbaasd.gif[/img]", $nieuws); $nieuws = str_replace(":p", "[img]../images/smileys/hamer.gif[/img]", $nieuws); $nieuws = str_replace(":P", "[img]../images/smileys/hamer.gif[/img]", $nieuws); ?> <table width="100%" border="0"> <tr> <td align=left height="52">[img]"../images/avatars/dennis.jpg"[/img]</td> <td width="81%" valign=top> <strong>Onderwerp: </strong><?=$titel?><br> <strong>Gepost door:</strong> <?=$gebruiker?><br> <strong>Datum:</strong> <?=$datum?><br> <strong>Tijd:</strong> <?=$tijd?></td> </tr> </table> <table width="100%" border="0"> <tr> <td width="1"> </td> <td width="500" valign=top><?=$nieuws?></td> </tr> <tr> <td width="1"> </td> <td width="500" valign=top><?php echo"<a href=\"?id=reageren&rid=$id\" title=\"Reageren op dit nieuwsbericht\">Reageren</a> | <a href=\"?id=reactieslezen&rid=$id\" title=\"Reacties Lezen\">($aantalreacties) Reacties lezen</a>"; ?></td> </tr> </table> <? } } ?> |
---
Voorbeeld @ http://www.saiyanarena.com/nl/?id=nieuws (nieuwsberichten zijn 2x hetzelfde, tijd is wel goed)
[ Voor 42% gewijzigd door Verwijderd op 20-03-2003 20:47 ]