unexpected }
Ik heb hier een forum.php alleen geeft hij telkens unexpected { aan.
Als ik die weghaal dan zegt hij unexpected t_else
Wie kan er even naar kijken?
alvast bedankt,
Code (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
<?php
$_SESSION['id'] = $leden->getId();
if(isset($_GET['showtopic'])){
$tQuery = mysql_query("SELECT * FROM topics WHERE id = '" . mysql_real_escape_string($_GET['showtopic']) . "'") or die(mysql_error());
$tFetch = mysql_fetch_assoc($tQuery);
if(mysql_num_rows($tQuery) == 0){
echo '<div id="error">Dit topic bestaat niet</div>';
}elseif($tFetch['type'] == 4){
echo '<div id="error">Dit topic is verwijderd</div>';
}else{
$records = 10;
if(isset($_GET['page']) && ctype_digit($_GET['page'])){
$p = $_GET['page'];
}else{
$p = 0;
}
$tsQuery = mysql_query("SELECT * FROM leden WHERE id = '" . mysql_real_escape_string($tFetch['poster']) . "'") or die(mysql_error());
$tsFetch = mysql_fetch_assoc($tsQuery);
$tsOnlineQuery = mysql_query("SELECT * FROM leden WHERE id = '" . mysql_real_escape_string($tFetch['poster']) . "' AND DATE_SUB(NOW(),INTERVAL 5 MINUTE) <= laatst_online") or die(mysql_error());
if(mysql_num_rows($tsOnlineQuery) == 0){
$plaatje = 'bullet_red';
}else{
$plaatje = 'bullet_green';
}
$tsPostCountQuery = mysql_query("SELECT * FROM reacties WHERE poster = '" . mysql_real_escape_string($tsFetch['id']) . "'") or die(mysql_error());
?>
<h8><?php echo stripslashes($tFetch['titel']); ?></h8>
<div style="width: 100%; border: 1px solid #EAEAEA; padding: 2px; background: url(http://www.falox.nl/img/forummessage.png) #FFFFFF repeat-x;">
<table style="border: 0; width: 100%;">
<tr>
<td></td>
<td style="text-align: right;">
Geplaatst op <?php echo datenl($tFetch['datum']); ?>
</td>
</tr>
<tr>
<td style="width: 19%; text-align: center;" valign="top">
<strong><img src="http://www.falox.nl/img/<?php echo $plaatje; ?>.gif" /> <?php echo $tsFetch['gebruikersnaam']; ?></strong><br />
<?php echo'<img style="width: 100px; height: 100px;" src="'.$tsFetch['avatar'].'"><br />'; ?>
Rank: <?php if($tsFetch['rang'] == 0){ echo 'Lid'; }elseif($tsFetch['rang'] == 4){ echo 'Robot'; } elseif($tsFetch['rang'] == 1){ echo '<span style="color: darkgreen; font-weight: bold;">Moderator</span>'; }elseif($tsFetch['rang'] == 2){ echo '<span style="color: red; font-weight: bold;">Beheerder</span>'; }elseif($tsFetch['rang'] == 5){ echo ''; } ?><br />
Posts: <?php echo mysql_num_rows($tsPostCountQuery); ?><br />
</td>
<td valign="top" style="background:#FFFFFF; padding: 4px;">
<?php
$raQuery = mysql_query("SELECT * FROM leden WHERE id = '" . $leden->getId() . "'") or die(mysql_error());
$raFetch = mysql_fetch_assoc($raQuery);
$rang = $raFetch['rang'];
if($rang > '0'){
?>
<div style="width: 5px;" id="forumAction"><a href="?p=admin&sticky=<?php echo $tFetch['id']; ?>"><img src="http://www.falox.nl/img/exclamation.png" /></a><a href="?p=admin&lock=<?php echo $tFetch['id']; ?>"><img src="http://www.falox.nl/img/lock.gif" /></a><a href="#" onclick="var c = confirm('Weet je het zeker?'); if(c == true){ location.href = '?p=admin&deletetopic=<?php echo $tFetch['id']; ?>'; }"><img src="http://www.falox.nl/img/delete.gif" /></a></div>
<?php
}
?>
<br />
<br />
<?php echo ubb(stripslashes($tFetch['bericht'])); ?>
<?php if($tsFetch['signature'] != '') { ?><br /><br />
<div style="height: 1px; width: 100%; background: #EEEEEE;"></div><br />
<?php echo ubb(stripslashes($tsFetch['signature'])); ?>
<?php
}
?>
</td>
</tr>
</table>
</div>
<br /><br />
<?php
$aQuery = mysql_query("SELECT * FROM ads WHERE vertical = 0 AND horizontal = 1 ORDER BY RAND() LIMIT 1") or die(mysql_error());
$aFetch = mysql_fetch_assoc($aQuery);
?>
<center><a href="index.php?p=ad&id=<?php echo $aFetch['id']; ?>"><img src="http://www.falox.nl/img/ads/<?php echo $aFetch['id']; ?>.<?php echo $aFetch['filetype']; ?>" /></a></center>
<br />
<?php
$allReactionsQuery = mysql_query("SELECT * FROM reacties WHERE t_id = '" . mysql_real_escape_string($tFetch['id']) . "'") or die(mysql_error());
$allReactionsRows = mysql_num_rows($allReactionsQuery);
$pages = ceil($allReactionsRows / $records);
for($i = 1; $i <= $pages; $i++) {
if($i-1 == $p){
$style = 'border: 1px solid #99B837; background: #B0CD58; padding: 4px; color: #FFFFFF; font-weight: bold;';
}else{
$style = 'border: 1px solid #969696; background: #FFFFFF; padding: 4px; color: #969696;';
}
echo '<button style="' . $style . '" onclick="location.href = \'?p=forum&showtopic=' . mysql_real_escape_string($_GET['showtopic']) . '&page='.($i-1).'\';">'.$i.'</button> ';
}
?>
<br /><br />
<?php
$rQuery = mysql_query("SELECT * FROM reacties WHERE t_id = '" . mysql_real_escape_string($tFetch['id']) . "' LIMIT ".($p*$records).",".$records."") or die(mysql_error());
while($rFetch = mysql_fetch_assoc($rQuery)){
$ruQuery = mysql_query("SELECT * FROM leden WHERE id = '" . mysql_real_escape_string($rFetch['poster']) . "'") or die(mysql_error());
$ruFetch = mysql_fetch_assoc($ruQuery);
$ruOnlineQuery = mysql_query("SELECT * FROM leden WHERE id = '" . mysql_real_escape_string($rFetch['poster']) . "' AND DATE_SUB(NOW(),INTERVAL 5 MINUTE) <= laatst_online") or die(mysql_error());
if(mysql_num_rows($ruOnlineQuery) == 0){
$plaatje = 'bullet_red';
}else{
$plaatje = 'bullet_green';
}
$postCountQuery = mysql_query("SELECT * FROM reacties WHERE poster = '" . $ruFetch['id'] . "'") or die(mysql_error());
?>
<div style="width: 100%; border: 1px solid #EAEAEA; padding: 2px; background: url(http://www.falox.nl/img/forummessage.png) #FFFFFF repeat-x;" id="reaction<?php echo $rFetch['id']; ?>">
<table style="border: 0; width: 100%;">
<tr>
<td></td>
<td style="text-align: right;">
Geplaatst op <?php echo datenl($rFetch['datum']); ?>
</td>
</tr>
<tr>
<td style="width: 21%; text-align: center;" valign="top">
<strong><img src="http://www.falox.nl/img/<?php echo $plaatje; ?>.gif"> <?php echo $ruFetch['gebruikersnaam']; ?></strong><br />
<?php echo'<img style="width: 100px; height: 100px;" src="'.$ruFetch['avatar'].'"><br />'; ?><br />
Rank: <?php if($ruFetch['rang'] == 0){ echo 'Lid'; }elseif($ruFetch['rang'] == 4){ echo 'Robot'; } elseif($ruFetch['rang'] == 1){ echo '<span style="color: darkgreen; font-weight: bold;">Moderator</span>'; }elseif($ruFetch['rang'] == 2){ echo '<span style="color: red; font-weight: bold;">Beheerder</span>'; }elseif($ruFetch['rang'] == 3){ echo 'Verwijderd'; } ?><br />
Posts: <?php echo mysql_num_rows($postCountQuery); ?><br />
</td>
<td valign="top" style="background:#FFFFFF; padding: 4px;">
<?php
$raQuery = mysql_query("SELECT * FROM leden WHERE id = '" . $leden->getId() . "'") or die(mysql_error());
$raFetch = mysql_fetch_assoc($raQuery);
$rang = $raFetch['rang'];
?>
<div id="forumAction"><a href="?p=forum"e=<?php echo $rFetch['id']; ?>"><img src="http://www.falox.nl/img/comments.png" /></a></div>
<?php
}
if($rFetch['poster'] == $_SESSION['id'] or $rang > '0'){ ?><div id="forumAction"><a href="?p=forum&edit=<?php echo $rFetch['id']; ?>"><img src="http://www.falox.nl/img/edit.gif" /></a></div>
<?php
}
if($rang > '0'){
?>
<div id="forumAction"><a onclick="var c = confirm('Weet je het zeker?'); if(c == true) { delete_forumreaction(<?php echo $rFetch['id']; ?>); }"><img src="http://www.falox.nl/img/delete.gif" /></a></div>
<?php
}
?>
<br />
<br />
<?php echo ubb(stripslashes($rFetch['bericht'])); ?>
<?php if($ruFetch['signature'] != '') { ?><br /><br />
<div style="height: 1px; width: 100%; background: #EEEEEE;"></div><br />
<?php echo ubb(stripslashes($ruFetch['signature'])); ?>
<?php
}
?>
</td>
</tr>
</table>
</div><br />
<?php
}
for($i = 1; $i <= $pages; $i++) {
if($i-1 == $p){
$style = 'border: 1px solid #99B837; background: #B0CD58; padding: 4px; color: #FFFFFF; font-weight: bold;';
}else{
$style = 'border: 1px solid #969696; background: #FFFFFF; padding: 4px; color: #969696;';
}
echo '<button style="' . $style . '" onclick="location.href = \'?p=forum&showtopic=' . mysql_real_escape_string($_GET['showtopic']) . '&page='.($i-1).'\';">'.$i.'</button> ';
}
echo '<br /><br />';
if(isset($_POST['submit'])){
if(strlen($_POST['message']) < 3){
echo '<div id="error">Je bericht is te kort!</div>';
}elseif($tFetch['type'] == 2 or $tFetch['type'] == 4){
echo '<div id="error">Je kan niet op dit topic reageren!</div>';
}elseif(!isset($_SESSION['id'])){
echo '<div id="error">Log in als je op een topic wilt reageren!</div>';
}else{
$message = htmlspecialchars($_POST['message']);
$message = nl2br($message);
mysql_query("INSERT INTO forumreactions VALUES (
NULL,
'" . mysql_real_escape_string($tFetch['id']) . "',
'" . mysql_real_escape_string($message) . "',
'" . $_SESSION['id'] . "',
1,
NOW()
);
") or die(mysql_error());
mysql_query("UPDATE topics SET last_reaction = NOW() WHERE id = '" . mysql_real_escape_string($tFetch['id']) . "'") or die(mysql_error());
?>
<a id="bottom">
</a>
<meta http-equiv="refresh" content="0;url=<?php echo '?p=forum&showtopic=' . $tFetch['id'] . '&page=' . $_POST['p']; ?>#bottom">
<?php
}
}else{
if($tFetch['type'] == 2){
echo '<div id="error"><img src="http://www.falox.nl/http://www.falox.nl/img/slotje.gif" /> Dit topic is gesloten, je kunt niet reageren.</div>';
}elseif(!isset($_SESSION['id'])){
echo '<div id="error">Log in als je op een topic wilt reageren!</div>';
}else{
?>
<a id="bottom"></a>
<table style="border: 0;">
<tr>
<td style="width: 250px;" valign="top">
<?php ubbbuttons('message'); ?>
</td>
<td valign="top">
<form method="post" action="?p=forum&showtopic=<?php echo $tFetch['id']; ?>#bottom">
<textarea style="width: 450px; height: 170px;" name="message" id="message"></textarea>
<input type="hidden" name="p" value="<?php echo $p; ?>" />
</td>
</tr>
</table>
<br /><br />
<input type="submit" value="Versturen" name="submit" />
</form>
<?php
}
}
}elseif(isset($_GET['maketopic']){
?>
$_SESSION['id'] = $leden->getId();
if(isset($_GET['showtopic'])){
$tQuery = mysql_query("SELECT * FROM topics WHERE id = '" . mysql_real_escape_string($_GET['showtopic']) . "'") or die(mysql_error());
$tFetch = mysql_fetch_assoc($tQuery);
if(mysql_num_rows($tQuery) == 0){
echo '<div id="error">Dit topic bestaat niet</div>';
}elseif($tFetch['type'] == 4){
echo '<div id="error">Dit topic is verwijderd</div>';
}else{
$records = 10;
if(isset($_GET['page']) && ctype_digit($_GET['page'])){
$p = $_GET['page'];
}else{
$p = 0;
}
$tsQuery = mysql_query("SELECT * FROM leden WHERE id = '" . mysql_real_escape_string($tFetch['poster']) . "'") or die(mysql_error());
$tsFetch = mysql_fetch_assoc($tsQuery);
$tsOnlineQuery = mysql_query("SELECT * FROM leden WHERE id = '" . mysql_real_escape_string($tFetch['poster']) . "' AND DATE_SUB(NOW(),INTERVAL 5 MINUTE) <= laatst_online") or die(mysql_error());
if(mysql_num_rows($tsOnlineQuery) == 0){
$plaatje = 'bullet_red';
}else{
$plaatje = 'bullet_green';
}
$tsPostCountQuery = mysql_query("SELECT * FROM reacties WHERE poster = '" . mysql_real_escape_string($tsFetch['id']) . "'") or die(mysql_error());
?>
<h8><?php echo stripslashes($tFetch['titel']); ?></h8>
<div style="width: 100%; border: 1px solid #EAEAEA; padding: 2px; background: url(http://www.falox.nl/img/forummessage.png) #FFFFFF repeat-x;">
<table style="border: 0; width: 100%;">
<tr>
<td></td>
<td style="text-align: right;">
Geplaatst op <?php echo datenl($tFetch['datum']); ?>
</td>
</tr>
<tr>
<td style="width: 19%; text-align: center;" valign="top">
<strong><img src="http://www.falox.nl/img/<?php echo $plaatje; ?>.gif" /> <?php echo $tsFetch['gebruikersnaam']; ?></strong><br />
<?php echo'<img style="width: 100px; height: 100px;" src="'.$tsFetch['avatar'].'"><br />'; ?>
Rank: <?php if($tsFetch['rang'] == 0){ echo 'Lid'; }elseif($tsFetch['rang'] == 4){ echo 'Robot'; } elseif($tsFetch['rang'] == 1){ echo '<span style="color: darkgreen; font-weight: bold;">Moderator</span>'; }elseif($tsFetch['rang'] == 2){ echo '<span style="color: red; font-weight: bold;">Beheerder</span>'; }elseif($tsFetch['rang'] == 5){ echo ''; } ?><br />
Posts: <?php echo mysql_num_rows($tsPostCountQuery); ?><br />
</td>
<td valign="top" style="background:#FFFFFF; padding: 4px;">
<?php
$raQuery = mysql_query("SELECT * FROM leden WHERE id = '" . $leden->getId() . "'") or die(mysql_error());
$raFetch = mysql_fetch_assoc($raQuery);
$rang = $raFetch['rang'];
if($rang > '0'){
?>
<div style="width: 5px;" id="forumAction"><a href="?p=admin&sticky=<?php echo $tFetch['id']; ?>"><img src="http://www.falox.nl/img/exclamation.png" /></a><a href="?p=admin&lock=<?php echo $tFetch['id']; ?>"><img src="http://www.falox.nl/img/lock.gif" /></a><a href="#" onclick="var c = confirm('Weet je het zeker?'); if(c == true){ location.href = '?p=admin&deletetopic=<?php echo $tFetch['id']; ?>'; }"><img src="http://www.falox.nl/img/delete.gif" /></a></div>
<?php
}
?>
<br />
<br />
<?php echo ubb(stripslashes($tFetch['bericht'])); ?>
<?php if($tsFetch['signature'] != '') { ?><br /><br />
<div style="height: 1px; width: 100%; background: #EEEEEE;"></div><br />
<?php echo ubb(stripslashes($tsFetch['signature'])); ?>
<?php
}
?>
</td>
</tr>
</table>
</div>
<br /><br />
<?php
$aQuery = mysql_query("SELECT * FROM ads WHERE vertical = 0 AND horizontal = 1 ORDER BY RAND() LIMIT 1") or die(mysql_error());
$aFetch = mysql_fetch_assoc($aQuery);
?>
<center><a href="index.php?p=ad&id=<?php echo $aFetch['id']; ?>"><img src="http://www.falox.nl/img/ads/<?php echo $aFetch['id']; ?>.<?php echo $aFetch['filetype']; ?>" /></a></center>
<br />
<?php
$allReactionsQuery = mysql_query("SELECT * FROM reacties WHERE t_id = '" . mysql_real_escape_string($tFetch['id']) . "'") or die(mysql_error());
$allReactionsRows = mysql_num_rows($allReactionsQuery);
$pages = ceil($allReactionsRows / $records);
for($i = 1; $i <= $pages; $i++) {
if($i-1 == $p){
$style = 'border: 1px solid #99B837; background: #B0CD58; padding: 4px; color: #FFFFFF; font-weight: bold;';
}else{
$style = 'border: 1px solid #969696; background: #FFFFFF; padding: 4px; color: #969696;';
}
echo '<button style="' . $style . '" onclick="location.href = \'?p=forum&showtopic=' . mysql_real_escape_string($_GET['showtopic']) . '&page='.($i-1).'\';">'.$i.'</button> ';
}
?>
<br /><br />
<?php
$rQuery = mysql_query("SELECT * FROM reacties WHERE t_id = '" . mysql_real_escape_string($tFetch['id']) . "' LIMIT ".($p*$records).",".$records."") or die(mysql_error());
while($rFetch = mysql_fetch_assoc($rQuery)){
$ruQuery = mysql_query("SELECT * FROM leden WHERE id = '" . mysql_real_escape_string($rFetch['poster']) . "'") or die(mysql_error());
$ruFetch = mysql_fetch_assoc($ruQuery);
$ruOnlineQuery = mysql_query("SELECT * FROM leden WHERE id = '" . mysql_real_escape_string($rFetch['poster']) . "' AND DATE_SUB(NOW(),INTERVAL 5 MINUTE) <= laatst_online") or die(mysql_error());
if(mysql_num_rows($ruOnlineQuery) == 0){
$plaatje = 'bullet_red';
}else{
$plaatje = 'bullet_green';
}
$postCountQuery = mysql_query("SELECT * FROM reacties WHERE poster = '" . $ruFetch['id'] . "'") or die(mysql_error());
?>
<div style="width: 100%; border: 1px solid #EAEAEA; padding: 2px; background: url(http://www.falox.nl/img/forummessage.png) #FFFFFF repeat-x;" id="reaction<?php echo $rFetch['id']; ?>">
<table style="border: 0; width: 100%;">
<tr>
<td></td>
<td style="text-align: right;">
Geplaatst op <?php echo datenl($rFetch['datum']); ?>
</td>
</tr>
<tr>
<td style="width: 21%; text-align: center;" valign="top">
<strong><img src="http://www.falox.nl/img/<?php echo $plaatje; ?>.gif"> <?php echo $ruFetch['gebruikersnaam']; ?></strong><br />
<?php echo'<img style="width: 100px; height: 100px;" src="'.$ruFetch['avatar'].'"><br />'; ?><br />
Rank: <?php if($ruFetch['rang'] == 0){ echo 'Lid'; }elseif($ruFetch['rang'] == 4){ echo 'Robot'; } elseif($ruFetch['rang'] == 1){ echo '<span style="color: darkgreen; font-weight: bold;">Moderator</span>'; }elseif($ruFetch['rang'] == 2){ echo '<span style="color: red; font-weight: bold;">Beheerder</span>'; }elseif($ruFetch['rang'] == 3){ echo 'Verwijderd'; } ?><br />
Posts: <?php echo mysql_num_rows($postCountQuery); ?><br />
</td>
<td valign="top" style="background:#FFFFFF; padding: 4px;">
<?php
$raQuery = mysql_query("SELECT * FROM leden WHERE id = '" . $leden->getId() . "'") or die(mysql_error());
$raFetch = mysql_fetch_assoc($raQuery);
$rang = $raFetch['rang'];
?>
<div id="forumAction"><a href="?p=forum"e=<?php echo $rFetch['id']; ?>"><img src="http://www.falox.nl/img/comments.png" /></a></div>
<?php
}
if($rFetch['poster'] == $_SESSION['id'] or $rang > '0'){ ?><div id="forumAction"><a href="?p=forum&edit=<?php echo $rFetch['id']; ?>"><img src="http://www.falox.nl/img/edit.gif" /></a></div>
<?php
}
if($rang > '0'){
?>
<div id="forumAction"><a onclick="var c = confirm('Weet je het zeker?'); if(c == true) { delete_forumreaction(<?php echo $rFetch['id']; ?>); }"><img src="http://www.falox.nl/img/delete.gif" /></a></div>
<?php
}
?>
<br />
<br />
<?php echo ubb(stripslashes($rFetch['bericht'])); ?>
<?php if($ruFetch['signature'] != '') { ?><br /><br />
<div style="height: 1px; width: 100%; background: #EEEEEE;"></div><br />
<?php echo ubb(stripslashes($ruFetch['signature'])); ?>
<?php
}
?>
</td>
</tr>
</table>
</div><br />
<?php
}
for($i = 1; $i <= $pages; $i++) {
if($i-1 == $p){
$style = 'border: 1px solid #99B837; background: #B0CD58; padding: 4px; color: #FFFFFF; font-weight: bold;';
}else{
$style = 'border: 1px solid #969696; background: #FFFFFF; padding: 4px; color: #969696;';
}
echo '<button style="' . $style . '" onclick="location.href = \'?p=forum&showtopic=' . mysql_real_escape_string($_GET['showtopic']) . '&page='.($i-1).'\';">'.$i.'</button> ';
}
echo '<br /><br />';
if(isset($_POST['submit'])){
if(strlen($_POST['message']) < 3){
echo '<div id="error">Je bericht is te kort!</div>';
}elseif($tFetch['type'] == 2 or $tFetch['type'] == 4){
echo '<div id="error">Je kan niet op dit topic reageren!</div>';
}elseif(!isset($_SESSION['id'])){
echo '<div id="error">Log in als je op een topic wilt reageren!</div>';
}else{
$message = htmlspecialchars($_POST['message']);
$message = nl2br($message);
mysql_query("INSERT INTO forumreactions VALUES (
NULL,
'" . mysql_real_escape_string($tFetch['id']) . "',
'" . mysql_real_escape_string($message) . "',
'" . $_SESSION['id'] . "',
1,
NOW()
);
") or die(mysql_error());
mysql_query("UPDATE topics SET last_reaction = NOW() WHERE id = '" . mysql_real_escape_string($tFetch['id']) . "'") or die(mysql_error());
?>
<a id="bottom">
</a>
<meta http-equiv="refresh" content="0;url=<?php echo '?p=forum&showtopic=' . $tFetch['id'] . '&page=' . $_POST['p']; ?>#bottom">
<?php
}
}else{
if($tFetch['type'] == 2){
echo '<div id="error"><img src="http://www.falox.nl/http://www.falox.nl/img/slotje.gif" /> Dit topic is gesloten, je kunt niet reageren.</div>';
}elseif(!isset($_SESSION['id'])){
echo '<div id="error">Log in als je op een topic wilt reageren!</div>';
}else{
?>
<a id="bottom"></a>
<table style="border: 0;">
<tr>
<td style="width: 250px;" valign="top">
<?php ubbbuttons('message'); ?>
</td>
<td valign="top">
<form method="post" action="?p=forum&showtopic=<?php echo $tFetch['id']; ?>#bottom">
<textarea style="width: 450px; height: 170px;" name="message" id="message"></textarea>
<input type="hidden" name="p" value="<?php echo $p; ?>" />
</td>
</tr>
</table>
<br /><br />
<input type="submit" value="Versturen" name="submit" />
</form>
<?php
}
}
}elseif(isset($_GET['maketopic']){
?>
}elseif(isset($_GET['maketopic']){
daar zit de unexpected }.
Mvg,
Gewijzigd op 05/10/2011 13:19:30 door Kevin Blokzijl
Gewijzigd op 05/10/2011 13:29:24 door - Ariën -
En daarbij zie je dat je gewoon een ) bent vergeten.
Jacco Brandt op 05/10/2011 13:46:03:
En daarbij zie je dat je gewoon een ) bent vergeten.
Kijk, hier heb ik wat aan, Bedankt!
En luister de volgende keer alsjeblieft ook naar Aar, zo helpen met het opzoeken van fouten is héél vervelend.En luister de volgende keer alsjeblieft ook naar Aar, zo helpen met het opzoeken van fouten is héél vervelend.
kan misschien iemand mijn code verwijderen?
Je kunt het toch gewoon wijzigen, en zelf verwijderen?
kan niet meer?
Dan moet je het een modje vragen, als je de code echt graag verwijderd wil hebben.
Misschien als je een goede reden hebt dat een van de mod's dat wil doen voor je... Maare waarom zou je dat willen? Niemand gaat hem stelen hoor...
Milo S op 09/10/2011 15:30:32:
Misschien als je een goede reden hebt dat een van de mod's dat wil doen voor je... Maare waarom zou je dat willen? Niemand gaat hem stelen hoor...
Tis wel een forum van mij, daarom wil ik hem verwijderd hebben