287 |
$reason = ""; $score = 0; |
$reason = ""; $score = 0; |
288 |
dbconnect(); |
dbconnect(); |
289 |
if ($pid!=0) { |
if ($pid!=0) { |
290 |
list($date, $name, $email, $url, $subject, $comment, $score, $reason) = mysql_fetch_row(mysql_query("SELECT date, name, email, url, subject, comment, score, reason FROM comments WHERE tid='$pid'")); |
list($date, $name, $email, $url, $subject, $comment, $score, |
291 |
|
$reason) = mysql_fetch_row(mysql_query("SELECT date, ". |
292 |
|
"name, email, url, subject, comment, score, ". |
293 |
|
"reason FROM comments WHERE tid='$pid'")); |
294 |
} else { |
} else { |
295 |
list($date, $subject, $temp_comment, $comment, $name, $notes) = mysql_fetch_row(mysql_query("SELECT time, title, hometext, bodytext, informant, notes FROM stories WHERE sid='$sid'")); |
list($date, $subject, $temp_comment, $comment, $name, |
296 |
|
$notes) = mysql_fetch_row(mysql_query("SELECT time, ". |
297 |
|
"title, hometext, bodytext, informant, ". |
298 |
|
"notes FROM stories WHERE sid='$sid'")); |
299 |
} |
} |
300 |
if ($comment == "") $comment = $temp_comment; |
if ($comment == "") $comment = $temp_comment; |
301 |
|
|
335 |
echo "<input type=\"checkbox\" id=\"spell\" name=\"spell\"" . (($spell) ? " checked" : "") . "> <label for=\"spell\">Kontrollera stavning</label><br>\n"; |
echo "<input type=\"checkbox\" id=\"spell\" name=\"spell\"" . (($spell) ? " checked" : "") . "> <label for=\"spell\">Kontrollera stavning</label><br>\n"; |
336 |
} |
} |
337 |
echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">\n" |
echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">\n" |
338 |
."<input class=\"textbox\" type=\"hidden\" name=\"sid\" value=\"$sid\"><input class=\"textbox\" type=\"hidden\" name=\"mode\" value=\"$mode\">\n" |
."<input class=\"textbox\" type=\"hidden\" name=\"sid\" value=\"$sid\">" |
339 |
."<input class=\"textbox\" type=\"hidden\" name=\"order\" value=\"$order\"><input class=textbox type=\"hidden\" name=\"thold\" value=\"$thold\">\n" |
."<input class=\"textbox\" type=\"hidden\" name=\"mode\" value=\"$mode\">\n" |
340 |
."<input type=\"submit\" name=\"op\" value=\"Preview\" class=\"button\">\n" |
."<input class=\"textbox\" type=\"hidden\" name=\"order\" value=\"$order\">" |
341 |
."<input type=\"submit\" name=\"op\" value=\"Ok!\" class=\"button\"> <select name=\"posttype\"><option value=\"exttrans\">Extrans (HTML till text)<option value=\"html\" >HTML-formatterad<option value=\"plaintext\" selected>Vanlig text</select></form><br>\n"; |
."<input class=\"textbox\" type=\"hidden\" name=\"thold\" value=\"$thold\">\n" |
342 |
|
."<input type=\"submit\" name=\"op\" value=\"Preview\" class=\"button\">\n" |
343 |
|
."<input type=\"submit\" name=\"op\" value=\"Ok!\" class=\"button\"> " |
344 |
|
."<select name=\"posttype\">" |
345 |
|
."<option value=\"source\">Källkod" |
346 |
|
."<option value=\"html\">HTML-formatterad" |
347 |
|
."<option value=\"plaintext\" selected>Vanlig text" |
348 |
|
."</select></form><br>\n"; |
349 |
|
|
350 |
include('footer.php'); |
include('footer.php'); |
351 |
} |
} |
365 |
$subject = strip_tags($subject); |
$subject = strip_tags($subject); |
366 |
$comment = stripslashes($comment); |
$comment = stripslashes($comment); |
367 |
|
|
368 |
if (!isset($pid) || !isset($sid)) { echo "Something is not right with passing a variable to this function. This message is just to keep things from messing up down the road"; exit(); } |
if (!isset($pid) || !isset($sid)) { echo "<img src=\"images/warning.png\">Någonting är väldigt fel."; exit(); } |
369 |
|
|
370 |
if ($user and !$postanon) |
if ($user and !$postanon) |
371 |
$name = $cookie[1]; |
$name = $cookie[1]; |
372 |
else { |
else { |
373 |
$name = $anonymous; $usersig=""; } |
$name = $anonymous; $usersig=""; } |
374 |
|
|
375 |
if ($posttype == "exttrans") |
if ($posttype == "source") |
376 |
$viewcomment = nl2br(htmlspecialchars($comment)).$usersig; |
$viewcomment = '<pre>'.nowordlinksshow($comment).'</pre>'.$usersig; |
377 |
else { |
else { |
378 |
$comment = filter_text($comment); |
$comment = filter_text($comment); |
379 |
if ($posttype == "plaintext") |
if ($posttype == "plaintext") |
407 |
echo "<input type=\"checkbox\" id=\"spell\" name=\"spell\"" . (($spell) ? " checked" : "") . "> <label for=\"spell\">Kontrollera stavning</label><br>\n"; |
echo "<input type=\"checkbox\" id=\"spell\" name=\"spell\"" . (($spell) ? " checked" : "") . "> <label for=\"spell\">Kontrollera stavning</label><br>\n"; |
408 |
} |
} |
409 |
echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">" |
echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">" |
410 |
."<input class=\"textbox\" type=\"hidden\" name=\"sid\" value=\"$sid\"><input class=\"textbox\" type=\"hidden\" name=\"mode\" value=\"$mode\">\n" |
."<input class=\"textbox\" type=\"hidden\" name=\"sid\" value=\"$sid\">" |
411 |
."<input class=\"textbox\" type=\"hidden\" name=\"order\" value=\"$order\"><input class=\"textbox\" type=\"hidden\" name=\"thold\" value=\"$thold\">\n" |
."<input class=\"textbox\" type=\"hidden\" name=\"mode\" value=\"$mode\">\n" |
412 |
."<input type=\"submit\" name=\"op\" value=\"Preview\" class=\"button\">\n" |
."<input class=\"textbox\" type=\"hidden\" name=\"order\" value=\"$order\">" |
413 |
."<input type=\"submit\" name=\"op\" value=\"Ok!\" class=\"button\"> <select name=\"posttype\"><option value=\"exttrans\""; |
."<input class=\"textbox\" type=\"hidden\" name=\"thold\" value=\"$thold\">\n" |
414 |
if ($posttype == "exttrans") echo " selected"; |
."<input type=\"submit\" name=\"op\" value=\"Preview\" class=\"button\">\n" |
415 |
echo ">Extrans (HTML till text)<option value=\"html\"";; |
."<input type=\"submit\" name=\"op\" value=\"Ok!\" class=\"button\"> " |
416 |
if ($posttype=="html") echo " selected"; |
."<select name=\"posttype\">" |
417 |
echo ">HTML-formatterad<option value=\"plaintext\""; |
."<option value=\"source\""; |
418 |
if (($posttype!="exttrans") && ($posttype!="html")) echo " selected"; |
if ($posttype == "source") echo " selected"; |
419 |
echo ">Vanlig text</select></form><br>\n"; |
echo ">Källkod". |
420 |
|
"<option value=\"html\""; |
421 |
|
if ($posttype == "html") echo " selected"; |
422 |
|
echo ">HTML-formatterad". |
423 |
|
"<option value=\"plaintext\""; |
424 |
|
if (($posttype != "source") && ($posttype != "html")) |
425 |
|
echo " selected"; |
426 |
|
echo ">Vanlig text". |
427 |
|
"</select></form><br>\n"; |
428 |
|
|
429 |
include('footer.php'); |
include('footer.php'); |
430 |
} |
} |
437 |
$subject = FixQuotes(filter_text($subject, "nohtml")); |
$subject = FixQuotes(filter_text($subject, "nohtml")); |
438 |
if ($user && $medsig && ($cookie[11]!="")) $usersig="<br>".stripslashes($cookie[11]); |
if ($user && $medsig && ($cookie[11]!="")) $usersig="<br>".stripslashes($cookie[11]); |
439 |
else $usersig=""; |
else $usersig=""; |
440 |
if ($posttype == "exttrans") |
if ($posttype == "source") |
441 |
$comment = FixQuotes(nl2br(htmlspecialchars($comment))).$usersig; |
$comment = FixQuotes('<pre>'.nowordlinksshow($comment).'</pre>').$usersig; |
442 |
elseif ($posttype == "plaintext") |
elseif ($posttype == "plaintext") |
443 |
$comment = FixQuotes(nl2br(filter_text($comment))).$usersig; |
$comment = FixQuotes(nl2br(filter_text($comment))).$usersig; |
444 |
else |
else |