Forum PHP - Tijd en Witregeles
Zal me eerst even voorstellen. Ben net nieuw op dit forum. Mijn naam is Peter van der Zande en ben op dit moment met PHP in aanraking gekomen doordat mijn voetbal club graag een website wilde.
Nu is mijn vraag:
Of iemand mij kan helpen met een PHP Forum Script.
Ik heb via google het script al kunnen vinden. (Ben zelf totaal niet goed in PHP , dus ik zoek scripts via google, en pas deze een klein beetje aan.)
De volgende problemen krijg ik zelf echter niet opgelost.
1. Te veel witregelens in het bericht:
Als je een bericht maakt, geef je een ENTER en kun je netjes op de volgende regel verder gaan met typen. Maar zodra ik het dan plaats op het forum. Komen er tussen elke ENTER , 2 witregelens.... HELP!!!
(Als ik SHIFT ingedrukt houdt en druk op ENTER, komen er geen witregels)
2. Tijd loopt 1 uur achter.
Laat het me even weten als je mij wilt helpen, dan zal ik het script ff uploaden.
(Het forum staat btw al online en werkend. Verder is ie echt perfect, op bovenstaande problemen na) Als je wilt kun je ff kijken op de site. http://shark.mezoka.com/Forum/index.php?cat=5&top=4
Mijn dank is groot!!
Toon eens het script
Shift+enter krijg ik gewoon de volgende regel en bij 1x enter krijg ik ook gewoon de volende regel bij 2x enter slaat hij inderdaad een witregel over maar dat is normaal. Ook als ik paragraaf tags (html) gebruik verwerkt hij het netjes.
betreft de tijd, dat heeft te maken met de tijd van je server. Deze staat dan niet goed ingesteld, vermoed ik.
LET OP:
Je moet mailto: uit de berichten van het gastenboek halen. Anders heeft binnenkort iedereen spam in z'n mailbox die een bericht in het gastenboek heeft gezet.
Gewijzigd op 24/02/2011 12:22:41 door Bas IJzelendoorn
Peter vander Zande op 24/02/2011 12:05:22:
2. Tijd loopt 1 uur achter.
De tijd die je ziet is GMT. In nederland is het GMT+1. Dit is ingesteld in de php.ini.
Aan je reactie te zien, ben je even op het forum gaan kijken.
De witregeles komen pas als je het bericht ook daadwerkelijk plaatst.
De huidige reacties die er nu op staan, heb ik zodanig aangepast met SHIFT + ENTER zodat er geen witregels.
Ik zou zeggen doe even een test en plaats een bericht.
Hieronder het script:
Script:
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
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
<?php
$dbhost = 'sql309.mezoka.com';
$dbuser = 'mezok_6604082';
$dbpass = '******';
$db = 'mezok_6604082_Forum';
mysql_connect($dbhost,$dbuser,$dbpass) or die("No connection.");
mysql_select_db($db) or die("No connection.");
// IP ADMIN
$conf_admin = "193.200.71.35";
// Colors
$conf_titlebgcolor = "#000000";
$conf_bordercolor = "#000000";
$conf_topicbgcolor = "#dddddd";
$conf_bg1 = "#ffffff";
$conf_bg2 = "#dddddd";
// Breedte van het forum (minimaal 640px)
$conf_width = "800";
// Aantal topics op 1 pagina
$conf_topiclimit = "15";
function smiley($text)
{
$text = str_replace(':D', '<img src="img/1.gif">', $text);
$text = str_replace(':)', '<img src="img/2.gif">', $text);
$text = str_replace(':(', '<img src="img/3.gif">', $text);
$text = str_replace(':o', '<img src="img/4.gif">', $text);
$text = str_replace(':s', '<img src="img/5.gif">', $text);
$text = str_replace('8)', '<img src="img/6.gif">', $text);
$text = str_replace(':p', '<img src="img/7.gif">', $text);
$text = str_replace('(a)', '<img src="img/8.gif">', $text);
$text = str_replace(';)', '<img src="img/9.gif">', $text);
$text = str_replace(':|', '<img src="img/10.gif">', $text);
$text = str_replace(";(", '<img src="img/11.gif">', $text);
$text = str_replace('(w)', '<img src="img/12.gif">', $text);
$text = str_replace(':d', '<img src="img/1.gif">', $text);
$text = str_replace(':>', '<img src="img/2.gif">', $text);
$text = str_replace(':<', '<img src="img/3.gif">', $text);
$text = str_replace(':O', '<img src="img/4.gif">', $text);
$text = str_replace(':S', '<img src="img/5.gif">', $text);
$text = str_replace(':P', '<img src="img/7.gif">', $text);
$text = str_replace('(A)', '<img src="img/8.gif">', $text);
$text = str_replace('(W)', '<img src="img/12.gif">', $text);
return $text;
}
function checkemail($email) {
// First, we check that there's one @ symbol, and that the lengths are right
if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {
// Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
return false;
}
// Split it into sections to make life easier
$email_array = explode("@", $email);
$local_array = explode(".", $email_array[0]);
for ($i = 0; $i < sizeof($local_array); $i++) {
if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) {
return false;
}
}
if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name
$domain_array = explode(".", $email_array[1]);
if (sizeof($domain_array) < 2) {
return false; // Not enough parts to domain
}
for ($i = 0; $i < sizeof($domain_array); $i++) {
if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) {
return false;
}
}
}
return true;
}
// Edit category
if($conf_admin == $_SERVER['REMOTE_ADDR'] && $_SERVER['REQUEST_METHOD'] == "POST" && !isset($_GET['cat']) && !isset($_GET['top']) && isset($_GET['edit'])){
$ok = 1;
$result = "";
if($_POST['title'] == ""){ $ok = 0; $result .= "- Vul een titel in<br />"; }
if($_POST['description'] == ""){ $ok = 0; $result .= "- Vul een beschrijving in<br />"; }
if($_POST['validation'] != $_POST['validation2']){ $ok = 0; $result .= "- Jozef, je moet wel de validatie code invullen!<br />"; }
if($ok == 1){
$sql = "UPDATE categories SET title='".$_POST['title']."', description='".$_POST['description']."' WHERE id='".$_GET['edit']."'";
if(mysql_query($sql) or die(mysql_error())){
echo '<script>window.location=\'index.php\';</script>';
}
}
}
// Edit reply
if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_GET['cat']) && isset($_GET['top']) && isset($_GET['edit']) && is_numeric($_GET['cat']) && is_numeric($_GET['top']) && is_numeric($_GET['edit'])){
$ok = 1;
$result = "";
if($_POST['name'] == ""){ $ok = 0; $result .= "- Vul een naam in<br />"; }
if($_POST['message'] == ""){ $ok = 0; $result .= "- Vul een bericht in<br />"; }
if($_POST['validation'] != $_POST['validation2']){ $ok = 0; $result .= "- Jozef, je moet wel de validatie code invullen!<br />"; }
if($_POST['email'] != ""){ if(!checkemail($_POST['email'])){ $ok = 0; $result .= "- Het email adres is niet geldig"; } }
if($ok == 1){
if($_POST['save']){
setcookie("name", strip_tags(htmlspecialchars($_POST['name'])), time()+3000000);
setcookie("email", strip_tags(htmlspecialchars($_POST['email'])), time()+3000000);
}
$sql = "UPDATE replys SET message='".$_POST['message']."', tid='".$_GET['top']."', date='".date('d-m-y H:i')."', name='".strip_tags(htmlspecialchars($_POST['name']))."', email='".strip_tags(htmlspecialchars($_POST['email']))."', ip='".$_SERVER['REMOTE_ADDR']."' WHERE id='".$_GET['edit']."'";
if(mysql_query($sql) or die(mysql_error())){
echo '<script>window.location=\'index.php?cat='.$_GET['cat'].'&top='.$_GET['top'].'\';</script>';
}
}
}
// Edit topic
if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_GET['cat']) && isset($_GET['edit']) && !isset($_GET['top']) && is_numeric($_GET['cat']) && is_numeric($_GET['edit'])){
$ok = 1;
$result = "";
if($_POST['name'] == ""){ $ok = 0; $result .= "- Vul een naam in<br />"; }
if($_POST['message'] == ""){ $ok = 0; $result .= "- Vul een bericht in<br />"; }
if($_POST['title'] == ""){ $ok = 0; $result .= "- Geef het topic een titel<br />"; }
if($_POST['validation'] != $_POST['validation2']){ $ok = 0; $result .= "- Jozef, je moet wel de validatie code invullen!<br />"; }
if($_POST['email'] != ""){ if(!checkemail($_POST['email'])){ $ok = 0; $result .= "- Het email adres is niet geldig"; } }
if($ok == 1){
if($_POST['save']){
setcookie("name", strip_tags(htmlspecialchars($_POST['name'])), time()+3000000);
setcookie("email", strip_tags(htmlspecialchars($_POST['email'])), time()+3000000);
}
$sql = "UPDATE topics SET cat='".$_GET['cat']."', title='".$_POST['title']."', message='".$_POST['message']."', date='".date('d-m-y H:i')."', name='".strip_tags(htmlspecialchars($_POST['name']))."', email='".htmlspecialchars($_POST['email'])."', ip='".$_SERVER['REMOTE_ADDR']."' WHERE id='".$_GET['edit']."'";
if(mysql_query($sql) or die(mysql_error())){
echo '<script>window.location=\'index.php?cat='.$_GET['cat'].'&top='.$_GET['edit'].'\';</script>';
}
}
}
// Add topic
if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_GET['cat']) && $_GET['add'] == "topic" && is_numeric($_GET['cat'])){
$ok = 1;
$result = "";
if($_POST['name'] == ""){ $ok = 0; $result .= "- Vul een naam in<br />"; }
if($_POST['message'] == ""){ $ok = 0; $result .= "- Vul een bericht in<br />"; }
if($_POST['title'] == ""){ $ok = 0; $result .= "- Geef het topic een titel<br />"; }
if($_POST['validation'] != $_POST['validation2']){ $ok = 0; $result .= "- Jozef, je moet wel de validatie code invullen!<br />"; }
if(isset($_COOKIE['time'])){ $ok = 0; $result .= "- Wacht 10 seconden voordat je een nieuwe topic plaatst<br />"; }
if($_POST['email'] != ""){ if(!checkemail($_POST['email'])){ $ok = 0; $result .= "- Het email adres is niet geldig<br />"; } }
if($ok == 1){
if(setcookie("time", "1", time()+10)){
if($_POST['save']){
setcookie("name", strip_tags(htmlspecialchars($_POST['name'])), time()+3000000);
setcookie("email", strip_tags(htmlspecialchars($_POST['email'])), time()+3000000);
}
$sql = "INSERT INTO topics (cat,title,message,date,name,email,ip) VALUES ('".$_GET['cat']."','".strip_tags(htmlspecialchars($_POST['title']))."','".$_POST['message']."','".date('d-m-y H:i')."','".strip_tags(htmlspecialchars($_POST['name']))."','".strip_tags(htmlspecialchars($_POST['email']))."','".$_SERVER['REMOTE_ADDR']."')";
if(mysql_query($sql) or die(mysql_error())){
echo '<script>window.location=\'index.php?cat='.$_GET['cat'].'\';</script>';
}
}
else{
$result .= "- Er kan geen cookie worden geplaatst";
}
}
}
// Add reply
if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_GET['cat']) && isset($_GET['top']) && $_GET['add'] == "reply" && is_numeric($_GET['cat']) && is_numeric($_GET['top'])){
$ok = 1;
$result = "";
if($_POST['name'] == ""){ $ok = 0; $result .= "- Vul een naam in<br />"; }
if($_POST['message'] == ""){ $ok = 0; $result .= "- Vul een bericht in<br />"; }
if($_POST['validation'] != $_POST['validation2']){ $ok = 0; $result .= "- Jozef, je moet wel de validatie code invullen!<br />"; }
if(isset($_COOKIE['time'])){ $ok = 0; $result .= "- Wacht 10 seconden voordat je een nieuwe reactie plaatst<br />"; }
if($_POST['email'] != ""){ if(!checkemail($_POST['email'])){ $ok = 0; $result .= "- Het email adres is niet geldig<br />"; } }
if($ok == 1){
if(setcookie("time", "1", time()+10)){
if($_POST['save']){
setcookie("name", strip_tags(htmlspecialchars($_POST['name'])), time()+3000000);
setcookie("email", strip_tags(htmlspecialchars($_POST['email'])), time()+3000000);
}
$sql = "INSERT INTO replys (message,tid,date,name,email,ip) VALUES ('".$_POST['message']."','".$_GET['top']."','".date('d-m-y H:i')."','".strip_tags(htmlspecialchars($_POST['name']))."','".strip_tags(htmlspecialchars($_POST['email']))."','".$_SERVER['REMOTE_ADDR']."')";
if(mysql_query($sql) or die(mysql_error())){
echo '<script>window.location=\'index.php?cat='.$_GET['cat'].'&top='.$_GET['top'].'\';</script>';
}
}
else{
$result .= "- Er kan geen cookie worden geplaatst";
}
}
}
// Add category
if($conf_admin == $_SERVER['REMOTE_ADDR'] && $_SERVER['REQUEST_METHOD'] == "POST" && !isset($_GET['cat']) && !isset($_GET['top']) && $_GET['add'] == "category"){
$ok = 1;
$result = "";
if($_POST['title'] == ""){ $ok = 0; $result .= "- Vul een titel in<br />"; }
if($_POST['description'] == ""){ $ok = 0; $result .= "- Vul een beschrijving in<br />"; }
if($_POST['validation'] != $_POST['validation2']){ $ok = 0; $result .= "- Jozef, je moet wel de validatie code invullen!<br />"; }
if($ok == 1){
$sql = "INSERT INTO categories (title,description) VALUES ('".$_POST['title']."','".$_POST['description']."')";
if(mysql_query($sql) or die(mysql_error())){
echo '<script>window.location=\'index.php\';</script>';
}
}
}
?>
$dbhost = 'sql309.mezoka.com';
$dbuser = 'mezok_6604082';
$dbpass = '******';
$db = 'mezok_6604082_Forum';
mysql_connect($dbhost,$dbuser,$dbpass) or die("No connection.");
mysql_select_db($db) or die("No connection.");
// IP ADMIN
$conf_admin = "193.200.71.35";
// Colors
$conf_titlebgcolor = "#000000";
$conf_bordercolor = "#000000";
$conf_topicbgcolor = "#dddddd";
$conf_bg1 = "#ffffff";
$conf_bg2 = "#dddddd";
// Breedte van het forum (minimaal 640px)
$conf_width = "800";
// Aantal topics op 1 pagina
$conf_topiclimit = "15";
function smiley($text)
{
$text = str_replace(':D', '<img src="img/1.gif">', $text);
$text = str_replace(':)', '<img src="img/2.gif">', $text);
$text = str_replace(':(', '<img src="img/3.gif">', $text);
$text = str_replace(':o', '<img src="img/4.gif">', $text);
$text = str_replace(':s', '<img src="img/5.gif">', $text);
$text = str_replace('8)', '<img src="img/6.gif">', $text);
$text = str_replace(':p', '<img src="img/7.gif">', $text);
$text = str_replace('(a)', '<img src="img/8.gif">', $text);
$text = str_replace(';)', '<img src="img/9.gif">', $text);
$text = str_replace(':|', '<img src="img/10.gif">', $text);
$text = str_replace(";(", '<img src="img/11.gif">', $text);
$text = str_replace('(w)', '<img src="img/12.gif">', $text);
$text = str_replace(':d', '<img src="img/1.gif">', $text);
$text = str_replace(':>', '<img src="img/2.gif">', $text);
$text = str_replace(':<', '<img src="img/3.gif">', $text);
$text = str_replace(':O', '<img src="img/4.gif">', $text);
$text = str_replace(':S', '<img src="img/5.gif">', $text);
$text = str_replace(':P', '<img src="img/7.gif">', $text);
$text = str_replace('(A)', '<img src="img/8.gif">', $text);
$text = str_replace('(W)', '<img src="img/12.gif">', $text);
return $text;
}
function checkemail($email) {
// First, we check that there's one @ symbol, and that the lengths are right
if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {
// Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
return false;
}
// Split it into sections to make life easier
$email_array = explode("@", $email);
$local_array = explode(".", $email_array[0]);
for ($i = 0; $i < sizeof($local_array); $i++) {
if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) {
return false;
}
}
if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name
$domain_array = explode(".", $email_array[1]);
if (sizeof($domain_array) < 2) {
return false; // Not enough parts to domain
}
for ($i = 0; $i < sizeof($domain_array); $i++) {
if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) {
return false;
}
}
}
return true;
}
// Edit category
if($conf_admin == $_SERVER['REMOTE_ADDR'] && $_SERVER['REQUEST_METHOD'] == "POST" && !isset($_GET['cat']) && !isset($_GET['top']) && isset($_GET['edit'])){
$ok = 1;
$result = "";
if($_POST['title'] == ""){ $ok = 0; $result .= "- Vul een titel in<br />"; }
if($_POST['description'] == ""){ $ok = 0; $result .= "- Vul een beschrijving in<br />"; }
if($_POST['validation'] != $_POST['validation2']){ $ok = 0; $result .= "- Jozef, je moet wel de validatie code invullen!<br />"; }
if($ok == 1){
$sql = "UPDATE categories SET title='".$_POST['title']."', description='".$_POST['description']."' WHERE id='".$_GET['edit']."'";
if(mysql_query($sql) or die(mysql_error())){
echo '<script>window.location=\'index.php\';</script>';
}
}
}
// Edit reply
if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_GET['cat']) && isset($_GET['top']) && isset($_GET['edit']) && is_numeric($_GET['cat']) && is_numeric($_GET['top']) && is_numeric($_GET['edit'])){
$ok = 1;
$result = "";
if($_POST['name'] == ""){ $ok = 0; $result .= "- Vul een naam in<br />"; }
if($_POST['message'] == ""){ $ok = 0; $result .= "- Vul een bericht in<br />"; }
if($_POST['validation'] != $_POST['validation2']){ $ok = 0; $result .= "- Jozef, je moet wel de validatie code invullen!<br />"; }
if($_POST['email'] != ""){ if(!checkemail($_POST['email'])){ $ok = 0; $result .= "- Het email adres is niet geldig"; } }
if($ok == 1){
if($_POST['save']){
setcookie("name", strip_tags(htmlspecialchars($_POST['name'])), time()+3000000);
setcookie("email", strip_tags(htmlspecialchars($_POST['email'])), time()+3000000);
}
$sql = "UPDATE replys SET message='".$_POST['message']."', tid='".$_GET['top']."', date='".date('d-m-y H:i')."', name='".strip_tags(htmlspecialchars($_POST['name']))."', email='".strip_tags(htmlspecialchars($_POST['email']))."', ip='".$_SERVER['REMOTE_ADDR']."' WHERE id='".$_GET['edit']."'";
if(mysql_query($sql) or die(mysql_error())){
echo '<script>window.location=\'index.php?cat='.$_GET['cat'].'&top='.$_GET['top'].'\';</script>';
}
}
}
// Edit topic
if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_GET['cat']) && isset($_GET['edit']) && !isset($_GET['top']) && is_numeric($_GET['cat']) && is_numeric($_GET['edit'])){
$ok = 1;
$result = "";
if($_POST['name'] == ""){ $ok = 0; $result .= "- Vul een naam in<br />"; }
if($_POST['message'] == ""){ $ok = 0; $result .= "- Vul een bericht in<br />"; }
if($_POST['title'] == ""){ $ok = 0; $result .= "- Geef het topic een titel<br />"; }
if($_POST['validation'] != $_POST['validation2']){ $ok = 0; $result .= "- Jozef, je moet wel de validatie code invullen!<br />"; }
if($_POST['email'] != ""){ if(!checkemail($_POST['email'])){ $ok = 0; $result .= "- Het email adres is niet geldig"; } }
if($ok == 1){
if($_POST['save']){
setcookie("name", strip_tags(htmlspecialchars($_POST['name'])), time()+3000000);
setcookie("email", strip_tags(htmlspecialchars($_POST['email'])), time()+3000000);
}
$sql = "UPDATE topics SET cat='".$_GET['cat']."', title='".$_POST['title']."', message='".$_POST['message']."', date='".date('d-m-y H:i')."', name='".strip_tags(htmlspecialchars($_POST['name']))."', email='".htmlspecialchars($_POST['email'])."', ip='".$_SERVER['REMOTE_ADDR']."' WHERE id='".$_GET['edit']."'";
if(mysql_query($sql) or die(mysql_error())){
echo '<script>window.location=\'index.php?cat='.$_GET['cat'].'&top='.$_GET['edit'].'\';</script>';
}
}
}
// Add topic
if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_GET['cat']) && $_GET['add'] == "topic" && is_numeric($_GET['cat'])){
$ok = 1;
$result = "";
if($_POST['name'] == ""){ $ok = 0; $result .= "- Vul een naam in<br />"; }
if($_POST['message'] == ""){ $ok = 0; $result .= "- Vul een bericht in<br />"; }
if($_POST['title'] == ""){ $ok = 0; $result .= "- Geef het topic een titel<br />"; }
if($_POST['validation'] != $_POST['validation2']){ $ok = 0; $result .= "- Jozef, je moet wel de validatie code invullen!<br />"; }
if(isset($_COOKIE['time'])){ $ok = 0; $result .= "- Wacht 10 seconden voordat je een nieuwe topic plaatst<br />"; }
if($_POST['email'] != ""){ if(!checkemail($_POST['email'])){ $ok = 0; $result .= "- Het email adres is niet geldig<br />"; } }
if($ok == 1){
if(setcookie("time", "1", time()+10)){
if($_POST['save']){
setcookie("name", strip_tags(htmlspecialchars($_POST['name'])), time()+3000000);
setcookie("email", strip_tags(htmlspecialchars($_POST['email'])), time()+3000000);
}
$sql = "INSERT INTO topics (cat,title,message,date,name,email,ip) VALUES ('".$_GET['cat']."','".strip_tags(htmlspecialchars($_POST['title']))."','".$_POST['message']."','".date('d-m-y H:i')."','".strip_tags(htmlspecialchars($_POST['name']))."','".strip_tags(htmlspecialchars($_POST['email']))."','".$_SERVER['REMOTE_ADDR']."')";
if(mysql_query($sql) or die(mysql_error())){
echo '<script>window.location=\'index.php?cat='.$_GET['cat'].'\';</script>';
}
}
else{
$result .= "- Er kan geen cookie worden geplaatst";
}
}
}
// Add reply
if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_GET['cat']) && isset($_GET['top']) && $_GET['add'] == "reply" && is_numeric($_GET['cat']) && is_numeric($_GET['top'])){
$ok = 1;
$result = "";
if($_POST['name'] == ""){ $ok = 0; $result .= "- Vul een naam in<br />"; }
if($_POST['message'] == ""){ $ok = 0; $result .= "- Vul een bericht in<br />"; }
if($_POST['validation'] != $_POST['validation2']){ $ok = 0; $result .= "- Jozef, je moet wel de validatie code invullen!<br />"; }
if(isset($_COOKIE['time'])){ $ok = 0; $result .= "- Wacht 10 seconden voordat je een nieuwe reactie plaatst<br />"; }
if($_POST['email'] != ""){ if(!checkemail($_POST['email'])){ $ok = 0; $result .= "- Het email adres is niet geldig<br />"; } }
if($ok == 1){
if(setcookie("time", "1", time()+10)){
if($_POST['save']){
setcookie("name", strip_tags(htmlspecialchars($_POST['name'])), time()+3000000);
setcookie("email", strip_tags(htmlspecialchars($_POST['email'])), time()+3000000);
}
$sql = "INSERT INTO replys (message,tid,date,name,email,ip) VALUES ('".$_POST['message']."','".$_GET['top']."','".date('d-m-y H:i')."','".strip_tags(htmlspecialchars($_POST['name']))."','".strip_tags(htmlspecialchars($_POST['email']))."','".$_SERVER['REMOTE_ADDR']."')";
if(mysql_query($sql) or die(mysql_error())){
echo '<script>window.location=\'index.php?cat='.$_GET['cat'].'&top='.$_GET['top'].'\';</script>';
}
}
else{
$result .= "- Er kan geen cookie worden geplaatst";
}
}
}
// Add category
if($conf_admin == $_SERVER['REMOTE_ADDR'] && $_SERVER['REQUEST_METHOD'] == "POST" && !isset($_GET['cat']) && !isset($_GET['top']) && $_GET['add'] == "category"){
$ok = 1;
$result = "";
if($_POST['title'] == ""){ $ok = 0; $result .= "- Vul een titel in<br />"; }
if($_POST['description'] == ""){ $ok = 0; $result .= "- Vul een beschrijving in<br />"; }
if($_POST['validation'] != $_POST['validation2']){ $ok = 0; $result .= "- Jozef, je moet wel de validatie code invullen!<br />"; }
if($ok == 1){
$sql = "INSERT INTO categories (title,description) VALUES ('".$_POST['title']."','".$_POST['description']."')";
if(mysql_query($sql) or die(mysql_error())){
echo '<script>window.location=\'index.php\';</script>';
}
}
}
?>
<html>
<head>
<title></title>
<script src="nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>
<center><img title="RKTVV" src="header.jpg" alt="RKTVV" width="191" height="157" /></center>
<style>
body
{
background-image:url('d016_01.jpg');
background-repeat:repeat;
font-family: arial, verdana;
font-size: 10px;
a:link text-decoration:none;
a:visited text-decoration:none;
a:hover text-decoration:underline;
a:active text-decoration:underline;
}
table
{
align: center;
}
#description
{
font-size: 10px;
font-family: arial, verdana;
}
#message
{
font-size: 10px;
font-family: arial, verdana;
}
#title
{
font-size: 12px;
font-family: arial, verdana;
color: #ffffff;
}
a{ text-decoration: none; color: #DF0101; }
a:hover{ text-decoration: none; color: #DF0101; }
a:active{ text-decoration: none; color: #DF0101; }
#title a{ text-decoration: none; color: #ffffff; font-size: 8px; }
#title a:hover{ text-decoration: none; color: #ffffff; font-size: 8px; }
#title a:active{ text-decoration: none; color: #ffffff; font-size: 8px; }
</style>
</head>
<body>
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
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
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
<?php
// Edit category
if(!isset($_GET['cat']) && !isset($_GET['top']) && isset($_GET['edit'])){
$sqlcat = "SELECT * FROM categories WHERE id='".$_GET['edit']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php">Terug</a></div>';
echo '<table width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">'.$rowcat['title'].' - Categorie Wijzigen</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';">';
if(isset($result)){ echo $result.'<br /><hr>'; }
echo '<form method="POST" name="forum">';
echo '<table align="center" cellpadding="5" cellspacing="0" border="0">';
echo '<tr><td>Titel:</td><td><input type="text" name="title" value="'.strip_tags(htmlspecialchars($rowcat['title'])).'" style="width: 350px;"></td></tr>';
$numb = rand(11111,99999);
echo '<tr><td>Typ: '.$numb.'<input type="hidden" name="validation" value="'.$numb.'"></td><td><input type="text" name="validation2" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td colspan="3" style="background-color: #ffffff;"><textarea id="area" name="description" style="width: 600px; height: 200px;">'.$rowcat['description'].'</textarea></td></tr>';
echo '<tr><td colspan="3"><a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':D\');"><img src="img/1.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':)\');"><img src="img/2.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':(\');"><img src="img/3.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':o\');"><img src="img/4.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':s\');"><img src="img/5.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'8)\');"><img src="img/6.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':p\');"><img src="img/7.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(a)\');"><img src="img/8.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';)\');"><img src="img/9.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':|\');"><img src="img/10.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';(\');"><img src="img/11.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(w)\');"><img src="img/12.gif" border="0"></a></td></tr>';
echo '</table>';
echo '<hr><input type="submit" name="submit" value="Categorie wijzigen">';
echo '</form>';
echo '</div></td></tr></table>';
}
// Edit topic
elseif(isset($_GET['cat']) && isset($_GET['edit']) && !isset($_GET['top']) && is_numeric($_GET['cat']) && is_numeric($_GET['edit'])){
$sqlcat = "SELECT title FROM categories WHERE id='".$_GET['cat']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
$sqltop = "SELECT * FROM topics WHERE id='".$_GET['edit']."'";
$querytop = mysql_query($sqltop) or die(mysql_error());
$rowtop = mysql_fetch_assoc($querytop);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'&top='.$_GET['edit'].'">Terug</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">'.$rowcat['title'].' - '.strip_tags(htmlspecialchars($rowtop['title'])).' - Topic wijzigen</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';">';
if(isset($result)){ echo $result.'<br /><hr>'; }
echo '<form method="POST" name="forum">';
echo '<table align="center" cellpadding="5" cellspacing="0" border="0">';
echo '<tr><td>Naam:</td><td><input type="text" name="name" value="'; if(isset($_COOKIE['name']) OR $_COOKIE['name'] == $rowtop['name']){ echo strip_tags(htmlspecialchars($_COOKIE['name'])); }else{ echo strip_tags(htmlspecialchars($rowtop['name'])); } echo '" style="width: 350px;"></td><td rowspan="2"><input type="checkbox" name="save" '; if(isset($_COOKIE['name']) && isset($_COOKIE['email'])){ echo 'CHECKED'; } echo '> <font style="font-size: 12px;">Gegevens bewaren</font></td></tr>';
echo '<tr><td>Email adres:</td><td><input type="text" name="email" value="'; if(isset($_COOKIE['email']) OR $_COOKIE['email'] == $rowtop['email']){ echo strip_tags(htmlspecialchars($_COOKIE['email'])); }else{ echo strip_tags(htmlspecialchars($rowtop['email'])); } echo '" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td>Titel:</td><td><input type="text" name="title" value="'.strip_tags(htmlspecialchars($rowtop['title'])).'" style="width: 350px;"></td></tr>';
$numb = rand(11111,99999);
echo '<tr><td>Typ: '.$numb.'<input type="hidden" name="validation" value="'.$numb.'"></td><td><input type="text" name="validation2" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td colspan="3" style="background-color: #ffffff;"><textarea id="area" name="message" style="width: 600px; height: 200px;">'.$rowtop['message'].'</textarea></td></tr>';
echo '<tr><td colspan="3"><a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':D\');"><img src="img/1.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':)\');"><img src="img/2.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':(\');"><img src="img/3.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':o\');"><img src="img/4.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':s\');"><img src="img/5.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'8)\');"><img src="img/6.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':p\');"><img src="img/7.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(a)\');"><img src="img/8.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';)\');"><img src="img/9.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':|\');"><img src="img/10.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';(\');"><img src="img/11.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(w)\');"><img src="img/12.gif" border="0"></a></td></tr>';
echo '</table>';
echo '<hr><input type="submit" name="submit" value="Topic wijzigen">';
echo '</form>';
echo '</div></td></tr></table>';
}
// Edit reply
elseif(isset($_GET['cat']) && isset($_GET['top']) && isset($_GET['edit']) && is_numeric($_GET['cat']) && is_numeric($_GET['top']) && is_numeric($_GET['edit'])){
$sqlcat = "SELECT title FROM categories WHERE id='".$_GET['cat']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
$sqltop = "SELECT title FROM topics WHERE id='".$_GET['top']."'";
$querytop = mysql_query($sqltop) or die(mysql_error());
$rowtop = mysql_fetch_assoc($querytop);
$sqlrep = "SELECT * FROM replys WHERE id='".$_GET['edit']."'";
$queryrep = mysql_query($sqlrep) or die(mysql_error());
$rowrep = mysql_fetch_assoc($queryrep);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'">Terug</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">'.$rowcat['title'].' - '.strip_tags(htmlspecialchars($rowtop['title'])).' - Reactie wijzigen</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';">';
if(isset($result)){ echo $result.'<br /><hr>'; }
echo '<form method="POST" name="forum">';
echo '<table align="center" cellpadding="5" cellspacing="0" border="0">';
echo '<tr><td>Naam:</td><td><input type="text" name="name" value="'; if(isset($_COOKIE['name']) OR $_COOKIE['name'] == $rowrep['name']){ echo strip_tags(htmlspecialchars($_COOKIE['name'])); }else{ echo strip_tags(htmlspecialchars($rowrep['name'])); } echo '" style="width: 350px;"></td><td rowspan="2"><input type="checkbox" name="save" '; if(isset($_COOKIE['name']) && isset($_COOKIE['email'])){ echo 'CHECKED'; } echo '> <font style="font-size: 12px;">Gegevens bewaren</font></td></tr>';
echo '<tr><td>Email adres:</td><td><input type="text" name="email" value="'; if(isset($_COOKIE['email']) OR $_COOKIE['email'] == $rowrep['email']){ echo strip_tags(htmlspecialchars($_COOKIE['email'])); }else{ echo strip_tags(htmlspecialchars($rowrep['email'])); } echo '" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td>Titel:</td><td>'.strip_tags(htmlspecialchars($rowtop['title'])).'</td></tr>';
$numb = rand(11111,99999);
echo '<tr><td>Typ: '.$numb.'<input type="hidden" name="validation" value="'.$numb.'"></td><td><input type="text" name="validation2" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td colspan="3" style="background-color: #ffffff;"><textarea id="area" name="message" style="width: 600px; height: 200px;">'.$rowrep['message'].'</textarea></td></tr>';
echo '<tr><td colspan="3"><a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':D\');"><img src="img/1.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':)\');"><img src="img/2.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':(\');"><img src="img/3.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':o\');"><img src="img/4.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':s\');"><img src="img/5.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'8)\');"><img src="img/6.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':p\');"><img src="img/7.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(a)\');"><img src="img/8.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';)\');"><img src="img/9.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':|\');"><img src="img/10.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';(\');"><img src="img/11.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(w)\');"><img src="img/12.gif" border="0"></a></td></tr>';
echo '</table>';
echo '<hr><input type="submit" name="submit" value="Reactie wijzigen">';
echo '</form>';
echo '</div></td></tr></table>';
}
// Delete category
elseif(!isset($_GET['cat']) && isset($_GET['delete']) && !isset($_GET['top']) && is_numeric($_GET['delete'])){
$sqltop = "DELETE FROM categories WHERE id='".$_GET['delete']."'";
if(mysql_query($sqltop) or die(mysql_error())){
echo '<script>window.location=\'index.php\';</script>';
}
}
// Delete topic
elseif(isset($_GET['cat']) && isset($_GET['delete']) && !isset($_GET['top']) && is_numeric($_GET['cat']) && is_numeric($_GET['delete'])){
$sqltop = "DELETE FROM topics WHERE id='".$_GET['delete']."'";
if(mysql_query($sqltop) or die(mysql_error())){
echo '<script>window.location=\'index.php?cat='.$_GET['cat'].'\';</script>';
}
}
// Delete reply
elseif(isset($_GET['cat']) && isset($_GET['top']) && isset($_GET['delete']) && is_numeric($_GET['cat']) && is_numeric($_GET['top']) && is_numeric($_GET['delete'])){
$sqlrep = "DELETE FROM replys WHERE id='".$_GET['delete']."'";
if(mysql_query($sqlrep) or die(mysql_error())){
echo '<script>window.location=\'index.php?cat='.$_GET['cat'].'&top='.$_GET['top'].'\';</script>';
}
}
// Add topic
elseif(isset($_GET['cat']) && $_GET['add'] == "topic" && is_numeric($_GET['cat'])){
$sqlcat = "SELECT title FROM categories WHERE id='".$_GET['cat']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'">Terug</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">'.$rowcat['title'].' - Topic toevoegen</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';">';
if(isset($result)){ echo $result.'<br /><hr>'; }
echo '<form method="POST" name="forum">';
echo '<table align="center" cellpadding="5" cellspacing="0" border="0">';
echo '<tr><td>Naam:</td><td><input type="text" name="name" value="'; if(isset($_COOKIE['name']) OR $_COOKIE['name'] == $_POST['name']){ echo strip_tags(htmlspecialchars($_COOKIE['name'])); }else{ echo strip_tags(htmlspecialchars($_POST['name'])); } echo '" style="width: 350px;"></td><td rowspan="2"><input type="checkbox" name="save" '; if(isset($_COOKIE['name']) && isset($_COOKIE['email'])){ echo 'CHECKED'; } echo '> <font style="font-size: 12px;">Gegevens bewaren</font></td></tr>';
echo '<tr><td>Email adres:</td><td><input type="text" name="email" value="'; if(isset($_COOKIE['email']) OR $_COOKIE['email'] == $_POST['email']){ echo strip_tags(htmlspecialchars($_COOKIE['email'])); }else{ echo strip_tags(htmlspecialchars($_POST['email'])); } echo '" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td>Titel:</td><td><input type="text" name="title" value="'.strip_tags(htmlspecialchars($_POST['title'])).'" style="width: 350px;"></td></tr>';
$numb = rand(11111,99999);
echo '<tr><td>Typ: '.$numb.'<input type="hidden" name="validation" value="'.$numb.'"></td><td><input type="text" name="validation2" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td colspan="3" style="background-color: #ffffff;"><textarea id="area" name="message" style="width: 600px; height: 200px;">'.$_POST['message'].'</textarea></td></tr>';
echo '<tr><td colspan="3"><a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':D\');"><img src="img/1.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':)\');"><img src="img/2.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':(\');"><img src="img/3.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':o\');"><img src="img/4.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':s\');"><img src="img/5.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'8)\');"><img src="img/6.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':p\');"><img src="img/7.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(a)\');"><img src="img/8.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';)\');"><img src="img/9.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':|\');"><img src="img/10.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';(\');"><img src="img/11.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(w)\');"><img src="img/12.gif" border="0"></a></td></tr>';
echo '</table>';
echo '<hr><input type="submit" name="submit" value="Topic plaatsen">';
echo '</form>';
echo '</div></td></tr></table>';
}
// Add reply
elseif(isset($_GET['cat']) && isset($_GET['top']) && $_GET['add'] == "reply" && is_numeric($_GET['cat']) && is_numeric($_GET['top'])){
$sqlcat = "SELECT title FROM categories WHERE id='".$_GET['cat']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
$sqltop = "SELECT title FROM topics WHERE id='".$_GET['top']."'";
$querytop = mysql_query($sqltop) or die(mysql_error());
$rowtop = mysql_fetch_assoc($querytop);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'">Terug</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">'.$rowcat['title'].' - '.strip_tags(htmlspecialchars($rowtop['title'])).' - Reactie plaatsen</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';">';
if(isset($result)){ echo $result.''; }
echo '<form method="POST" name="forum">';
echo '<table align="center" cellpadding="5" cellspacing="0" border="0">';
echo '<tr><td>Naam:</td><td><input type="text" name="name" value="'; if(isset($_COOKIE['name']) OR $_COOKIE['name'] == $_POST['name']){ echo strip_tags(htmlspecialchars($_COOKIE['name'])); }else{ echo strip_tags(htmlspecialchars($_POST['name'])); } echo '" style="width: 350px;"></td><td rowspan="2"><input type="checkbox" name="save" '; if(isset($_COOKIE['name']) && isset($_COOKIE['email'])){ echo 'CHECKED'; } echo '> <font style="font-size: 12px;">Gegevens bewaren</font></td></tr>';
echo '<tr><td>Email adres:</td><td><input type="text" name="email" value="'; if(isset($_COOKIE['email']) OR $_COOKIE['email'] == $_POST['email']){ echo strip_tags(htmlspecialchars($_COOKIE['email'])); }else{ echo strip_tags(htmlspecialchars($_POST['email'])); } echo '" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td>Titel:</td><td>'.strip_tags(htmlspecialchars($rowtop['title'])).'</td></tr>';
$numb = rand(11111,99999);
echo '<tr><td>Typ: '.$numb.'<input type="hidden" name="validation" value="'.$numb.'"></td><td><input type="text" name="validation2" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td colspan="3" style="background-color: #ffffff;"><textarea id="area" name="message" style="width: 600px; height: 200px;">'.$_POST['message'].'</textarea></td></tr>';
echo '<tr><td colspan="3"><a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':D\');"><img src="img/1.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':)\');"><img src="img/2.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':(\');"><img src="img/3.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':o\');"><img src="img/4.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':s\');"><img src="img/5.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'8)\');"><img src="img/6.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':p\');"><img src="img/7.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(a)\');"><img src="img/8.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';)\');"><img src="img/9.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':|\');"><img src="img/10.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';(\');"><img src="img/11.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(w)\');"><img src="img/12.gif" border="0"></a></td></tr>';
echo '</table>';
echo '<hr><input type="submit" name="submit" value="Reactie plaatsen">';
echo '</form>';
echo '</div></td></tr></table>';
}
// Add category
elseif(!isset($_GET['cat']) && !isset($_GET['top']) && $_GET['add'] == "category"){
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php">Terug</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">Categorie toevoegen</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';">';
if(isset($result)){ echo $result.'<br /><hr>'; }
echo '<form method="POST" name="forum">';
echo '<table align="center" cellpadding="5" cellspacing="0" border="0">';
echo '<tr><td>Titel:</td><td><input type="text" name="title" value="'.strip_tags(htmlspecialchars($_POST['title'])).'" style="width: 350px;"></td></tr>';
$numb = rand(11111,99999);
echo '<tr><td>Typ: '.$numb.'<input type="hidden" name="validation" value="'.$numb.'"></td><td><input type="text" name="validation2" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td colspan="3" style="background-color: #ffffff;"><textarea id="area" name="description" style="width: 600px; height: 200px;">'.$_POST['description'].'</textarea></td></tr>';
echo '<tr><td colspan="3"><a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':D\');"><img src="img/1.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':)\');"><img src="img/2.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':(\');"><img src="img/3.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':o\');"><img src="img/4.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':s\');"><img src="img/5.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'8)\');"><img src="img/6.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':p\');"><img src="img/7.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(a)\');"><img src="img/8.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';)\');"><img src="img/9.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':|\');"><img src="img/10.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';(\');"><img src="img/11.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(w)\');"><img src="img/12.gif" border="0"></a></td></tr>';
echo '</table>';
echo '<hr><input type="submit" name="submit" value="Categorie toevoegen">';
echo '</form>';
echo '</div></td></tr></table>';
}
// Topics
elseif(isset($_GET['cat']) && !isset($_GET['top']) && is_numeric($_GET['cat'])){
$sqlcat = "SELECT title FROM categories WHERE id='".$_GET['cat']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php">Terug</a> <img src="img/darr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'&add=topic">Topic plaatsen</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td width="300" id="title">'.$rowcat['title'].'</td>';
echo '<td width="150" id="title">Auteur</td>';
echo '<td width="50" id="title">Reacties</td>';
echo '<td width="140" id="title">Laatst actief</td>';
echo '</tr>';
$sqltop = "SELECT * FROM topics WHERE cat='".$_GET['cat']."' ORDER BY id DESC";
$querytop = mysql_query($sqltop) or die(mysql_error());
$numstop = mysql_num_rows($querytop);
if($numstop >= 1){
$i = 1;
while($rowtop = mysql_fetch_assoc($querytop)){
$sqlrep = "SELECT name,email,date FROM replys WHERE tid='".$rowtop['id']."' ORDER BY id DESC LIMIT 1";
$sqlrep2 = "SELECT * FROM replys WHERE tid='".$rowtop['id']."'";
$queryrep = mysql_query($sqlrep) or die(mysql_error());
$queryrep2 = mysql_query($sqlrep2) or die(mysql_error());
$nums = mysql_num_rows($queryrep2);
$rowrep = mysql_fetch_assoc($queryrep);
echo '<tr bgcolor="'; if(1 & $i){ echo $conf_bg1; }else{ echo $conf_bg2; } echo '">';
echo '<td width="300"><a href="index.php?cat='.$_GET['cat'].'&top='.$rowtop['id'].'">'.strip_tags(htmlspecialchars($rowtop['title'])).'</a> '; if($rowtop['ip'] == $_SERVER['REMOTE_ADDR'] OR $conf_admin == $_SERVER['REMOTE_ADDR']){ echo ' <a href="index.php?cat='.$_GET['cat'].'&edit='.$rowtop['id'].'"><img src="img/edit.gif" border="0"></a> <a href="index.php?cat='.$_GET['cat'].'&delete='.$rowtop['id'].'"><img src="img/delete.gif" border="0"></a>'; } echo '</td>';
echo '<td width="50"><img src="img/pers.gif" border="0"> '; if($rowtop['email'] != ""){ echo '<a href="mailto:'.strip_tags(htmlspecialchars($rowtop['email'])).'">'.strip_tags(htmlspecialchars($rowtop['name'])).'</a>'; }else{ echo strip_tags(htmlspecialchars($rowtop['name'])); } echo '</td>';
echo '<td width="150">'.$nums.'</td>';
echo '<td width="130">'.$rowrep['date'].'<br /><img src="img/pers.gif" border="0"> '; if($rowrep['email'] != ""){ echo '<a href="mailto:'.strip_tags(htmlspecialchars($rowrep['email'])).'">'.strip_tags(htmlspecialchars($rowrep['name'])).'</a>'; }else{ echo strip_tags(htmlspecialchars($rowrep['name'])); } echo '</td>';
echo '</tr>';
$i++;
}
}
else{
echo '<tr><td colspan="4">Er zijn nog geen topics in deze categorie</td></tr>';
}
echo '</table>';
}
// Replys
elseif(isset($_GET['cat']) && isset($_GET['top']) && is_numeric($_GET['cat']) && is_numeric($_GET['top'])){
$sqlcat = "SELECT title FROM categories WHERE id='".$_GET['cat']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
$sqltop = "SELECT * FROM topics WHERE id='".$_GET['top']."'";
$querytop = mysql_query($sqltop) or die(mysql_error());
$rowtop = mysql_fetch_assoc($querytop);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'">Terug</a> <img src="img/darr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'&top='.$_GET['top'].'&add=reply">Reactie plaatsen</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">'.$rowcat['title'].' - '.strip_tags(htmlspecialchars($rowtop['title'])).'</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';"><img src="img/pers.gif" border="0"> '; if($rowtop['email'] != ""){ echo '<a href="mailto:'.strip_tags(htmlspecialchars($rowtop['email'])).'">'.strip_tags(htmlspecialchars($rowtop['name'])).'</a>, '.$rowtop['date']; }else{ echo strip_tags(htmlspecialchars($rowtop['name'])).', '.$rowtop['date']; } if($rowtop['ip'] == $_SERVER['REMOTE_ADDR'] OR $conf_admin == $_SERVER['REMOTE_ADDR']){ echo ' <a href="index.php?cat='.$_GET['cat'].'&edit='.$rowtop['id'].'"><img src="img/edit.gif" border="0"></a> <a href="index.php?cat='.$_GET['cat'].'&delete='.$rowtop['id'].'"><img src="img/delete.gif" border="0"></a>'; } echo '<br /><br />'.nl2br(smiley($rowtop['message'])).'</div></td>';
echo '</tr>';
$sqlrep = "SELECT * FROM replys WHERE tid='".$_GET['top']."' ORDER BY id ASC";
$queryrep = mysql_query($sqlrep) or die(mysql_error());
$numsrep = mysql_num_rows($queryrep);
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">Reacties ('.$numsrep.')</td>';
echo '</tr>';
while($rowrep = mysql_fetch_assoc($queryrep)){
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';"><img src="img/pers.gif" border="0"> '; if($rowrep['email'] != ""){ echo '<a href="mailto:'.strip_tags(htmlspecialchars($rowrep['email'])).'">'.strip_tags(htmlspecialchars($rowrep['name'])).'</a>, '.$rowrep['date']; }else{ echo strip_tags(htmlspecialchars($rowrep['name'])).', '.$rowrep['date']; } if($rowrep['ip'] == $_SERVER['REMOTE_ADDR'] OR $conf_admin == $_SERVER['REMOTE_ADDR']){ echo ' <a href="index.php?cat='.$_GET['cat'].'&top='.$_GET['top'].'&edit='.$rowrep['id'].'"><img src="img/edit.gif" border="0"></a> <a href="index.php?cat='.$_GET['cat'].'&top='.$_GET['top'].'&delete='.$rowrep['id'].'"><img src="img/delete.gif" border="0"></a>'; } echo '<br /><br />'.nl2br(smiley($rowrep['message'])).'</div></td>';
echo '</tr>';
}
echo '</table>';
}
// Categories
else{
if($conf_admin == $_SERVER['REMOTE_ADDR']){ echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/darr.gif" border="0"> <a href="index.php?add=category">Categorie toevoegen</a></div>'; }
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td width="450" id="title">RKTVVza2 News</td>';
echo '<td id="title">Laatst actief</td>';
echo '</tr>';
$sqlcat = "SELECT * FROM categories";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$numscat = mysql_num_rows($querycat);
if($numscat >= 1){
$i = 1;
while($rowcat = mysql_fetch_assoc($querycat)){
$sqltop = "SELECT name,email,date FROM topics WHERE cat='".$rowcat['id']."' ORDER BY id DESC LIMIT 1";
$querytop = mysql_query($sqltop) or die(mysql_error());
$rowtop = mysql_fetch_assoc($querytop);
echo '<tr bgcolor="'; if(1 & $i){ echo $conf_bg1; }else{ echo $conf_bg2; } echo '">';
echo '<td width="450"><img src="img/category.gif" border="0"> <a href="index.php?cat='.$rowcat['id'].'">'.$rowcat['title'].'</a> '; if($conf_admin == $_SERVER['REMOTE_ADDR']){ echo ' <a href="index.php?edit='.$rowcat['id'].'"><img src="img/edit.gif" border="0"></a> <a href="index.php?delete='.$rowcat['id'].'"><img src="img/delete.gif" border="0"></a>'; } echo '<br /><br /><div id="description">'.smiley($rowcat['description']).'</div></td>';
echo '<td style="border-left: 1px solid '.$conf_bordercolor.'">'.$rowtop['date'].'<br /><img src="img/pers.gif" border="0"> '; if($rowtop['email'] != ""){ echo '<a href="mailto:'.strip_tags(htmlspecialchars($rowtop['email'])).'">'.strip_tags(htmlspecialchars($rowtop['name'])).'</a>'; }else{ echo strip_tags(htmlspecialchars($rowtop['name'])); } echo '</td>';
echo '</tr>';
$i++;
}
}
else{
echo '<tr><td colspan="2">Er zijn nog geen categorieën</td></tr>';
}
echo '</table>';
}
?>
// Edit category
if(!isset($_GET['cat']) && !isset($_GET['top']) && isset($_GET['edit'])){
$sqlcat = "SELECT * FROM categories WHERE id='".$_GET['edit']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php">Terug</a></div>';
echo '<table width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">'.$rowcat['title'].' - Categorie Wijzigen</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';">';
if(isset($result)){ echo $result.'<br /><hr>'; }
echo '<form method="POST" name="forum">';
echo '<table align="center" cellpadding="5" cellspacing="0" border="0">';
echo '<tr><td>Titel:</td><td><input type="text" name="title" value="'.strip_tags(htmlspecialchars($rowcat['title'])).'" style="width: 350px;"></td></tr>';
$numb = rand(11111,99999);
echo '<tr><td>Typ: '.$numb.'<input type="hidden" name="validation" value="'.$numb.'"></td><td><input type="text" name="validation2" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td colspan="3" style="background-color: #ffffff;"><textarea id="area" name="description" style="width: 600px; height: 200px;">'.$rowcat['description'].'</textarea></td></tr>';
echo '<tr><td colspan="3"><a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':D\');"><img src="img/1.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':)\');"><img src="img/2.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':(\');"><img src="img/3.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':o\');"><img src="img/4.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':s\');"><img src="img/5.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'8)\');"><img src="img/6.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':p\');"><img src="img/7.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(a)\');"><img src="img/8.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';)\');"><img src="img/9.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':|\');"><img src="img/10.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';(\');"><img src="img/11.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(w)\');"><img src="img/12.gif" border="0"></a></td></tr>';
echo '</table>';
echo '<hr><input type="submit" name="submit" value="Categorie wijzigen">';
echo '</form>';
echo '</div></td></tr></table>';
}
// Edit topic
elseif(isset($_GET['cat']) && isset($_GET['edit']) && !isset($_GET['top']) && is_numeric($_GET['cat']) && is_numeric($_GET['edit'])){
$sqlcat = "SELECT title FROM categories WHERE id='".$_GET['cat']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
$sqltop = "SELECT * FROM topics WHERE id='".$_GET['edit']."'";
$querytop = mysql_query($sqltop) or die(mysql_error());
$rowtop = mysql_fetch_assoc($querytop);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'&top='.$_GET['edit'].'">Terug</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">'.$rowcat['title'].' - '.strip_tags(htmlspecialchars($rowtop['title'])).' - Topic wijzigen</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';">';
if(isset($result)){ echo $result.'<br /><hr>'; }
echo '<form method="POST" name="forum">';
echo '<table align="center" cellpadding="5" cellspacing="0" border="0">';
echo '<tr><td>Naam:</td><td><input type="text" name="name" value="'; if(isset($_COOKIE['name']) OR $_COOKIE['name'] == $rowtop['name']){ echo strip_tags(htmlspecialchars($_COOKIE['name'])); }else{ echo strip_tags(htmlspecialchars($rowtop['name'])); } echo '" style="width: 350px;"></td><td rowspan="2"><input type="checkbox" name="save" '; if(isset($_COOKIE['name']) && isset($_COOKIE['email'])){ echo 'CHECKED'; } echo '> <font style="font-size: 12px;">Gegevens bewaren</font></td></tr>';
echo '<tr><td>Email adres:</td><td><input type="text" name="email" value="'; if(isset($_COOKIE['email']) OR $_COOKIE['email'] == $rowtop['email']){ echo strip_tags(htmlspecialchars($_COOKIE['email'])); }else{ echo strip_tags(htmlspecialchars($rowtop['email'])); } echo '" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td>Titel:</td><td><input type="text" name="title" value="'.strip_tags(htmlspecialchars($rowtop['title'])).'" style="width: 350px;"></td></tr>';
$numb = rand(11111,99999);
echo '<tr><td>Typ: '.$numb.'<input type="hidden" name="validation" value="'.$numb.'"></td><td><input type="text" name="validation2" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td colspan="3" style="background-color: #ffffff;"><textarea id="area" name="message" style="width: 600px; height: 200px;">'.$rowtop['message'].'</textarea></td></tr>';
echo '<tr><td colspan="3"><a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':D\');"><img src="img/1.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':)\');"><img src="img/2.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':(\');"><img src="img/3.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':o\');"><img src="img/4.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':s\');"><img src="img/5.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'8)\');"><img src="img/6.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':p\');"><img src="img/7.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(a)\');"><img src="img/8.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';)\');"><img src="img/9.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':|\');"><img src="img/10.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';(\');"><img src="img/11.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(w)\');"><img src="img/12.gif" border="0"></a></td></tr>';
echo '</table>';
echo '<hr><input type="submit" name="submit" value="Topic wijzigen">';
echo '</form>';
echo '</div></td></tr></table>';
}
// Edit reply
elseif(isset($_GET['cat']) && isset($_GET['top']) && isset($_GET['edit']) && is_numeric($_GET['cat']) && is_numeric($_GET['top']) && is_numeric($_GET['edit'])){
$sqlcat = "SELECT title FROM categories WHERE id='".$_GET['cat']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
$sqltop = "SELECT title FROM topics WHERE id='".$_GET['top']."'";
$querytop = mysql_query($sqltop) or die(mysql_error());
$rowtop = mysql_fetch_assoc($querytop);
$sqlrep = "SELECT * FROM replys WHERE id='".$_GET['edit']."'";
$queryrep = mysql_query($sqlrep) or die(mysql_error());
$rowrep = mysql_fetch_assoc($queryrep);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'">Terug</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">'.$rowcat['title'].' - '.strip_tags(htmlspecialchars($rowtop['title'])).' - Reactie wijzigen</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';">';
if(isset($result)){ echo $result.'<br /><hr>'; }
echo '<form method="POST" name="forum">';
echo '<table align="center" cellpadding="5" cellspacing="0" border="0">';
echo '<tr><td>Naam:</td><td><input type="text" name="name" value="'; if(isset($_COOKIE['name']) OR $_COOKIE['name'] == $rowrep['name']){ echo strip_tags(htmlspecialchars($_COOKIE['name'])); }else{ echo strip_tags(htmlspecialchars($rowrep['name'])); } echo '" style="width: 350px;"></td><td rowspan="2"><input type="checkbox" name="save" '; if(isset($_COOKIE['name']) && isset($_COOKIE['email'])){ echo 'CHECKED'; } echo '> <font style="font-size: 12px;">Gegevens bewaren</font></td></tr>';
echo '<tr><td>Email adres:</td><td><input type="text" name="email" value="'; if(isset($_COOKIE['email']) OR $_COOKIE['email'] == $rowrep['email']){ echo strip_tags(htmlspecialchars($_COOKIE['email'])); }else{ echo strip_tags(htmlspecialchars($rowrep['email'])); } echo '" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td>Titel:</td><td>'.strip_tags(htmlspecialchars($rowtop['title'])).'</td></tr>';
$numb = rand(11111,99999);
echo '<tr><td>Typ: '.$numb.'<input type="hidden" name="validation" value="'.$numb.'"></td><td><input type="text" name="validation2" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td colspan="3" style="background-color: #ffffff;"><textarea id="area" name="message" style="width: 600px; height: 200px;">'.$rowrep['message'].'</textarea></td></tr>';
echo '<tr><td colspan="3"><a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':D\');"><img src="img/1.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':)\');"><img src="img/2.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':(\');"><img src="img/3.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':o\');"><img src="img/4.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':s\');"><img src="img/5.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'8)\');"><img src="img/6.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':p\');"><img src="img/7.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(a)\');"><img src="img/8.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';)\');"><img src="img/9.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':|\');"><img src="img/10.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';(\');"><img src="img/11.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(w)\');"><img src="img/12.gif" border="0"></a></td></tr>';
echo '</table>';
echo '<hr><input type="submit" name="submit" value="Reactie wijzigen">';
echo '</form>';
echo '</div></td></tr></table>';
}
// Delete category
elseif(!isset($_GET['cat']) && isset($_GET['delete']) && !isset($_GET['top']) && is_numeric($_GET['delete'])){
$sqltop = "DELETE FROM categories WHERE id='".$_GET['delete']."'";
if(mysql_query($sqltop) or die(mysql_error())){
echo '<script>window.location=\'index.php\';</script>';
}
}
// Delete topic
elseif(isset($_GET['cat']) && isset($_GET['delete']) && !isset($_GET['top']) && is_numeric($_GET['cat']) && is_numeric($_GET['delete'])){
$sqltop = "DELETE FROM topics WHERE id='".$_GET['delete']."'";
if(mysql_query($sqltop) or die(mysql_error())){
echo '<script>window.location=\'index.php?cat='.$_GET['cat'].'\';</script>';
}
}
// Delete reply
elseif(isset($_GET['cat']) && isset($_GET['top']) && isset($_GET['delete']) && is_numeric($_GET['cat']) && is_numeric($_GET['top']) && is_numeric($_GET['delete'])){
$sqlrep = "DELETE FROM replys WHERE id='".$_GET['delete']."'";
if(mysql_query($sqlrep) or die(mysql_error())){
echo '<script>window.location=\'index.php?cat='.$_GET['cat'].'&top='.$_GET['top'].'\';</script>';
}
}
// Add topic
elseif(isset($_GET['cat']) && $_GET['add'] == "topic" && is_numeric($_GET['cat'])){
$sqlcat = "SELECT title FROM categories WHERE id='".$_GET['cat']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'">Terug</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">'.$rowcat['title'].' - Topic toevoegen</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';">';
if(isset($result)){ echo $result.'<br /><hr>'; }
echo '<form method="POST" name="forum">';
echo '<table align="center" cellpadding="5" cellspacing="0" border="0">';
echo '<tr><td>Naam:</td><td><input type="text" name="name" value="'; if(isset($_COOKIE['name']) OR $_COOKIE['name'] == $_POST['name']){ echo strip_tags(htmlspecialchars($_COOKIE['name'])); }else{ echo strip_tags(htmlspecialchars($_POST['name'])); } echo '" style="width: 350px;"></td><td rowspan="2"><input type="checkbox" name="save" '; if(isset($_COOKIE['name']) && isset($_COOKIE['email'])){ echo 'CHECKED'; } echo '> <font style="font-size: 12px;">Gegevens bewaren</font></td></tr>';
echo '<tr><td>Email adres:</td><td><input type="text" name="email" value="'; if(isset($_COOKIE['email']) OR $_COOKIE['email'] == $_POST['email']){ echo strip_tags(htmlspecialchars($_COOKIE['email'])); }else{ echo strip_tags(htmlspecialchars($_POST['email'])); } echo '" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td>Titel:</td><td><input type="text" name="title" value="'.strip_tags(htmlspecialchars($_POST['title'])).'" style="width: 350px;"></td></tr>';
$numb = rand(11111,99999);
echo '<tr><td>Typ: '.$numb.'<input type="hidden" name="validation" value="'.$numb.'"></td><td><input type="text" name="validation2" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td colspan="3" style="background-color: #ffffff;"><textarea id="area" name="message" style="width: 600px; height: 200px;">'.$_POST['message'].'</textarea></td></tr>';
echo '<tr><td colspan="3"><a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':D\');"><img src="img/1.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':)\');"><img src="img/2.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':(\');"><img src="img/3.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':o\');"><img src="img/4.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':s\');"><img src="img/5.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'8)\');"><img src="img/6.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':p\');"><img src="img/7.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(a)\');"><img src="img/8.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';)\');"><img src="img/9.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':|\');"><img src="img/10.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';(\');"><img src="img/11.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(w)\');"><img src="img/12.gif" border="0"></a></td></tr>';
echo '</table>';
echo '<hr><input type="submit" name="submit" value="Topic plaatsen">';
echo '</form>';
echo '</div></td></tr></table>';
}
// Add reply
elseif(isset($_GET['cat']) && isset($_GET['top']) && $_GET['add'] == "reply" && is_numeric($_GET['cat']) && is_numeric($_GET['top'])){
$sqlcat = "SELECT title FROM categories WHERE id='".$_GET['cat']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
$sqltop = "SELECT title FROM topics WHERE id='".$_GET['top']."'";
$querytop = mysql_query($sqltop) or die(mysql_error());
$rowtop = mysql_fetch_assoc($querytop);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'">Terug</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">'.$rowcat['title'].' - '.strip_tags(htmlspecialchars($rowtop['title'])).' - Reactie plaatsen</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';">';
if(isset($result)){ echo $result.''; }
echo '<form method="POST" name="forum">';
echo '<table align="center" cellpadding="5" cellspacing="0" border="0">';
echo '<tr><td>Naam:</td><td><input type="text" name="name" value="'; if(isset($_COOKIE['name']) OR $_COOKIE['name'] == $_POST['name']){ echo strip_tags(htmlspecialchars($_COOKIE['name'])); }else{ echo strip_tags(htmlspecialchars($_POST['name'])); } echo '" style="width: 350px;"></td><td rowspan="2"><input type="checkbox" name="save" '; if(isset($_COOKIE['name']) && isset($_COOKIE['email'])){ echo 'CHECKED'; } echo '> <font style="font-size: 12px;">Gegevens bewaren</font></td></tr>';
echo '<tr><td>Email adres:</td><td><input type="text" name="email" value="'; if(isset($_COOKIE['email']) OR $_COOKIE['email'] == $_POST['email']){ echo strip_tags(htmlspecialchars($_COOKIE['email'])); }else{ echo strip_tags(htmlspecialchars($_POST['email'])); } echo '" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td>Titel:</td><td>'.strip_tags(htmlspecialchars($rowtop['title'])).'</td></tr>';
$numb = rand(11111,99999);
echo '<tr><td>Typ: '.$numb.'<input type="hidden" name="validation" value="'.$numb.'"></td><td><input type="text" name="validation2" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td colspan="3" style="background-color: #ffffff;"><textarea id="area" name="message" style="width: 600px; height: 200px;">'.$_POST['message'].'</textarea></td></tr>';
echo '<tr><td colspan="3"><a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':D\');"><img src="img/1.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':)\');"><img src="img/2.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':(\');"><img src="img/3.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':o\');"><img src="img/4.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':s\');"><img src="img/5.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'8)\');"><img src="img/6.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':p\');"><img src="img/7.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(a)\');"><img src="img/8.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';)\');"><img src="img/9.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':|\');"><img src="img/10.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';(\');"><img src="img/11.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(w)\');"><img src="img/12.gif" border="0"></a></td></tr>';
echo '</table>';
echo '<hr><input type="submit" name="submit" value="Reactie plaatsen">';
echo '</form>';
echo '</div></td></tr></table>';
}
// Add category
elseif(!isset($_GET['cat']) && !isset($_GET['top']) && $_GET['add'] == "category"){
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php">Terug</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">Categorie toevoegen</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';">';
if(isset($result)){ echo $result.'<br /><hr>'; }
echo '<form method="POST" name="forum">';
echo '<table align="center" cellpadding="5" cellspacing="0" border="0">';
echo '<tr><td>Titel:</td><td><input type="text" name="title" value="'.strip_tags(htmlspecialchars($_POST['title'])).'" style="width: 350px;"></td></tr>';
$numb = rand(11111,99999);
echo '<tr><td>Typ: '.$numb.'<input type="hidden" name="validation" value="'.$numb.'"></td><td><input type="text" name="validation2" style="width: 350px;"></td></tr>';
echo '<tr><td colspan="3"> </td></tr>';
echo '<tr><td colspan="3" style="background-color: #ffffff;"><textarea id="area" name="description" style="width: 600px; height: 200px;">'.$_POST['description'].'</textarea></td></tr>';
echo '<tr><td colspan="3"><a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':D\');"><img src="img/1.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':)\');"><img src="img/2.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':(\');"><img src="img/3.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':o\');"><img src="img/4.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':s\');"><img src="img/5.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'8)\');"><img src="img/6.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':p\');"><img src="img/7.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(a)\');"><img src="img/8.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';)\');"><img src="img/9.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\':|\');"><img src="img/10.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\';(\');"><img src="img/11.gif" border="0"></a>
<a onclick="var xxx = nicEditors.findEditor(\'area\'); var yyy = xxx.getContent(); xxx.setContent(yyy+\'(w)\');"><img src="img/12.gif" border="0"></a></td></tr>';
echo '</table>';
echo '<hr><input type="submit" name="submit" value="Categorie toevoegen">';
echo '</form>';
echo '</div></td></tr></table>';
}
// Topics
elseif(isset($_GET['cat']) && !isset($_GET['top']) && is_numeric($_GET['cat'])){
$sqlcat = "SELECT title FROM categories WHERE id='".$_GET['cat']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php">Terug</a> <img src="img/darr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'&add=topic">Topic plaatsen</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td width="300" id="title">'.$rowcat['title'].'</td>';
echo '<td width="150" id="title">Auteur</td>';
echo '<td width="50" id="title">Reacties</td>';
echo '<td width="140" id="title">Laatst actief</td>';
echo '</tr>';
$sqltop = "SELECT * FROM topics WHERE cat='".$_GET['cat']."' ORDER BY id DESC";
$querytop = mysql_query($sqltop) or die(mysql_error());
$numstop = mysql_num_rows($querytop);
if($numstop >= 1){
$i = 1;
while($rowtop = mysql_fetch_assoc($querytop)){
$sqlrep = "SELECT name,email,date FROM replys WHERE tid='".$rowtop['id']."' ORDER BY id DESC LIMIT 1";
$sqlrep2 = "SELECT * FROM replys WHERE tid='".$rowtop['id']."'";
$queryrep = mysql_query($sqlrep) or die(mysql_error());
$queryrep2 = mysql_query($sqlrep2) or die(mysql_error());
$nums = mysql_num_rows($queryrep2);
$rowrep = mysql_fetch_assoc($queryrep);
echo '<tr bgcolor="'; if(1 & $i){ echo $conf_bg1; }else{ echo $conf_bg2; } echo '">';
echo '<td width="300"><a href="index.php?cat='.$_GET['cat'].'&top='.$rowtop['id'].'">'.strip_tags(htmlspecialchars($rowtop['title'])).'</a> '; if($rowtop['ip'] == $_SERVER['REMOTE_ADDR'] OR $conf_admin == $_SERVER['REMOTE_ADDR']){ echo ' <a href="index.php?cat='.$_GET['cat'].'&edit='.$rowtop['id'].'"><img src="img/edit.gif" border="0"></a> <a href="index.php?cat='.$_GET['cat'].'&delete='.$rowtop['id'].'"><img src="img/delete.gif" border="0"></a>'; } echo '</td>';
echo '<td width="50"><img src="img/pers.gif" border="0"> '; if($rowtop['email'] != ""){ echo '<a href="mailto:'.strip_tags(htmlspecialchars($rowtop['email'])).'">'.strip_tags(htmlspecialchars($rowtop['name'])).'</a>'; }else{ echo strip_tags(htmlspecialchars($rowtop['name'])); } echo '</td>';
echo '<td width="150">'.$nums.'</td>';
echo '<td width="130">'.$rowrep['date'].'<br /><img src="img/pers.gif" border="0"> '; if($rowrep['email'] != ""){ echo '<a href="mailto:'.strip_tags(htmlspecialchars($rowrep['email'])).'">'.strip_tags(htmlspecialchars($rowrep['name'])).'</a>'; }else{ echo strip_tags(htmlspecialchars($rowrep['name'])); } echo '</td>';
echo '</tr>';
$i++;
}
}
else{
echo '<tr><td colspan="4">Er zijn nog geen topics in deze categorie</td></tr>';
}
echo '</table>';
}
// Replys
elseif(isset($_GET['cat']) && isset($_GET['top']) && is_numeric($_GET['cat']) && is_numeric($_GET['top'])){
$sqlcat = "SELECT title FROM categories WHERE id='".$_GET['cat']."'";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$rowcat = mysql_fetch_assoc($querycat);
$sqltop = "SELECT * FROM topics WHERE id='".$_GET['top']."'";
$querytop = mysql_query($sqltop) or die(mysql_error());
$rowtop = mysql_fetch_assoc($querytop);
echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/larr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'">Terug</a> <img src="img/darr.gif" border="0"> <a href="index.php?cat='.$_GET['cat'].'&top='.$_GET['top'].'&add=reply">Reactie plaatsen</a></div>';
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">'.$rowcat['title'].' - '.strip_tags(htmlspecialchars($rowtop['title'])).'</td>';
echo '</tr>';
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';"><img src="img/pers.gif" border="0"> '; if($rowtop['email'] != ""){ echo '<a href="mailto:'.strip_tags(htmlspecialchars($rowtop['email'])).'">'.strip_tags(htmlspecialchars($rowtop['name'])).'</a>, '.$rowtop['date']; }else{ echo strip_tags(htmlspecialchars($rowtop['name'])).', '.$rowtop['date']; } if($rowtop['ip'] == $_SERVER['REMOTE_ADDR'] OR $conf_admin == $_SERVER['REMOTE_ADDR']){ echo ' <a href="index.php?cat='.$_GET['cat'].'&edit='.$rowtop['id'].'"><img src="img/edit.gif" border="0"></a> <a href="index.php?cat='.$_GET['cat'].'&delete='.$rowtop['id'].'"><img src="img/delete.gif" border="0"></a>'; } echo '<br /><br />'.nl2br(smiley($rowtop['message'])).'</div></td>';
echo '</tr>';
$sqlrep = "SELECT * FROM replys WHERE tid='".$_GET['top']."' ORDER BY id ASC";
$queryrep = mysql_query($sqlrep) or die(mysql_error());
$numsrep = mysql_num_rows($queryrep);
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td id="title">Reacties ('.$numsrep.')</td>';
echo '</tr>';
while($rowrep = mysql_fetch_assoc($queryrep)){
echo '<tr>';
echo '<td><div id="message" style="padding: 10px; background-color: '.$conf_topicbgcolor.';"><img src="img/pers.gif" border="0"> '; if($rowrep['email'] != ""){ echo '<a href="mailto:'.strip_tags(htmlspecialchars($rowrep['email'])).'">'.strip_tags(htmlspecialchars($rowrep['name'])).'</a>, '.$rowrep['date']; }else{ echo strip_tags(htmlspecialchars($rowrep['name'])).', '.$rowrep['date']; } if($rowrep['ip'] == $_SERVER['REMOTE_ADDR'] OR $conf_admin == $_SERVER['REMOTE_ADDR']){ echo ' <a href="index.php?cat='.$_GET['cat'].'&top='.$_GET['top'].'&edit='.$rowrep['id'].'"><img src="img/edit.gif" border="0"></a> <a href="index.php?cat='.$_GET['cat'].'&top='.$_GET['top'].'&delete='.$rowrep['id'].'"><img src="img/delete.gif" border="0"></a>'; } echo '<br /><br />'.nl2br(smiley($rowrep['message'])).'</div></td>';
echo '</tr>';
}
echo '</table>';
}
// Categories
else{
if($conf_admin == $_SERVER['REMOTE_ADDR']){ echo '<div style="padding-bottom: 5px; width: '.$conf_width.'px; text-align: right;"><img src="img/darr.gif" border="0"> <a href="index.php?add=category">Categorie toevoegen</a></div>'; }
echo '<table align="center" width="'.$conf_width.'" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid '.$conf_bordercolor.';">';
echo '<tr bgcolor="'.$conf_titlebgcolor.'">';
echo '<td width="450" id="title">RKTVVza2 News</td>';
echo '<td id="title">Laatst actief</td>';
echo '</tr>';
$sqlcat = "SELECT * FROM categories";
$querycat = mysql_query($sqlcat) or die(mysql_error());
$numscat = mysql_num_rows($querycat);
if($numscat >= 1){
$i = 1;
while($rowcat = mysql_fetch_assoc($querycat)){
$sqltop = "SELECT name,email,date FROM topics WHERE cat='".$rowcat['id']."' ORDER BY id DESC LIMIT 1";
$querytop = mysql_query($sqltop) or die(mysql_error());
$rowtop = mysql_fetch_assoc($querytop);
echo '<tr bgcolor="'; if(1 & $i){ echo $conf_bg1; }else{ echo $conf_bg2; } echo '">';
echo '<td width="450"><img src="img/category.gif" border="0"> <a href="index.php?cat='.$rowcat['id'].'">'.$rowcat['title'].'</a> '; if($conf_admin == $_SERVER['REMOTE_ADDR']){ echo ' <a href="index.php?edit='.$rowcat['id'].'"><img src="img/edit.gif" border="0"></a> <a href="index.php?delete='.$rowcat['id'].'"><img src="img/delete.gif" border="0"></a>'; } echo '<br /><br /><div id="description">'.smiley($rowcat['description']).'</div></td>';
echo '<td style="border-left: 1px solid '.$conf_bordercolor.'">'.$rowtop['date'].'<br /><img src="img/pers.gif" border="0"> '; if($rowtop['email'] != ""){ echo '<a href="mailto:'.strip_tags(htmlspecialchars($rowtop['email'])).'">'.strip_tags(htmlspecialchars($rowtop['name'])).'</a>'; }else{ echo strip_tags(htmlspecialchars($rowtop['name'])); } echo '</td>';
echo '</tr>';
$i++;
}
}
else{
echo '<tr><td colspan="2">Er zijn nog geen categorieën</td></tr>';
}
echo '</table>';
}
?>
</body>
</html>
Toevoeging op 24/02/2011 12:58:06:
Ik ben te snel geweest met me reactie haha.
Keek net pas op het forum.
Snap niet waarom het bij de personenen die nu getest hebben, geen witregels komen...
Zie laatste test van mij op het forum.
Regel 1 , Regel 2 , Regel 3.
Ik heb daar ENTER gebruikt en dan komen er toch witregels...
Toevoeging op 24/02/2011 13:17:37:
Bedankt voor de tip over de mailto, maar als ik dat weghaal , werkt heel het forum niet meer. Wellicht kun je dmv van het script mij helpen om aan te geven welke regel ik weg moet halen zodat hij geen mailto link meer maakt..?
Dit is sowieso de reden waarom ik naar het forum ben gegaan voor hulp, omdat wanneer ik iets probeer aan te passen in het script, werkt vervolgens heel het forum niet meer en krijg ik een mooie witte pagina te zien ipv het forum xD!!
Gewijzigd op 24/02/2011 12:54:28 door Peter vander Zande
Code (php)
1
2
3
2
3
<?php
echo '<td style="border-left: 1px solid '.$conf_bordercolor.'">' . $rowtop['date'] . '<br /><img src="img/pers.gif" border="0"> '; if($rowtop['email'] != ""){ echo strip_tags(htmlspecialchars($rowtop['email'])); }else{ echo strip_tags(htmlspecialchars($rowtop['name'])); } echo '</td>';
?>
echo '<td style="border-left: 1px solid '.$conf_bordercolor.'">' . $rowtop['date'] . '<br /><img src="img/pers.gif" border="0"> '; if($rowtop['email'] != ""){ echo strip_tags(htmlspecialchars($rowtop['email'])); }else{ echo strip_tags(htmlspecialchars($rowtop['name'])); } echo '</td>';
?>
Trouwens, dit vind ik vrij vreemd: strip_tags(htmlspecialchars($rowtop['email'])) (of andere velden; komt vaak voor)
Ik zou htmlspecialchars(strip_tags($rowtop['email'])) zinniger vinden
bedankt man, zal die lijn zo ff aanpassen.
Verder over die HTML SPECIAL CHARS weet ik ook niet. Heb het script mar via google gevonden...
Ik sluit ook deze topic omdat het probleem met de witregels, de ene keer wel en de andere x nie voorkomt....
In ieders geval bedankt voor de reacties!