Forum » Server-Side scripting » PM systeem
Lua/PHP scriptorrrrrr xD
Berichten: 120
avatar
Offline Stuur privebericht
Hallo criminalspoint.

Ik ben bezig met een pm systeem,
maar ik heb problemen met het afronden ervan.
Ik krijg een parse error op de laatste lijn.

error:
Code | Selecteer Alles
minimaliseren
1
Parse errorparse error in C:wampwwwbetaphppm.php on line 479


script:
Code | Selecteer Alles
minimaliseren
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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
<?php
if (!empty($_SESSION['id'])) {
if (
online($_SESSION['id']) == true){
$mededeling1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='2' AND `read`='0'");
$mededeling mysql_num_rows($mededeling1);
$inbox1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='1' AND `read`='0'");
$inbox mysql_num_rows($inbox1);
if(!isset(
$_GET['box'])){
$box 1;
}
if(
$_GET['box'] == system){
$box 2;
}
if(
$_GET['box'] == sent){
$box 3;
}
?>                                <div class="news">
            
                    <div class="cBoxHeader"><h2><b>Personal messages Center</b></h2></div>
                <div class="cBoxBg">
                    <div class="cBoxText">

        <div style="background-color:#dbd2b7; padding:10px; padding-top:4px;" width="500px">
        <table cellpadding="0" cellspacing="0" width="100%"><tr><td>
            <table width="97%">
        <tr>
            <td width="20%" align="center">
                <img src="inc/img/email.gif" border="0px" align="absmiddle">
                <a href="?p=pm"><b>Inbox (<?php echo $inbox?>)</b></a>
            </td>
            <td width="20%" align="center">
                <img src="inc/img/email_error.png" border="0px" align="absmiddle">
                <a href="?p=pm&box=system"><b>Announcements (<?php echo $mededeling?>)</b></a>
            </td>
            <td width="20%" align="center">
                <img src="inc/img/email_go.png" border="0px" align="absmiddle">
                <a href="?p=pm&box=sent"><b>Sent</b></a>
            </td>
            <td width="20%" align="center">
                <img src="inc/img/email_add.gif" border="0px" align="absmiddle">
                <a href="?p=pm&box=new"><b>New</b></a>
            </td>
            <td width="20%" align="center">
                <img src="inc/img/delete.gif" border="0px" align="absmiddle">
                <a href="?p=pm&clear"><b>Remove all messages</b></a>
            </td>
        </tr>
        <tr>
            <td colspan="5">
                <hr>
                <!-- INBOX -->
<?php
if(isset($_GET['sendmessage'])){
?>
                                <table width="100%">
                    <tr>
                        <td>
<?php
if(isset($_POST['verzenden'])){
$blacklist1                mysql_query("SELECT * FROM `contacts` WHERE `level`='0' AND `owner`='{$_POST['to']}' AND `person`='"$_SESSION['id']."'");
$blacklist mysql_num_rows($blacklist1);
if(
$blacklist 1){
$date2 = (date('m/d H:i'));
$to $_POST['to'];
$subject $_POST['subject'];
$content $_POST['content'];
$_SESSION['mission'] = "Stuur iemand een Privé bericht";
        
mysql_query("INSERT INTO `messages`(`date`,`to`,`from`,`ip`,`title`,`content`,`date2`,`read`,`inbox`,`reply`) values(NOW(),'$to','".nickname($_SESSION['id'])."','$data->ip','$subject','$content','$date2','0','1','{$_GET['reply']}')");
        
mysql_query("INSERT INTO `messages`(`date`,`to2`,`from`,`ip`,`title`,`content`,`date2`,`read`,`inbox`,`reply`) values(NOW(),'$to','".nickname($_SESSION['id'])."','$data->ip','$subject','$content','$date2','0','3','{$_GET['reply']}')");
$contact1 mysql_query("SELECT * FROM `contacts` WHERE `owner`='".$_SESSION['id']."' AND `person`='{$_POST['to']}'");
$contact mysql_num_rows($contact1);
if(
$contact 1){
if(isset(
$_POST['add_friend'])){
        
mysql_query("INSERT INTO `contacts`(`person`,`owner`) values( '{$_POST['to']}','".$_SESSION['id']."')");
}
}
}
}
if(
$blacklist 1){
?>

                            Message has been sent!
<?php
}
else{
?>

       <?php error("{$_POST['to']}  Has added you to his blocklist!");?>
<?php
}
if(!isset(
$_POST['verzenden'])){
?>
                            The message has<b> not</b> been send.
<?php
}
?>
                                           </td>
                    </tr>
                </table>

            </td>
<?php
}
if(isset(
$_GET['del'])){
mysql_query("DELETE FROM `messages` WHERE `id`='{$_GET['del']}' AND `to`='".nickname($_SESSION['id'])."'");
mysql_query("DELETE FROM `messages` WHERE `id`='{$_GET['del']}' AND `from`='".nickname($_SESSION['id'])."' AND `inbox`='3'");
}
if(isset(
$_GET['clear'])){
mysql_query("DELETE FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."'");
mysql_query("DELETE FROM `messages` WHERE `from`='".nickname($_SESSION['id'])."' AND `inbox`='3'");}
if(
$_GET['box'] != "new"){
if(!isset(
$_GET['sendmessage'])){
if(!isset(
$_GET['x']))
{
?>
                                <table width='100%' border='0' class='mod_list' cellspacing='2' cellpadding='2' align='center'>
                    <tr>
                        <td width='5%' align='center'>#</td>
                        <td width=5%></td>
                        <td width='50%' align='left'><b>Subject</b></td>
                        <td width='20%' align='left'><b>From</b></td>
                        <td width='15%' align='left'><b>Date</b></td>
                        <td width=5%></td>
                    </tr>
<?php
$begin 
= ($_GET['p'] >= 0) ? $_GET['p']*15 0;
if(
$_GET['box'] == ""){
$message1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."'");
$msg1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='1'");
    
$dbres                mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='1' ORDER BY `date` LIMIT $begin,15");
}
if(
$_GET['box'] == "system"){
$message1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."'");
$msg1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='2'");
    
$dbres                mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='2' ORDER BY `date` LIMIT $begin,15");
}
if(
$_GET['box'] == "sent"){
$message1 mysql_query("SELECT * FROM `messages` WHERE `from`='".$_SESSION['id']."'");
$msg1 mysql_query("SELECT * FROM `messages` WHERE `from`='".$_SESSION['id']."' AND `inbox`='3'");
    
$dbres                mysql_query("SELECT * FROM `messages` WHERE `from`='".nickname($_SESSION['id'])."' AND `inbox`='3' ORDER BY `date` LIMIT $begin,15");
}
  for(
$j=$begin+1$info mysql_fetch_object($dbres); $j++)
{
$message mysql_fetch_object($message1);
$msgcount mysql_num_rows($message1);
$mscountfix $message1;
$msg mysql_num_rows($msg1);
$pages floor($msg/15+1);
?>
                                        <tr>
                        <td align="center"><?php echo $j?></td>
                        <td align="center">
<?php if($info->read == 0){ ?>
                                                            <img title="Not read" src="inc/img/email.gif">
<?php
}
if(
$info->read == 1){?>
                                                            <img title="Read" src="inc/img/email_open.gif">
<?php
}
?>

                                                    </td>
                        <td><a href="?p=pm&x=<?php echo $info->id?>"><?php echo $info->title?></a></td>
                        <td>
                        <?php echo $info->from?>
                                                    </td>
                        <td><?php echo $info->date2?></td>
                        <td align="center">
                            <a href="?p=pm&del=<?php echo $info->id?>"><img src='inc/img/cross.gif' border='0' alt='Remove'></a>
                        </td>
<?php
}
?>
                    </tr>
                                    </table>
<?php
}else{
$openmessage3 mysql_query("SELECT * FROM `messages` WHERE `from`='".nickname($_SESSION['id'])."' AND `id`='{$_GET['x']}'");
$openmessage2 mysql_fetch_object($openmessage3);
if(
$openmessage2->inbox != 3){
$openmessage1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `id`='{$_GET['x']}'");
}
else{
$openmessage1 mysql_query("SELECT * FROM `messages` WHERE `from`='".nickname($_SESSION['id'])."' AND `id`='{$_GET['x']}'");
}
$openmessage mysql_fetch_object($openmessage1);
$sentuser1 mysql_query("SELECT * FROM `players` WHERE `login`='".$openmessage->from."'");
$sentuser mysql_fetch_object($sentuser1);
if(
$openmessage2->inbox != 3){
mysql_query("UPDATE `messages` SET `read`='1' WHERE `id`='{$_GET['x']}' AND `to`='".nickname($_SESSION['id'])."'");
}
else{
mysql_query("UPDATE `messages` SET `read`='1' WHERE `id`='{$_GET['x']}' AND `from`='".nickname($_SESSION['id'])."'");
}
?>
                <!-- MEDEDELINGEN -->

                <!-- VERZONDEN -->

                <!-- OPEN BERICHT -->
<br>
                <table width="100%">
                    <tr>
                        <td><b>From</b>:</td>
                        <td>
                            <?php echo $openmessage->from?>                                

                    </tr>
                    <tr>
                        <td><b>Date</b>:</td>
                        <td><?php echo $openmessage->date?></td>
                    </tr>
                    <tr>
                        <td><b>To</b>:</td>
<td><?php if($openmessage->inbox != 3){echo $openmessage->to;}else{echo $openmessage->to2;} ?></td>
                    </tr>
                    <tr>
                        <td><b>Subject</b>:</td>
                        <td>
                            <?php echo $openmessage->title?>                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"><hr></td>
                    </tr>
<?php
        $openmessage
->content         htmlspecialchars($openmessage->content);
           
$openmessage->content         nl2br($openmessage->content);
        
$openmessage->content         str_replace("[b]""<b>",$openmessage->content);
        
$openmessage->content         str_replace("[/b]""</b>",$openmessage->content);
        
$openmessage->content         str_replace("[i]""<i>",$openmessage->content);
        
$openmessage->content         str_replace("[/i]""</i>",$openmessage->content);
        
$openmessage->content         str_replace("[u]""<u>",$openmessage->content);
        
$openmessage->content         str_replace("[/u]""</u>",$openmessage->content);
        
$openmessage->content         str_replace("[center]""<center>",$openmessage->content);
        
$openmessage->content         str_replace("[/center]""</center>",$openmessage->content);
    
$openmessage->content str_replace(":)","<img src=$sitelink/v3/images/smiles/icon_smile.gif>"$openmessage->content);
    
$openmessage->content str_replace(":D","<img src=$sitelink/v3/images/smiles/icon_biggrin.gif>"$openmessage->content);
    
$openmessage->content str_replace(";)","<img src=$sitelink/v3/images/smiles/icon_wink.gif>"$openmessage->content);
    
$openmessage->content str_replace(":(","<img src=$sitelink/v3/images/smiles/icon_sad.gif>"$openmessage->content);
        
$openmessage->content         eregi_replace("\[quote]([^\[]*)\[/quote\]","<table width=90% cellspacing=1 cellpadding=3 border=0 class=quote><tr><td><b>Quote:</b></td></tr><td class=quote>\1</td></table>",$openmessage->content);
        
$openmessage->content         str_replace("[quote]""",$openmessage->content);
        
$openmessage->content         str_replace("[/quote]""",$openmessage->content);
    
?>
                    <tr>
                        <td colspan="2">
                        <?php echo $openmessage->content?>
                        </td>
                    </tr>
<?php if($openmessage->reply != -1){ ?>
                                        <tr>
                        <td colspan="2" align="right">
                    <form method="POST" action="?p=pm&box=new&reply=<?php echo $openmessage->id?>" onsubmit="return checkError(this);">
                            <input type="submit" class="mod_submit" value="Reply" name="answer">
                    </form>
                        </td>
                    </tr>
<?php}?>
                                    </table>

            </td>
        </tr>
<?php}}}?>
                <!-- NIEUW BERICHT -->
<?php
if($_GET['box'] == "new"){
if(isset(
$_POST['answer'])){
if(!isset(
$_GET['reply'])){
$isreply 0;
}
if(isset(
$_GET['reply'])){
$isreply 1;
$reply1 mysql_query("SELECT * FROM `messages` WHERE `id`='{$_GET['reply']}'");
$reply mysql_fetch_object($reply1);
}
}
else{
$isreply 0;
}
?>

                <script language="javascript">
                    var contact_book;

                    function check_contact(){
                        if(document.getElementById('contact').value != '') document.getElementById('to').value = document.getElementById('contact')[document.getElementById('contact').options.selectedIndex].text;
                        document.getElementById('to').readOnly = (document.getElementById('contact').value != '');
                    }

                    function select_user_popup(pUser){
                        document.getElementById('to').value = pUser;
                        contact_book.close();
                        document.getElementById('contact').options.selectedIndex = 0;
                        document.getElementById('to').readOnly = false;
                    }

                </script>
                <table width="100%">
                    <form method="POST" action="?p=pm&sendmessage&reply=<?php echo $isreply?>" onsubmit="return checkError(this);">
<?php
$dbres 
mysql_query("SELECT * FROM `contacts` WHERE `owner`='".$_SESSION['id']."' AND `level`='1'");
?>
                        <td>To:</td>
                        <td>
<?php
if($isreply == 1){?>
                            <input type="text" id="to" name="to" size="25" value="<?php echo nickname($reply->from); ?>" class="input">
<?php
}
else{
?>
                            <input type="text" id="to" name="to" size="25" value="<?php echo $_GET['to']; ?>" class="input">
<?php
}
?>
                        </td>
                        <td>
                                                        <select name="contact" id="contact" onchange="check_contact()">
                                <option value="">-- Choose a friend --</option>
<?php
  
for($j=$begin+1$info mysql_fetch_object($dbres); $j++)
{
$friend1 mysql_query("SELECT * FROM `players` WHERE `login`='$info->person'");
$friend mysql_fetch_object($friend1);
?>
                                                                    <option value="<?php echo $friend->id?>"><?php echo $info->person?></option>
<?php
}
?>
                                                            </select>
                                                    </td>
                    </tr>
                    <tr>
                        <td>Subject:</td>
                        <td>
<?php
if($isreply == 1){?>
                            <input type="text" name="subject" size="25" value="Re: <?php echo $reply->title?>" class="input">
<?php
}
else{
?>
                            <input type="text" name="subject" size="25" value="" class="input">
<?php
}
?>
                        </td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <hr>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
<?php
if($isreply == 1){
        
$reply->content         str_replace("[quote]""",$reply->content);
        
$reply->content         str_replace("[/quote]""",$reply->content);
?>
                            <textarea name="content" style="width:100%" rows="7" class="input">[quote]<?php echo $reply->content?>[/quote]</textarea>
<?php
}
else{
?>
                            <textarea name="content" style="width:100%" rows="7" class="input"></textarea>
<?php
}
?>

                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <input type="checkbox" name="add_friend" value="1" class="input"> Add as friend.                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <input type="submit" class="mod_submit" name="verzenden" value="Versturen">
                        </td>
                    </tr>
                    </form>
                </table>
<?php
}
?>

                <script language="javascript">
                    function checkError(pForm){
                        var errormsg = '';

                        if(pForm.subject.value == '') errormsg += 'Er is geen onderwerp ingevuld!<br>';
                        if(pForm.to.value == '') errormsg += 'Er is geen ontvanger ingevuld!<br>';
                        if(pForm.content.value == '') errormsg += 'Er is geen inhoud ingevuld!<br>';

                        if(errormsg != ''){
                            showError(errormsg);
                            return false;
                        }
                        return true;
                    }
                </script>





                <!-- BERICHT COMMUNICATIE -->
            </td>
        </tr>





<?php
if(!isset($_GET['x']))
{
if(
$_GET['box'] != "new"){
if(
$pages 1){
$prev $_GET['p']-1;
$next $_GET['p']+1;
if(
$_GET['box'] == ""){
$dbres mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='1'");
}
if(
$_GET['box'] == system){
$dbres mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='2'");
}
if(
$_GET['box'] == sent){
$dbres mysql_query("SELECT * FROM `messages` WHERE `from` = '".nickname($_SESSION['id'])."' AND `inbox`='3'");
}
  echo 
"</table>nn<table width=100%>n  <tr><td class=\"mainTxt\" align=\"center\">";
  if(
mysql_num_rows($dbres) <= -1) {
    echo 
"&#60; 1 &#62;</td></tr></table>n";
    }
  else {
    if(
$begin/15 == 0) {
      echo 
"&#60;&#60; Vorige | ";
      }
    else {
      echo 
"<a href=\"?p=pm&box={$_GET['box']}&p=". ($begin/15-1) ."\">&#60;&#60; Vorige</a> | ";
}
    for(
$i=0$i<mysql_num_rows($dbres)/15$i++) {
$j $i+1;
      echo 
"<a href=\"?p=pm&box={$_GET['box']}&p=$i\">$j</a> | ";
    }

    if(
$begin+15 >= mysql_num_rows($dbres)) {
      echo 
"Volgende &#62;&#62; ";
      }
    else {
      echo 
"<a href=\"?p=pm&box={$_GET['box']}&p=". ($begin/15+1) ."\">Volgende &#62;&#62;</a>";
  }
  }
  }
  }
  }
?>
                                                </td>
            </tr>
    </table>
        </td></tr></table>
        </div>

        <table width='100%' cellspacing='2' cellpadding='2'>
            <tr>

                <td class='content_bottom' width="550px"></td>
            </tr>
        </table>
                
    </td>
    </tr>

    </table>
    </td>
    </div></div></div>
<?php
}
}
?>


ik hoop dat het valt op te lossen.

bij voorbaat dank, AeroXbird
Laatst gewijzigd door AeroXbird op 2010-06-08 19:52:22
08-06-2010 19:52
Dit topic is 171 keer bekeken door 52 verschillende leden
Reacties op: "PM systeem"
1
Dupstep
Berichten: 2302
avatar
Offline Stuur privébericht
Code | Selecteer Alles
minimaliseren
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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
<?php 
if (!empty($_SESSION['id'])) { 
if (
online($_SESSION['id']) == true){ 
$mededeling1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='2' AND `read`='0'"); 
$mededeling mysql_num_rows($mededeling1); 
$inbox1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='1' AND `read`='0'"); 
$inbox mysql_num_rows($inbox1); 
if(!isset(
$_GET['box'])){ 
$box 1

if(
$_GET['box'] == system){ 
$box 2

if(
$_GET['box'] == sent){ 
$box 3

?>                                <div class="news"> 
             
                    <div class="cBoxHeader"><h2><b>Personal messages Center</b></h2></div> 
                <div class="cBoxBg"> 
                    <div class="cBoxText"> 

        <div style="background-color:#dbd2b7; padding:10px; padding-top:4px;" width="500px"> 
        <table cellpadding="0" cellspacing="0" width="100%"><tr><td> 
            <table width="97%"> 
        <tr> 
            <td width="20%" align="center"> 
                <img src="inc/img/email.gif" border="0px" align="absmiddle"> 
                <a href="?p=pm"><b>Inbox (<?php echo $inbox?>)</b></a> 
            </td> 
            <td width="20%" align="center"> 
                <img src="inc/img/email_error.png" border="0px" align="absmiddle"> 
                <a href="?p=pm&box=system"><b>Announcements (<?php echo $mededeling?>)</b></a> 
            </td> 
            <td width="20%" align="center"> 
                <img src="inc/img/email_go.png" border="0px" align="absmiddle"> 
                <a href="?p=pm&box=sent"><b>Sent</b></a> 
            </td> 
            <td width="20%" align="center"> 
                <img src="inc/img/email_add.gif" border="0px" align="absmiddle"> 
                <a href="?p=pm&box=new"><b>New</b></a> 
            </td> 
            <td width="20%" align="center"> 
                <img src="inc/img/delete.gif" border="0px" align="absmiddle"> 
                <a href="?p=pm&clear"><b>Remove all messages</b></a> 
            </td> 
        </tr> 
        <tr> 
            <td colspan="5"> 
                <hr> 
                <!-- INBOX --> 
<?php 
if(isset($_GET['sendmessage'])){ 
?> 
                                <table width="100%"> 
                    <tr> 
                        <td> 
<?php 
if(isset($_POST['verzenden'])){ 
$blacklist1                mysql_query("SELECT * FROM `contacts` WHERE `level`='0' AND `owner`='{$_POST['to']}' AND `person`='"$_SESSION['id']."'"); 
$blacklist mysql_num_rows($blacklist1); 
if(
$blacklist 1){ 
$date2 = (date('m/d H:i')); 
$to $_POST['to']; 
$subject $_POST['subject']; 
$content $_POST['content']; 
$_SESSION['mission'] = "Stuur iemand een Privé bericht"
        
mysql_query("INSERT INTO `messages`(`date`,`to`,`from`,`ip`,`title`,`content`,`date2`,`read`,`inbox`,`reply`) values(NOW(),'$to','".nickname($_SESSION['id'])."','$data->ip','$subject','$content','$date2','0','1','{$_GET['reply']}')"); 
        
mysql_query("INSERT INTO `messages`(`date`,`to2`,`from`,`ip`,`title`,`content`,`date2`,`read`,`inbox`,`reply`) values(NOW(),'$to','".nickname($_SESSION['id'])."','$data->ip','$subject','$content','$date2','0','3','{$_GET['reply']}')"); 
$contact1 mysql_query("SELECT * FROM `contacts` WHERE `owner`='".$_SESSION['id']."' AND `person`='{$_POST['to']}'"); 
$contact mysql_num_rows($contact1); 
if(
$contact 1){ 
if(isset(
$_POST['add_friend'])){ 
        
mysql_query("INSERT INTO `contacts`(`person`,`owner`) values( '{$_POST['to']}','".$_SESSION['id']."')"); 




if(
$blacklist 1){ 
?> 

                            Message has been sent! 
<?php 

else{ 
?> 

       <?php error("{$_POST['to']}  Has added you to his blocklist!");?> 
<?php 

if(!isset(
$_POST['verzenden'])){ 
?> 
                            The message has<b> not</b> been send. 
<?php 

?> 
                                           </td> 
                    </tr> 
                </table> 

            </td> 
<?php 

if(isset(
$_GET['del'])){ 
mysql_query("DELETE FROM `messages` WHERE `id`='{$_GET['del']}' AND `to`='".nickname($_SESSION['id'])."'"); 
mysql_query("DELETE FROM `messages` WHERE `id`='{$_GET['del']}' AND `from`='".nickname($_SESSION['id'])."' AND `inbox`='3'"); 

if(isset(
$_GET['clear'])){ 
mysql_query("DELETE FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."'"); 
mysql_query("DELETE FROM `messages` WHERE `from`='".nickname($_SESSION['id'])."' AND `inbox`='3'");} 
if(
$_GET['box'] != "new"){ 
if(!isset(
$_GET['sendmessage'])){ 
if(!isset(
$_GET['x'])) 

?> 
                                <table width='100%' border='0' class='mod_list' cellspacing='2' cellpadding='2' align='center'> 
                    <tr> 
                        <td width='5%' align='center'>#</td> 
                        <td width=5%></td> 
                        <td width='50%' align='left'><b>Subject</b></td> 
                        <td width='20%' align='left'><b>From</b></td> 
                        <td width='15%' align='left'><b>Date</b></td> 
                        <td width=5%></td> 
                    </tr> 
<?php 
$begin 
= ($_GET['p'] >= 0) ? $_GET['p']*15 0
if(
$_GET['box'] == ""){ 
$message1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."'"); 
$msg1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='1'"); 
    
$dbres                mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='1' ORDER BY `date` LIMIT $begin,15"); 

if(
$_GET['box'] == "system"){ 
$message1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."'"); 
$msg1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='2'"); 
    
$dbres                mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='2' ORDER BY `date` LIMIT $begin,15"); 

if(
$_GET['box'] == "sent"){ 
$message1 mysql_query("SELECT * FROM `messages` WHERE `from`='".$_SESSION['id']."'"); 
$msg1 mysql_query("SELECT * FROM `messages` WHERE `from`='".$_SESSION['id']."' AND `inbox`='3'"); 
    
$dbres                mysql_query("SELECT * FROM `messages` WHERE `from`='".nickname($_SESSION['id'])."' AND `inbox`='3' ORDER BY `date` LIMIT $begin,15"); 

  for(
$j=$begin+1$info mysql_fetch_object($dbres); $j++) 

$message mysql_fetch_object($message1); 
$msgcount mysql_num_rows($message1); 
$mscountfix $message1
$msg mysql_num_rows($msg1); 
$pages floor($msg/15+1); 
?> 
                                        <tr> 
                        <td align="center"><?php echo $j?></td> 
                        <td align="center"> 
<?php if($info->read == 0){ ?> 
                                                            <img title="Not read" src="inc/img/email.gif"> 
<?php 

if(
$info->read == 1){?> 
                                                            <img title="Read" src="inc/img/email_open.gif"> 
<?php 

?> 

                                                    </td> 
                        <td><a href="?p=pm&x=<?php echo $info->id?>"><?php echo $info->title?></a></td> 
                        <td> 
                        <?php echo $info->from?> 
                                                    </td> 
                        <td><?php echo $info->date2?></td> 
                        <td align="center"> 
                            <a href="?p=pm&del=<?php echo $info->id?>"><img src='inc/img/cross.gif' border='0' alt='Remove'></a> 
                        </td> 
<?php 

?> 
                    </tr> 
                                    </table> 
<?php 
}else{ 
$openmessage3 mysql_query("SELECT * FROM `messages` WHERE `from`='".nickname($_SESSION['id'])."' AND `id`='{$_GET['x']}'"); 
$openmessage2 mysql_fetch_object($openmessage3); 
if(
$openmessage2->inbox != 3){ 
$openmessage1 mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `id`='{$_GET['x']}'"); 

else{ 
$openmessage1 mysql_query("SELECT * FROM `messages` WHERE `from`='".nickname($_SESSION['id'])."' AND `id`='{$_GET['x']}'"); 

$openmessage mysql_fetch_object($openmessage1); 
$sentuser1 mysql_query("SELECT * FROM `players` WHERE `login`='".$openmessage->from."'"); 
$sentuser mysql_fetch_object($sentuser1); 
if(
$openmessage2->inbox != 3){ 
mysql_query("UPDATE `messages` SET `read`='1' WHERE `id`='{$_GET['x']}' AND `to`='".nickname($_SESSION['id'])."'"); 

else{ 
mysql_query("UPDATE `messages` SET `read`='1' WHERE `id`='{$_GET['x']}' AND `from`='".nickname($_SESSION['id'])."'"); 

?> 
                <!-- MEDEDELINGEN --> 

                <!-- VERZONDEN --> 

                <!-- OPEN BERICHT --> 
<br> 
                <table width="100%"> 
                    <tr> 
                        <td><b>From</b>:</td> 
                        <td> 
                            <?php echo $openmessage->from?>                                 

                    </tr> 
                    <tr> 
                        <td><b>Date</b>:</td> 
                        <td><?php echo $openmessage->date?></td> 
                    </tr> 
                    <tr> 
                        <td><b>To</b>:</td> 
<td><?php if($openmessage->inbox != 3){echo $openmessage->to;}else{echo $openmessage->to2;} ?></td> 
                    </tr> 
                    <tr> 
                        <td><b>Subject</b>:</td> 
                        <td> 
                            <?php echo $openmessage->title?>                        </td> 
                    </tr> 
                    <tr> 
                        <td colspan="2"><hr></td> 
                    </tr> 
<?php 
        $openmessage
->content         htmlspecialchars($openmessage->content); 
           
$openmessage->content         nl2br($openmessage->content); 
        
$openmessage->content         str_replace("[b]""<b>",$openmessage->content); 
        
$openmessage->content         str_replace("[/b]""</b>",$openmessage->content); 
        
$openmessage->content         str_replace("[i]""<i>",$openmessage->content); 
        
$openmessage->content         str_replace("[/i]""</i>",$openmessage->content); 
        
$openmessage->content         str_replace("[u]""<u>",$openmessage->content); 
        
$openmessage->content         str_replace("[/u]""</u>",$openmessage->content); 
        
$openmessage->content         str_replace("[center]""<center>",$openmessage->content); 
        
$openmessage->content         str_replace("[/center]""</center>",$openmessage->content); 
    
$openmessage->content str_replace(":)","<img src=$sitelink/v3/images/smiles/icon_smile.gif>"$openmessage->content); 
    
$openmessage->content str_replace(":D","<img src=$sitelink/v3/images/smiles/icon_biggrin.gif>"$openmessage->content); 
    
$openmessage->content str_replace(";)","<img src=$sitelink/v3/images/smiles/icon_wink.gif>"$openmessage->content); 
    
$openmessage->content str_replace(":(","<img src=$sitelink/v3/images/smiles/icon_sad.gif>"$openmessage->content); 
        
$openmessage->content         eregi_replace("[quote]([^[]*)[/quote]","<table width=90% cellspacing=1 cellpadding=3 border=0 class=quote><tr><td><b>Quote:</b></td></tr><td class=quote>1</td></table>",$openmessage->content); 
        
$openmessage->content         str_replace("[quote]""",$openmessage->content); 
        
$openmessage->content         str_replace("[/quote]""",$openmessage->content); 
    
?> 
                    <tr> 
                        <td colspan="2"> 
                        <?php echo $openmessage->content?> 
                        </td> 
                    </tr> 
<?php if($openmessage->reply != -1){ ?> 
                                        <tr> 
                        <td colspan="2" align="right"> 
                    <form method="POST" action="?p=pm&box=new&reply=<?php echo $openmessage->id?>" onsubmit="return checkError(this);"> 
                            <input type="submit" class="mod_submit" value="Reply" name="answer"> 
                    </form> 
                        </td> 
                    </tr> 
<?php
}
?> 
                                    </table> 

            </td> 
        </tr> 
<?php
?>
 
                <!-- NIEUW BERICHT --> 
<?php 
if($_GET['box'] == "new"){ 
if(isset(
$_POST['answer'])){ 
if(!isset(
$_GET['reply'])){ 
$isreply 0

if(isset(
$_GET['reply'])){ 
$isreply 1
$reply1 mysql_query("SELECT * FROM `messages` WHERE `id`='{$_GET['reply']}'"); 
$reply mysql_fetch_object($reply1); 


else{ 
$isreply 0

?> 

                <script language="javascript"> 
                    var contact_book; 

                    function check_contact(){ 
                        if(document.getElementById('contact').value != '') document.getElementById('to').value = document.getElementById('contact')[document.getElementById('contact').options.selectedIndex].text; 
                        document.getElementById('to').readOnly = (document.getElementById('contact').value != ''); 
                    } 

                    function select_user_popup(pUser){ 
                        document.getElementById('to').value = pUser; 
                        contact_book.close(); 
                        document.getElementById('contact').options.selectedIndex = 0; 
                        document.getElementById('to').readOnly = false; 
                    } 

                </script> 
                <table width="100%"> 
                    <form method="POST" action="?p=pm&sendmessage&reply=<?php echo $isreply?>" onsubmit="return checkError(this);"> 
<?php 
$dbres 
mysql_query("SELECT * FROM `contacts` WHERE `owner`='".$_SESSION['id']."' AND `level`='1'"); 
?> 
                        <td>To:</td> 
                        <td> 
<?php 
if($isreply == 1){?> 
                            <input type="text" id="to" name="to" size="25" value="<?php echo nickname($reply->from); ?>" class="input"> 
<?php 

else{
?> 
                            <input type="text" id="to" name="to" size="25" value="<?php echo $_GET['to']; ?>" class="input"> 
<?php 

?> 
                        </td> 
                        <td> 
                                                        <select name="contact" id="contact" onchange="check_contact()"> 
                                <option value="">-- Choose a friend --</option> 
<?php 
  
for($j=$begin+1$info mysql_fetch_object($dbres); $j++) 

$friend1 mysql_query("SELECT * FROM `players` WHERE `login`='$info->person'"); 
$friend mysql_fetch_object($friend1); 
?> 
                                                                    <option value="<?php echo $friend->id?>"><?php echo $info->person?></option> 
<?php 

?> 
                                                            </select> 
                                                    </td> 
                    </tr> 
                    <tr> 
                        <td>Subject:</td> 
                        <td> 
<?php 
if($isreply == 1){?> 
                            <input type="text" name="subject" size="25" value="Re: <?php echo $reply->title?>" class="input"> 
<?php 

else{
?> 
                            <input type="text" name="subject" size="25" value="" class="input"> 
<?php 

?> 
                        </td> 
                        <td>&nbsp;</td> 
                    </tr> 
                    <tr> 
                        <td colspan="3"> 
                            <hr> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td colspan="3"> 
<?php 
if($isreply == 1){ 
        
$reply->content         str_replace("[quote]""",$reply->content); 
        
$reply->content         str_replace("[/quote]""",$reply->content); 
?> 
                            <textarea name="content" style="width:100%" rows="7" class="input">[quote]<?php echo $reply->content?>[/quote]</textarea> 
<?php 

else{
?> 
                            <textarea name="content" style="width:100%" rows="7" class="input"></textarea> 
<?php 

?> 

                        </td> 
                    </tr> 
                    <tr> 
                        <td colspan="3"> 
                            <input type="checkbox" name="add_friend" value="1" class="input"> Add as friend.                        </td> 
                    </tr> 
                    <tr> 
                        <td colspan="3"> 
                            <input type="submit" class="mod_submit" name="verzenden" value="Versturen"> 
                        </td> 
                    </tr> 
                    </form> 
                </table> 
<?php 

?> 

                <script language="javascript"> 
                    function checkError(pForm){ 
                        var errormsg = ''; 

                        if(pForm.subject.value == '') errormsg += 'Er is geen onderwerp ingevuld!<br>'; 
                        if(pForm.to.value == '') errormsg += 'Er is geen ontvanger ingevuld!<br>'; 
                        if(pForm.content.value == '') errormsg += 'Er is geen inhoud ingevuld!<br>'; 

                        if(errormsg != ''){ 
                            showError(errormsg); 
                            return false; 
                        } 
                        return true; 
                    } 
                </script> 





                <!-- BERICHT COMMUNICATIE --> 
            </td> 
        </tr> 





<?php 
if(!isset($_GET['x'])) 

if(
$_GET['box'] != "new"){ 
if(
$pages 1){ 
$prev $_GET['p']-1
$next $_GET['p']+1
if(
$_GET['box'] == ""){ 
$dbres mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='1'"); 

if(
$_GET['box'] == system){ 
$dbres mysql_query("SELECT * FROM `messages` WHERE `to`='".nickname($_SESSION['id'])."' AND `inbox`='2'"); 

if(
$_GET['box'] == sent){ 
$dbres mysql_query("SELECT * FROM `messages` WHERE `from` = '".nickname($_SESSION['id'])."' AND `inbox`='3'"); 

  echo 
"</table>nn<table width=100%>n  <tr><td class="mainTxt" align="center">"
  if(
mysql_num_rows($dbres) <= -1) { 
    echo 
"&#60; 1 &#62;</td></tr></table>n"
    } 
  else { 
    if(
$begin/15 == 0) { 
      echo 
"&#60;&#60; Vorige | "
      } 
    else { 
      echo 
"<a href="?p=pm&box={$_GET['box']}&p=". ($begin/15-1) ."">&#60;&#60; Vorige</a> | "

    for(
$i=0$i<mysql_num_rows($dbres)/15$i++) { 
$j $i+1
      echo 
"<a href="?p=pm&box={$_GET['box']}&p=$i">$j</a> | "
    } 

    if(
$begin+15 >= mysql_num_rows($dbres)) { 
      echo 
"Volgende &#62;&#62; "
      } 
    else { 
      echo 
"<a href="?p=pm&box={$_GET['box']}&p=". ($begin/15+1) ."">Volgende &#62;&#62;</a>"
  } 
  } 
  } 
  } 
  } 
?> 
                                                </td> 
            </tr> 
    </table> 
        </td></tr></table> 
        </div> 

        <table width='100%' cellspacing='2' cellpadding='2'> 
            <tr> 

                <td class='content_bottom' width="550px"></td> 
            </tr> 
        </table> 
                 
    </td> 
    </tr> 

    </table> 
    </td> 
    </div></div></div> 
<?php 


}
}
}
?>

probeer deze is

Nieuwe reactie samengevoegd met originele reactie op 08.06.10 20:01:08:
en nog een tip, gebruik <br /> i.p.v. <br>
08-06-2010 20:00
Lua/PHP scriptorrrrrr xD
Berichten: 120
avatar
Offline Stuur privébericht
Nu werkt het, maar even een vraagje: wat heb je precies gedaan?
Dat helpt mij weer tijdens het debuggen
08-06-2010 20:01
Dupstep
Berichten: 2302
avatar
Offline Stuur privébericht
Gewoon, je hebt je } te vroeg afgesloten (weet regel niet meer)
<?php}?> deed je.
Maar ik heb die weggehaald en op het einde gedaan
08-06-2010 20:02
Lua/PHP scriptorrrrrr xD
Berichten: 120
avatar
Offline Stuur privébericht
Dankjewel
kan een op
08-06-2010 20:05
Dupstep
Berichten: 2302
avatar
Offline Stuur privébericht
En volg men tip op (<br /> in plaats van <br>
08-06-2010 20:06
Lua/PHP scriptorrrrrr xD
Berichten: 120
avatar
Offline Stuur privébericht
Dat doe ik altijd al, gewoon niet opgelet
08-06-2010 21:00
Dupstep
Berichten: 2302
avatar
Offline Stuur privébericht
Ok, mooi zo
Tevreden ?
08-06-2010 21:01
Reageer op: "PM systeem"
1
Je kan niet reageren omdat je niet bent ingelogd. Inloggen of Aanmelden