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