Bij onderstaande code word de fout: 'top.wOut.document.body is leeg of geen object' weergegeven.
Waar kan de fout zitten?
Script komt van http://warpspeed.4thdimension.de
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
| <? /************************************************************************/ /* 4nChat Version 0.92 (German & English) */ /* for phpNUKE Version 6.5 - 7.0 (http://phpnuke.org) */ /* ==================================================================== */ /* By WarpSpeed (Marco Wiesler) (warpspeed@4thDimension.de) @ Nov/2oo3 */ /* http://www.warp-speed.de @ 4thDimension.de Networking */ /* ==================================================================== */ /* Based on: */ /* PHPNukeWebChat v2.0 */ /* =================== */ /* Author: Frank Wallacher */ /* Web: http://www.saarport.net */ /* ==================================================================== */ /* This program is free software. You can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License. */ /************************************************************************/ ?> <html> <head> <script> <? require("./inc/config.php"); require("./inc/mysql.lib.php"); require("./inc/smiley.php"); if(file_exists("language/lang-$lang.php")) include("language/lang-$lang.php"); else include("language/lang-english.php"); set_magic_quotes_runtime(0); $DbLink = new DB($dbhost, $dbname, $dbuname, $dbpass); $DbUsers = new DB($dbhost, $dbname, $dbuname, $dbpass); $DbSmiles = new DB($dbhost, $dbname, $dbuname, $dbpass); $tstamp = time(); $tstamp -= $usertime; $DbLink->query("DELETE from ".$prefix."_4nchatuser WHERE last < '".$tstamp."'"); $DbLink->query("DELETE from ".$prefix."_4nchatmessage WHERE time < '".$tstamp."'"); $toOut = ""; if(isset($first)) { $toOut = "<font class=\"sysmessage\">"._WCCHATWELCOME."</font>"; $msgLastCheck = time(); } $usersounds = array(); $DbLink->query("select m.send_id, m.rcpt_id, m.cmd, m.message, m.time from ".$prefix."_4nchatmessage as m, ".$prefix."_4nchatuser as u where m.time > '$msgLastCheck' and u.uid = $uid and m.rid = $rid and ((m.rcpt_id <= 0 ) or (m.rcpt_id = $uid )) order by m.time"); if($DbLink->num_rows() > 0) { while(list($send_id, $rcpt_id, $cmd, $message, $time) = $DbLink->next_record()) { $message = smiley(rawurldecode($message)); if ( $send_id != 0 ) { $DbUsers->query("select name from ".$prefix."_4nchatuser where uid = $send_id LIMIT 1"); if($DbUsers->num_rows() > 0) list($name) = $DbUsers->next_record(); else $name = "*empty*"; $DbUsers->clean_results(); } if($tf==12) { $timestamp = '<span class="timestamp">'.date("h:i:sa", ($time + (doubleval($tz)) * 60 * 60)).' </span>'; } else { $timestamp = '<span class="timestamp">'.date("H:i:s", ($time + (doubleval($tz)) * 60 * 60)).' </span>'; } if($cmd != "") { if ( $cmd == "USERENTER" ) { $toOut .= '<div class="sysmessage">'.$timestamp.'[img]"images/u3.gif"[/img]'.$message.' '._4n005.'</div>'; $uenter = true; ?> window.parent.frames['wUsers'].refresh(); <? } elseif ( $cmd == "USERLEFT" ) { $toOut .= '<div class="sysmessage">'.$timestamp.'[img]"images/u4.gif"[/img]'.$message.' '._4n006.'</div>'; $uleft = true; ?> window.parent.frames['wUsers'].refresh(); <? } elseif ($cmd == "MSG") { if (( $send_id != $uid ) and ( $rcpt_id == $uid )) $toOut .= '<div class="message">'.$timestamp.'<font color="#5566BB"><b>('._4n007.' '.$name.')</b> '.$message.'</font></div>'; } else { if ( $rcpt_id == 0 ) { $usersounds[] = $cmd; $toOut .= '<div class="sysmessage">'.$timestamp.'[img]"images/beep.gif"[/img] '.$name.' is '.$message.' the room</div>'; } elseif ( $rcpt_id == $uid ) { $usersounds[] = $cmd; $toOut .= '<div class="sysmessage">'.$timestamp.'[img]"images/beep.gif"[/img] '.$name.' is '.$message.' you</div>'; } } } else { if ( $rcpt_id == 0 ) { if ( $send_id != $uid ) $toOut .= '<div class="message">'.$timestamp.'<font color="red"><b>'.$name.'></b></font> '.$message.'</div>'; } else if( $send_id != $uid ) $toOut .= '<div class="message">'.$timestamp.'<font color="#5566BB"><b>('._4n007.' '.$name.')</b> '.$message.'</font></div>'; } if($time > $msgLastCheck) $msgLastCheck = $time; } } if($toOut != "") { ?> toOut = '<?=$toOut?>'; if (document.all) { top.wOut.document.body.innerHTML += toOut; } else { top.wOut.document.write("<html><style>BODY {font-family: Verdana, sans-serif; color: #000055; font-size: 12px;} </style><body bgcolor='#FFFFFF'>"); top.wOut.document.write(toOut); } <? } $DbLink->clean_results(); $DbUsers->query("UPDATE ".$prefix."_4nchatuser SET last = ".time()." WHERE name = '$username'"); if(!$DbUsers->affected_rows()) { $DbUsers->close(); $DbLink->close(); $DbSmiles->close(); ?> top.location="quit.php?rid=<?=$rid; ?>&uid=<?=$uid; ?>&reason=1&lang=<?=$lang ?>"; </script> </head> </html> <? exit; } ?> function refresh() { window.location='receive.php?rid=<?=$rid ?>&uid=<?=$uid ?>&username=<?=$username ?>&tz=<?=$tz ?>&msgLastCheck=<?=$msgLastCheck ?>&allowsounds=<?=$allowsounds ?>&lang=<?=$lang ?>'; } </script> <? if($allowsounds) { $callowsounds = "checked"; if($uenter) { ?> <BGSOUND SRC="<?=$soundsdir?>/hi.wav" LOOP="1"> <? } if($uleft) { ?> <BGSOUND SRC="<?=$soundsdir?>/byebye.wav" LOOP="1"> <? } $n_usersounds = count($usersounds); for ($i = 0; $i < $n_usersounds; $i++) { $DbLink->query("SELECT file FROM ".$prefix."_4nchatsound WHERE cmd = '$usersounds[$i]' LIMIT 1"); list($sndfile) = $DbLink->next_record(); ?> <!-- User sound --> <BGSOUND SRC="<?=$soundsdir.'/'.$sndfile ?>" LOOP="1"> <? $DbLink->clean_results(); } } ?> </head> <body bgcolor="#EAEAEA" marginwidth="0" marginheight="3" leftmargin="0" topmargin="0"> <form action="receive.php?rid=<?=$rid ?>&uid=<?=$uid ?>&username=<?=$username ?>&tz=<?=$tz ?>&msgLastCheck=<?=$msgLastCheck ?>&lang=<?=$lang ?>" method="post"> <font size="-2" face="MS Sans Serif"><input type="checkbox" name="allowsounds" onClick="submit()" <?=$callowsounds ?>>Sound</font> </form> <script> <!-- setTimeout('refresh()',<?=$msg_refresh?>); // --> </script> </body> </html> <? if($keeponline) { $DbLink2 = new DB($dbhost, $dbname, $dbuname, $dbpass); $ip = getenv("REMOTE_ADDR"); if($uid < 0) { $guest = 1; $uname = $ip; } else { $guest = 0; $uname = $username; } $past = time() - 900; $DbLink->query("DELETE FROM ".$prefix."_session WHERE time < ".$past); $ctime = time(); $DbLink->query("SELECT username from ".$prefix."_session WHERE username = '$uname' LIMIT 1"); if($DbLink->num_rows() == 0) $DbLink2->query("INSERT INTO ".$prefix."_session (username, time, host_addr, guest) VALUES ('$uname', '$ctime', '$ip', '$guest')"); else $DbLink2->query("UPDATE ".$prefix."_session SET time='$ctime', host_addr='$ip' WHERE username = '$uname'"); $DbLink->clean_results(); if($uid > 0) { $DbLink->query("SELECT * FROM ".$prefix."_lastseen WHERE username = '$username' LIMIT 1"); if($DbLink->num_rows() > 0) $DbLink2->query("UPDATE ".$prefix."_lastseen SET date = ".$ctime." WHERE username = '$username'"); else $DbLink2->query("INSERT INTO ".$prefix."_lastseen VALUES ('', '$username', ".time().", '$ip')"); } $DbLink2->close(); $DbLink->clean_results(); } $DbLink->close(); $DbUsers->close(); $DbSmiles->close(); ?> |
Waar kan de fout zitten?
Script komt van http://warpspeed.4thdimension.de