317 |
echo "Tillåten HTML:<br>\n"; |
echo "Tillåten HTML:<br>\n"; |
318 |
while (list($key,)= each($AllowableHTML)) echo " <".$key.">"; |
while (list($key,)= each($AllowableHTML)) echo " <".$key.">"; |
319 |
echo "<br>\n"; |
echo "<br>\n"; |
320 |
if ($user) { echo "<input type=\"checkbox\" name=\"postanon\"> Posta anonymt<br>\n"; } |
if ($user) { |
321 |
|
echo "<input type=\"checkbox\" name=\"postanon\"> Posta anonymt<br>\n"; |
322 |
|
echo "<input type=\"checkbox\" name=\"medsig\" checked> Infoga signatur<br>\n";} |
323 |
echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">\n" |
echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">\n" |
324 |
."<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\"><input class=\"textbox\" type=\"hidden\" name=\"mode\" value=\"$mode\">\n" |
325 |
."<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=\"order\" value=\"$order\"><input class=textbox type=\"hidden\" name=\"thold\" value=\"$thold\">\n" |
326 |
."<input type=\"submit\" name=\"op\" value=\"Preview\" class=\"button\">\n" |
."<input type=\"submit\" name=\"op\" value=\"Preview\" class=\"button\">\n" |
327 |
."<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 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"; |
328 |
|
|
329 |
include('footer.php'); |
include('footer.php'); |
330 |
} |
} |
331 |
|
|
332 |
function replyPreview ($pid, $sid, $subject, $comment, $postanon, $mode, $order, $thold, $posttype) { |
function replyPreview ($medsig, $pid, $sid, $subject, $comment, $postanon, $mode, $order, $thold, $posttype) { |
333 |
global $mainfile,$dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI; |
global $mainfile,$dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI; |
334 |
if(!@$mainfile) |
if(!@$mainfile) |
335 |
include('header.php'); |
include('header.php'); |
338 |
} |
} |
339 |
global $user, $cookie; |
global $user, $cookie; |
340 |
cookiedecode($user); |
cookiedecode($user); |
341 |
|
if ($user && $medsig && ($cookie[11]!="")) $usersig="<br>".stripslashes($cookie[11]); |
342 |
|
else $usersig=""; |
343 |
$subject = stripslashes($subject); |
$subject = stripslashes($subject); |
344 |
$comment = stripslashes($comment); |
$comment = stripslashes($comment); |
345 |
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 "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(); } |
346 |
|
|
347 |
if ($user and !$postanon) |
if ($user and !$postanon) |
348 |
$name = $cookie[1]; |
$name = $cookie[1]; |
349 |
else |
else { |
350 |
$name = $anonymous; |
$name = $anonymous; $usersig=""; } |
351 |
|
|
352 |
if ($posttype == "exttrans") |
if ($posttype == "exttrans") |
353 |
$viewcomment = nl2br(htmlspecialchars($comment)); |
$viewcomment = nl2br(htmlspecialchars($comment)).$usersig; |
354 |
elseif ($posttype == "plaintext") |
elseif ($posttype == "plaintext") |
355 |
$viewcomment = nl2br($comment); |
$viewcomment = nl2br($comment).$usersig; |
356 |
else |
else |
357 |
$viewcomment = $comment; |
$viewcomment = $comment.$usersig; |
358 |
|
|
359 |
echo format_comment_header($name,$subject,$tid,$date,"","",0); |
echo format_comment_header($name,$subject,$tid,$date,"","",0); |
360 |
echo format_comment_body($viewcomment,$sid,$tid,$thold,$order,$cookie[10]); |
echo format_comment_body($viewcomment,$sid,$tid,$thold,$order,$cookie[10]); |
370 |
."<textarea class=\"textbox\" wrap=\"virtual\" cols=\"50\" rows=\"10\" name=\"comment\">$comment</textarea><br>\n"; |
."<textarea class=\"textbox\" wrap=\"virtual\" cols=\"50\" rows=\"10\" name=\"comment\">$comment</textarea><br>\n"; |
371 |
echo "Tillåten HTML:<br>\n"; |
echo "Tillåten HTML:<br>\n"; |
372 |
while (list($key,)= each($AllowableHTML)) echo " <".$key.">"; |
while (list($key,)= each($AllowableHTML)) echo " <".$key.">"; |
373 |
echo "<br>\n"; |
echo "<br>\n"; |
374 |
if ($postanon) $postanon_check = " checked"; else $postanon_check = ""; |
if ($postanon) $postanon_check = " checked"; else $postanon_check = ""; |
375 |
if ($user) |
if ($medsig) $medsig_check = " checked"; else $medsig_check = ""; |
376 |
|
if ($user) { |
377 |
echo "<input type=\"checkbox\" name=\"postanon\" $postanon_check> Posta anonymt<br>\n"; |
echo "<input type=\"checkbox\" name=\"postanon\" $postanon_check> Posta anonymt<br>\n"; |
378 |
|
echo "<input type=\"checkbox\" name=\"medsig\" $medsig_check> Infoga signatur<br>\n";} |
379 |
echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">" |
echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">" |
380 |
."<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\"><input class=\"textbox\" type=\"hidden\" name=\"mode\" value=\"$mode\">\n" |
381 |
."<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=\"order\" value=\"$order\"><input class=\"textbox\" type=\"hidden\" name=\"thold\" value=\"$thold\">\n" |
391 |
include('footer.php'); |
include('footer.php'); |
392 |
} |
} |
393 |
|
|
394 |
function CreateTopic ($postanon, $subject, $comment, $pid, $sid, $host_name, $mode, $order, $thold, $posttype) { |
function CreateTopic ($medsig, $postanon, $subject, $comment, $pid, $sid, $host_name, $mode, $order, $thold, $posttype) { |
395 |
global $dbhost,$dbuname,$dbpass,$dbname,$mainfile; |
global $dbhost,$dbuname,$dbpass,$dbname,$mainfile; |
396 |
global $user, $userinfo, $EditedMessage, $cookie; |
global $user, $userinfo, $EditedMessage, $cookie; |
397 |
dbconnect(); |
dbconnect(); |
398 |
$author = FixQuotes($author); |
$author = FixQuotes($author); |
399 |
$subject = FixQuotes(filter_text($subject, "nohtml")); |
$subject = FixQuotes(filter_text($subject, "nohtml")); |
400 |
|
if ($user && $medsig && ($cookie[11]!="")) $usersig="<br>".stripslashes($cookie[11]); |
401 |
|
else $usersig=""; |
402 |
if ($posttype == "exttrans") |
if ($posttype == "exttrans") |
403 |
$comment = FixQuotes(nl2br(htmlspecialchars($comment))); |
$comment = FixQuotes(nl2br(htmlspecialchars($comment))).$usersig; |
404 |
elseif ($posttype == "plaintext") |
elseif ($posttype == "plaintext") |
405 |
$comment = FixQuotes(nl2br(filter_text($comment))); |
$comment = FixQuotes(nl2br(filter_text($comment))).$usersig; |
406 |
else |
else |
407 |
$comment = FixQuotes(filter_text($comment)); |
$comment = FixQuotes(filter_text($comment)).$usersig; |
408 |
if ($user) getusrinfo($user); |
if ($user) getusrinfo($user); |
409 |
if (($user) && (!$postanon)) { |
if (($user) && (!$postanon)) { |
410 |
getusrinfo($user); |
getusrinfo($user); |
459 |
reply($pid, $sid, $mode, $order, $thold); |
reply($pid, $sid, $mode, $order, $thold); |
460 |
break; |
break; |
461 |
case "Preview": |
case "Preview": |
462 |
replyPreview($pid, $sid, $subject, $comment, $postanon, $mode, $order, $thold, $posttype); |
replyPreview($medsig, $pid, $sid, $subject, $comment, $postanon, $mode, $order, $thold, $posttype); |
463 |
break; |
break; |
464 |
case "Ok!": |
case "Ok!": |
465 |
CreateTopic($postanon, $subject, $comment, $pid, $sid, $host_name, $mode, $order, $thold, $posttype); |
CreateTopic($medsig, $postanon, $subject, $comment, $pid, $sid, $host_name, $mode, $order, $thold, $posttype); |
466 |
break; |
break; |
467 |
case "moderate": |
case "moderate": |
468 |
if (isset($admin)) { |
if (isset($admin)) { |