140 |
} |
} |
141 |
|
|
142 |
function format_comment_footer($tid,$sid,$pid,$mode,$order,$thold,$score,$reason) { |
function format_comment_footer($tid,$sid,$pid,$mode,$order,$thold,$score,$reason) { |
143 |
global $admintest, $user, $anompost, $typ; |
global $admintest, $user, $gconf, $typ, $REQUEST_URI; |
144 |
if ($anompost or $admintest or $user) |
if ($gconf['anompost'] or $admintest or $user) |
145 |
$footer = "[ <a href=\"comments.php?op=Reply&typ=$typ&" |
$footer = "[ <a href=\"comments.php?op=Reply&typ=$typ&" |
146 |
. "pid=$tid&sid=$sid&mode=$mode&order=$order&" |
. "pid=$tid&sid=$sid&mode=$mode&order=$order&" |
147 |
. "thold=$thold\">Svara</a>\n"; |
. "thold=$thold\">Svara</a>\n"; |
148 |
else |
else |
149 |
$footer = "[ <i>Du får inte kommentera anonymt, var vänlig " |
$footer = "[ <i><span class=\"commentanon\">Du får inte kommentera anonymt, vänligen " |
150 |
. "<a href=\"user.php\">registera dig</a></i>"; |
. "<a href=\"user.php?op=commentsLogin&passOn=".urlencode($REQUEST_URI)."\">" |
151 |
if ($pid != 0) { |
. "logga in</a></i></span>\n"; |
152 |
list($erin) = mysql_fetch_row(mysql_query("SELECT pid FROM comments " |
|
153 |
. "WHERE tid='$pid' " |
# $footer = "[ <i>Du får inte kommentera anonymt, var vänlig " |
154 |
. "AND typ='$typ'")); |
# . "<a href=\"user.php\">registera dig</a></i>"; |
155 |
$footer.= " | <a href=\"comments.php?sid=$sid&typ=$typ&" |
if ($pid != 0) { |
156 |
. "pid=$erin&mode=$mode&order=$order&" |
list($erin) = mysql_fetch_row(mysql_query("SELECT pid FROM comments " |
157 |
. "thold=$thold\">Uppåt</a>\n"; |
. "WHERE tid='$pid' " |
158 |
} |
. "AND typ='$typ'")); |
159 |
$footer.= modtwo($tid, $score, $reason); |
$footer.= " | <a href=\"comments.php?sid=$sid&typ=$typ&" |
160 |
if ($admintest) |
. "pid=$erin&mode=$mode&order=$order&" |
161 |
$footer.= " | <a href=\"admin.php?op=RemoveComment&typ=$typ&" |
. "thold=$thold\">Uppåt</a>\n"; |
162 |
. "tid=$tid&sid=$sid\">Radera</a> ]<br><br>\n"; |
} |
163 |
else |
$footer.= modtwo($tid, $score, $reason); |
164 |
$footer.= " ]<br><br>\n"; |
if ($admintest) |
165 |
return $footer; |
$footer.= " | <a href=\"admin.php?op=RemoveComment&typ=$typ&" |
166 |
|
. "tid=$tid&sid=$sid\">Radera</a> ]<br><br>\n"; |
167 |
|
else |
168 |
|
$footer.= " ]<br><br>\n"; |
169 |
|
return $footer; |
170 |
} |
} |
171 |
|
|
172 |
function navbar($sid, $thold, $mode, $order) { |
function navbar($sid, $thold, $mode, $order) { |
336 |
else { |
else { |
337 |
if (!isset($config)) include_once('config.php'); |
if (!isset($config)) include_once('config.php'); |
338 |
} |
} |
339 |
global $user, $cookie, $bgcolor1, $bgcolor2, $bgcolor3; |
global $user, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $gconf; |
340 |
$reason = ""; $score = 0; |
$reason = ""; $score = 0; |
341 |
dbconnect(); |
dbconnect(); |
342 |
if ($pid!=0) { |
if ($pid!=0) { |
368 |
} |
} |
369 |
|
|
370 |
|
|
371 |
echo "<form method=\"POST\" action=\"$REQUEST_URI\"><input type=\"hidden\" name=\"typ\" value=\"$typ\">\n"; |
if ($gconf['anompost'] or $admintest or $user) { |
372 |
echo "<p><font color=\"$bgcolor2\"><b>Ditt namn:</b></font>\n"; |
# Svarsformuläret |
373 |
if ($user) { |
echo "<form method=\"POST\" action=\"$REQUEST_URI\">"; |
374 |
cookiedecode($user); |
echo "<input type=\"hidden\" name=\"typ\" value=\"$typ\">\n"; |
375 |
echo "<a href=\"user.php\">$cookie[1]</a> <font size=2>[ <a href=\"user.php?op=logout\">Logga ut</a> ]</font>"; |
echo "<p><font color=\"$bgcolor2\"><b>Ditt namn:</b></font>\n"; |
376 |
|
if ($user) { |
377 |
|
cookiedecode($user); |
378 |
|
echo "<a href=\"user.php\">$cookie[1]</a> <font size=2>[ <a href=\"user.php?op=logout\">Logga ut</a> ]</font>"; |
379 |
|
} else { |
380 |
|
echo "<font color=\"Red\">$anonymous</font><font color=\"Black\">\n"; |
381 |
|
echo "[ <a href=\"user.php\">Ny användare</a> | "; |
382 |
|
echo "<a href=\"user.php?op=commentsLogin&passOn=".urlencode($REQUEST_URI)."\">Logga in</a> ]</font>\n"; |
383 |
|
} |
384 |
|
echo "<p><font color=\"$bgcolor2\"><b>Ärende</b></font><br>\n"; |
385 |
|
if (!eregi("Re:",$subject)) $subject = "Re: $subject"; |
386 |
|
echo "<input class=\"textbox\" type=\"text\" name=\"subject\" size=\"50\" maxlength=\"60\" value=\"".htmlspecialchars($subject)."\"><br>"; |
387 |
|
echo "<p><font color=\"$bgcolor2\"><b>Kommentar</b></font><br>\n"; |
388 |
|
echo "<textarea class=\"textbox\" wrap=\"virtual\" cols=\"50\" rows=\"10\" name=\"comment\"></textarea><br>\n"; |
389 |
|
printAllowedHTML(); |
390 |
|
if ($user) { |
391 |
|
if ($gconf['anompost']) |
392 |
|
echo "<input type=\"checkbox\" name=\"postanon\"> Posta anonymt<br>\n"; |
393 |
|
echo "<input type=\"checkbox\" name=\"medsig\" checked> Infoga signatur<br>\n"; |
394 |
|
} |
395 |
|
if($speling) { |
396 |
|
echo "<input type=\"checkbox\" id=\"spell\" name=\"spell\"" . (($spell) ? " checked" : "") . "> <label for=\"spell\">Kontrollera stavning</label><br>\n"; |
397 |
|
} |
398 |
|
documentation("write_comments"); |
399 |
|
echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">\n" |
400 |
|
."<input class=\"textbox\" type=\"hidden\" name=\"sid\" value=\"$sid\"><input class=\"textbox\" type=\"hidden\" name=\"mode\" value=\"$mode\">\n" |
401 |
|
."<input class=\"textbox\" type=\"hidden\" name=\"order\" value=\"$order\"><input class=textbox type=\"hidden\" name=\"thold\" value=\"$thold\">\n" |
402 |
|
."<input type=\"submit\" name=\"op\" value=\"Förhandsgranska\" class=\"button\">\n" |
403 |
|
."<input type=\"submit\" name=\"op\" value=\"Ok!\" class=\"button\"> <select name=\"posttype\"><option value=\"source\">Källkod<option value=\"html\" >HTML-formatterad<option value=\"plaintext\" selected>Vanlig text</select></form><br>\n"; |
404 |
|
|
405 |
} else { |
} else { |
406 |
echo "<font color=\"Red\">$anonymous</font><font color=\"Black\">\n"; |
echo "[ <i><span class=\"commentanon\">Du får inte kommentera anonymt, vänligen " |
407 |
echo "[ <a href=\"user.php\">Ny användare</a> | <a href=\"user.php?op=commentsLogin&passOn=".urlencode($REQUEST_URI)."\">Logga in</a> ]</font>\n"; |
. "<a href=\"user.php?op=commentsLogin&passOn=".urlencode($REQUEST_URI)."\">" |
408 |
|
. "logga in</a></i></span> ]\n"; |
409 |
} |
} |
410 |
echo "<p><font color=\"$bgcolor2\"><b>Ärende</b></font><br>\n"; |
|
|
if (!eregi("Re:",$subject)) $subject = "Re: $subject"; |
|
|
echo "<input class=\"textbox\" type=\"text\" name=\"subject\" size=\"50\" maxlength=\"60\" value=\"".htmlspecialchars($subject)."\"><br>"; |
|
|
echo "<p><font color=\"$bgcolor2\"><b>Kommentar</b></font><br>\n"; |
|
|
echo "<textarea class=\"textbox\" wrap=\"virtual\" cols=\"50\" rows=\"10\" name=\"comment\"></textarea><br>\n"; |
|
|
printAllowedHTML(); |
|
|
if ($user) { |
|
|
echo "<input type=\"checkbox\" name=\"postanon\"> Posta anonymt<br>\n"; |
|
|
echo "<input type=\"checkbox\" name=\"medsig\" checked> Infoga signatur<br>\n"; |
|
|
} |
|
|
if($speling) { |
|
|
echo "<input type=\"checkbox\" id=\"spell\" name=\"spell\"" . (($spell) ? " checked" : "") . "> <label for=\"spell\">Kontrollera stavning</label><br>\n"; |
|
|
} |
|
|
documentation("write_comments"); |
|
|
echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">\n" |
|
|
."<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=\"order\" value=\"$order\"><input class=textbox type=\"hidden\" name=\"thold\" value=\"$thold\">\n" |
|
|
."<input type=\"submit\" name=\"op\" value=\"Förhandsgranska\" class=\"button\">\n" |
|
|
."<input type=\"submit\" name=\"op\" value=\"Ok!\" class=\"button\"> <select name=\"posttype\"><option value=\"source\">Källkod<option value=\"html\" >HTML-formatterad<option value=\"plaintext\" selected>Vanlig text</select></form><br>\n"; |
|
411 |
include_once('footer.php'); |
include_once('footer.php'); |
412 |
} |
} |
413 |
|
|
414 |
function replyPreview ($medsig, $pid, $sid, $subject, $comment, $postanon, $mode, $order, $thold, $posttype, $spell) { |
function replyPreview ($medsig, $pid, $sid, $subject, $comment, $postanon, $mode, $order, $thold, $posttype, $spell) { |
415 |
global $mainfile,$dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI, $typ; |
global $mainfile,$dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI, $typ, $gconf; |
416 |
if(!@$mainfile) |
if(!@$mainfile) |
417 |
include_once('header.php'); |
include_once('header.php'); |
418 |
else { |
else { |
425 |
$subject = stripslashes($subject); |
$subject = stripslashes($subject); |
426 |
$subject = new_check_html($subject, 'nohtml'); |
$subject = new_check_html($subject, 'nohtml'); |
427 |
$comment = stripslashes($comment); |
$comment = stripslashes($comment); |
428 |
if (!isset($pid) || !isset($sid)) { echo "<img src=\"images/warning.png\">Någonting är väldigt fel."; exit(); } |
|
429 |
|
# catch odd errors |
430 |
|
if (!isset($pid) || !isset($sid)) { |
431 |
|
echo "<img src=\"images/warning.png\">Någonting är väldigt fel."; exit(); |
432 |
|
} |
433 |
|
if ($postanon and !$gconf['anompost']) { |
434 |
|
echo "<img src=\"images/warning.png\">Någonting är väldigt fel."; exit(); |
435 |
|
} |
436 |
|
|
437 |
if ($user and !$postanon) |
if ($user and !$postanon) |
438 |
$name = $cookie[1]; |
$name = $cookie[1]; |
465 |
if ($postanon) $postanon_check = " checked"; else $postanon_check = ""; |
if ($postanon) $postanon_check = " checked"; else $postanon_check = ""; |
466 |
if ($medsig) $medsig_check = " checked"; else $medsig_check = ""; |
if ($medsig) $medsig_check = " checked"; else $medsig_check = ""; |
467 |
if ($user) { |
if ($user) { |
468 |
echo "<input type=\"checkbox\" name=\"postanon\" $postanon_check> Posta anonymt<br>\n"; |
if ($gconf['anompost']) |
469 |
echo "<input type=\"checkbox\" name=\"medsig\" $medsig_check> Infoga signatur<br>\n"; |
echo "<input type=\"checkbox\" name=\"postanon\" $postanon_check> Posta anonymt<br>\n"; |
470 |
|
echo "<input type=\"checkbox\" name=\"medsig\" $medsig_check> Infoga signatur<br>\n"; |
471 |
} |
} |
472 |
if ($speling) { |
if ($speling) { |
473 |
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\"" . |
474 |
|
(($spell) ? " checked" : "") . |
475 |
|
"> <label for=\"spell\">Kontrollera stavning</label><br>\n"; |
476 |
} |
} |
477 |
documentation("write_comments"); |
documentation("write_comments"); |
478 |
echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">" |
echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">" |
479 |
."<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\">" |
480 |
."<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" |
481 |
|
."<input class=\"textbox\" type=\"hidden\" name=\"order\" value=\"$order\">" |
482 |
|
."<input class=\"textbox\" type=\"hidden\" name=\"thold\" value=\"$thold\">\n" |
483 |
."<input type=\"submit\" name=\"op\" value=\"Förhandsgranska\" class=\"button\">\n" |
."<input type=\"submit\" name=\"op\" value=\"Förhandsgranska\" class=\"button\">\n" |
484 |
."<input type=\"submit\" name=\"op\" value=\"Ok!\" class=\"button\"> <select name=\"posttype\"><option value=\"source\""; |
."<input type=\"submit\" name=\"op\" value=\"Ok!\" class=\"button\"> " |
485 |
|
."<select name=\"posttype\"><option value=\"source\""; |
486 |
if ($posttype == "source") echo " selected"; |
if ($posttype == "source") echo " selected"; |
487 |
echo ">Källkod<option value=\"html\"";; |
echo ">Källkod<option value=\"html\"";; |
488 |
if ($posttype=="html") echo " selected"; |
if ($posttype=="html") echo " selected"; |
494 |
|
|
495 |
function CreateTopic ($medsig, $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) { |
496 |
global $dbhost,$dbuname,$dbpass,$dbname,$mainfile, $typ; |
global $dbhost,$dbuname,$dbpass,$dbname,$mainfile, $typ; |
497 |
global $user, $userinfo, $EditedMessage, $cookie; |
global $user, $userinfo, $EditedMessage, $cookie, $gconf; |
498 |
dbconnect(); |
dbconnect(); |
499 |
$author = FixQuotes($author); |
$author = FixQuotes($author); |
500 |
$subject = stripslashes($subject); |
$subject = stripslashes($subject); |
501 |
$subject = new_check_html($subject, 'nohtml'); |
$subject = new_check_html($subject, 'nohtml'); |
502 |
$subject = addslashes($subject); |
$subject = addslashes($subject); |
503 |
if ($user && $medsig && ($cookie[11]!="") && !$postanon) $usersig="<br>".nl2br(new_check_html(stripslashes($cookie[11]))); |
if ($user && $medsig && ($cookie[11]!="") && !$postanon) { |
504 |
else $usersig=""; |
$usersig="<br>".nl2br(new_check_html(stripslashes($cookie[11]))); |
505 |
|
} else { |
506 |
|
$usersig=""; |
507 |
|
} |
508 |
$comment = stripslashes($comment); |
$comment = stripslashes($comment); |
509 |
if ($posttype == "source") |
if ($posttype == "source") |
510 |
$comment = '<pre>'.nowordlinksshow($comment).'</pre>'.$usersig; |
$comment = '<pre>'.nowordlinksshow($comment).'</pre>'.$usersig; |
525 |
$score = 0; |
$score = 0; |
526 |
} |
} |
527 |
$ip = getenv("REMOTE_ADDR"); |
$ip = getenv("REMOTE_ADDR"); |
528 |
|
//strange anonpost |
529 |
|
if ($postanon and !$gconf['anompost']) { |
530 |
|
echo "<img src=\"images/warning.png\">Någonting är väldigt fel."; exit(); |
531 |
|
} |
532 |
//begin fake thread control |
//begin fake thread control |
533 |
if ($typ==0) |
if ($typ==0) |
534 |
$sql="SELECT COUNT(*) FROM stories WHERE sid='$sid'"; |
$sql="SELECT COUNT(*) FROM stories WHERE sid='$sid'"; |