26 |
# |
# |
27 |
# $Id$ |
# $Id$ |
28 |
|
|
29 |
if (!isset($config)) include('config.php'); |
if (!isset($config)) include_once('config.php'); |
30 |
|
|
31 |
$savemainfile = $mainfile; |
$savemainfile = $mainfile; |
32 |
include('auth.inc.php'); |
include_once('auth.inc.php'); |
33 |
#if (ereg('/comments\.php$', $SCRIPT_NAME)) |
#if (ereg('/comments\.php$', $SCRIPT_NAME)) |
34 |
# include('mainfile.php'); |
# include_once('mainfile.php'); |
35 |
$mainfile = $savemainfile; |
$mainfile = $savemainfile; |
36 |
|
|
37 |
isRealUser($HTTP_COOKIE_VARS['user']); |
isRealUser($HTTP_COOKIE_VARS['user']); |
51 |
function modtwo($tid, $score, $reason) { |
function modtwo($tid, $score, $reason) { |
52 |
global $admintest, $user, $moderate, $reasons; |
global $admintest, $user, $moderate, $reasons; |
53 |
$modder = ""; |
$modder = ""; |
54 |
if (((($admintest == 1) && ($moderate == 1)) || ($moderate == 2)) && ($user)) { |
if ((($admintest == 1) && ($moderate == 1)) || ($moderate == 2)) { |
55 |
$modder.= " | <select name=\"dkn$tid\">"; |
$modder.= " | <select name=\"dkn$tid\">"; |
56 |
for ($i=0; $i<sizeof($reasons); $i++) { |
for ($i=0; $i<sizeof($reasons); $i++) { |
57 |
$modder.= "<option value=\"$score:$i\">$reasons[$i]</option>\n"; |
$modder.= "<option value=\"$score:$i\">$reasons[$i]</option>\n"; |
63 |
|
|
64 |
function modthree($sid, $mode, $order, $thold=0) { |
function modthree($sid, $mode, $order, $thold=0) { |
65 |
global $admintest, $user, $moderate, $uimages; |
global $admintest, $user, $moderate, $uimages; |
66 |
if (((($admintest == 1) && ($moderate == 1)) || ($moderate==2)) && ($user)) { |
if ((($admintest == 1) && ($moderate == 1)) || ($moderate==2)) { |
67 |
echo "<div align=\"center\">"; |
echo "<div align=\"center\">"; |
68 |
echo "<input class=\"textbox\" type=\"hidden\" name=\"sid\" value=\"$sid\">"; |
echo "<input class=\"textbox\" type=\"hidden\" name=\"sid\" value=\"$sid\">"; |
69 |
echo "<input class=\"textbox\" type=\"hidden\" name=\"mode\" value=\"$mode\">"; |
echo "<input class=\"textbox\" type=\"hidden\" name=\"mode\" value=\"$mode\">"; |
201 |
|
|
202 |
function DisplayKids ($tid, $mode, $order=0, $thold=0, $level=0) { |
function DisplayKids ($tid, $mode, $order=0, $thold=0, $level=0) { |
203 |
global $datetime, $user, $cookie, $typ; |
global $datetime, $user, $cookie, $typ; |
204 |
if (!isset($config)) include('config.php'); |
if (!isset($config)) include_once('config.php'); |
205 |
$comments = 0; |
$comments = 0; |
206 |
cookiedecode($user); |
cookiedecode($user); |
207 |
$result = mysql_query("SELECT tid, pid, sid, date, name, email, url, " |
$result = mysql_query("SELECT tid, pid, sid, date, name, email, url, " |
267 |
global $bgcolor1, $bgcolor2, $bgcolor3; |
global $bgcolor1, $bgcolor2, $bgcolor3; |
268 |
global $dbhost,$dbuname,$dbpass,$dbname; |
global $dbhost,$dbuname,$dbpass,$dbname; |
269 |
if (!@$mainfile) |
if (!@$mainfile) |
270 |
include('header.php'); |
include_once('header.php'); |
271 |
else { |
else { |
272 |
if (!isset($config)) include('config.php'); |
if (!isset($config)) include_once('config.php'); |
273 |
} |
} |
274 |
dbconnect(); |
dbconnect(); |
275 |
$count_times = 0; |
$count_times = 0; |
302 |
} |
} |
303 |
modthree($sid, $mode, $order, $thold); |
modthree($sid, $mode, $order, $thold); |
304 |
if ($pid == 0) return array($sid, $pid, $subject); |
if ($pid == 0) return array($sid, $pid, $subject); |
305 |
else include('footer.php'); |
else include_once('footer.php'); |
306 |
} |
} |
307 |
|
|
308 |
function singlecomment($tid, $sid, $mode, $order, $thold) { |
function singlecomment($tid, $sid, $mode, $order, $thold) { |
309 |
include('header.php'); |
include_once('header.php'); |
310 |
global $user, $cookie, $typ; |
global $user, $cookie, $typ; |
311 |
dbconnect(); |
dbconnect(); |
312 |
$result = mysql_query("SELECT date, name, email, url, subject, comment, " |
$result = mysql_query("SELECT date, name, email, url, subject, comment, " |
322 |
elseif ($typ==1) |
elseif ($typ==1) |
323 |
echo "<a href=\"pollBooth.php?op=results&typ=1&sid=$sid".rmflags()."\">Tillbaks till undersökningen</a>\n"; |
echo "<a href=\"pollBooth.php?op=results&typ=1&sid=$sid".rmflags()."\">Tillbaks till undersökningen</a>\n"; |
324 |
modthree($sid, $mode, $order, $thold); |
modthree($sid, $mode, $order, $thold); |
325 |
include('footer.php'); |
include_once('footer.php'); |
326 |
} |
} |
327 |
|
|
328 |
function reply($pid, $sid, $mode, $order, $thold) { |
function reply($pid, $sid, $mode, $order, $thold) { |
329 |
global $mainfile,$dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI, $typ; |
global $mainfile,$dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI, $typ; |
330 |
if (!@$mainfile) |
if (!@$mainfile) |
331 |
include('header.php'); |
include_once('header.php'); |
332 |
else { |
else { |
333 |
if (!isset($config)) include('config.php'); |
if (!isset($config)) include_once('config.php'); |
334 |
} |
} |
335 |
global $user, $cookie, $bgcolor1, $bgcolor2, $bgcolor3; |
global $user, $cookie, $bgcolor1, $bgcolor2, $bgcolor3; |
336 |
$reason = ""; $score = 0; |
$reason = ""; $score = 0; |
392 |
."<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" |
393 |
."<input type=\"submit\" name=\"op\" value=\"Förhandsgranska\" class=\"button\">\n" |
."<input type=\"submit\" name=\"op\" value=\"Förhandsgranska\" class=\"button\">\n" |
394 |
."<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"; |
."<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"; |
395 |
include('footer.php'); |
include_once('footer.php'); |
396 |
} |
} |
397 |
|
|
398 |
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) { |
399 |
global $mainfile,$dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI, $typ; |
global $mainfile,$dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI, $typ; |
400 |
if(!@$mainfile) |
if(!@$mainfile) |
401 |
include('header.php'); |
include_once('header.php'); |
402 |
else { |
else { |
403 |
if (!isset($config)) include('config.php'); |
if (!isset($config)) include_once('config.php'); |
404 |
} |
} |
405 |
global $user, $cookie; |
global $user, $cookie; |
406 |
cookiedecode($user); |
cookiedecode($user); |
460 |
echo ">HTML-formatterad<option value=\"plaintext\""; |
echo ">HTML-formatterad<option value=\"plaintext\""; |
461 |
if (($posttype!="source") && ($posttype!="html")) echo " selected"; |
if (($posttype!="source") && ($posttype!="html")) echo " selected"; |
462 |
echo ">Vanlig text</select></form><br>\n"; |
echo ">Vanlig text</select></form><br>\n"; |
463 |
include('footer.php'); |
include_once('footer.php'); |
464 |
} |
} |
465 |
|
|
466 |
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) { |
512 |
mysql_query("INSERT INTO comments (pid, sid, typ, date, name, email, url, host_name, subject, comment, score, reason) VALUES ('$pid', '$sid', '$typ', now(), '$name', '$email', '$url', '$ip', '$subject', '$comment', '$score', '0')"); |
mysql_query("INSERT INTO comments (pid, sid, typ, date, name, email, url, host_name, subject, comment, score, reason) VALUES ('$pid', '$sid', '$typ', now(), '$name', '$email', '$url', '$ip', '$subject', '$comment', '$score', '0')"); |
513 |
} else { |
} else { |
514 |
mysql_query("UNLOCK TABLES"); |
mysql_query("UNLOCK TABLES"); |
515 |
include('header.php'); |
include_once('header.php'); |
516 |
if ($tia) echo "<img src=\"images/warning.png\"><br><br>Det verkar som om du redan postat den här kommentaren...<br><br><a href=\"article.php?sid=$sid&mode=$mode&order=$order&thold=$thold\">Tillbaks till artikeln</a>"; |
if ($tia) echo "<img src=\"images/warning.png\"><br><br>Det verkar som om du redan postat den här kommentaren...<br><br><a href=\"article.php?sid=$sid&mode=$mode&order=$order&thold=$thold\">Tillbaks till artikeln</a>"; |
517 |
elseif ($troll > 5) { |
elseif ($troll > 5) { |
518 |
echo "<img src=\"images/warning.png\"><br><br> |
echo "<img src=\"images/warning.png\"><br><br> |
530 |
} elseif (!@$fake) echo "<img src=\"images/warning.png\"><br><br> |
} elseif (!@$fake) echo "<img src=\"images/warning.png\"><br><br> |
531 |
Enligt protokollet så finns inte det du försöker svara |
Enligt protokollet så finns inte det du försöker svara |
532 |
på. Du är nog på villovägar."; |
på. Du är nog på villovägar."; |
533 |
include('footer.php'); |
include_once('footer.php'); |
534 |
exit; |
exit; |
535 |
} |
} |
536 |
mysql_query('UNLOCK TABLES'); |
mysql_query('UNLOCK TABLES'); |
554 |
break; |
break; |
555 |
case "moderate": |
case "moderate": |
556 |
if (isset($admin)) { |
if (isset($admin)) { |
557 |
include('auth.inc.php'); |
include_once('auth.inc.php'); |
558 |
} else { |
} else { |
559 |
dbconnect(); |
dbconnect(); |
560 |
} |
} |