function moderate_1() {
include "config.inc";
global $admin;
echo "
";
}
function displayControlBlock($sid, $title, $thold, $mode, $order) {
global $user, $theme;
dbconnect();
$query = mysql_query("SELECT sid FROM comments WHERE sid = $sid");
if (!$query) $count = 0; else $count = mysql_num_rows($query);
if (!isset($thold)) $thold = 0;
?>
bgcolor2"; ?>">bgcolor1" ?>" SIZE="+1">Comment control
bgcolor1"; ?>">
$result = mysql_query("SELECT COUNT(tid) FROM comments WHERE sid = $sid AND score < $thold");
if ($result && $number = mysql_result($result, 0)) {
?>
bgcolor2"; ?>">fgcolor2"; ?>">There are at least echo $number; ?> comments below your threshold.
}
?>
}
function displayKids ($tid, $mode, $order = 0, $thold = 0, $level = 0, $dummy = 0) {
global $user, $cookie, $theme;
include "config.inc";
$comments = 0;
cookiedecode($user);
$result = mysql_query("SELECT tid, pid, sid, date, name, email, url, host_name, subject, comment, score, reason FROM comments WHERE pid = $tid ORDER BY date, tid");
if ($mode == 'nested') {
while (list($r_tid, $r_pid, $r_sid, $r_date, $r_name, $r_email, $r_url, $r_host_name, $r_subject, $r_comment, $r_score, $r_reason) = mysql_fetch_row($result)) {
if ($r_score >= $thold) {
if ($level && !$comments) {
echo "
";
$tblwidth -= 5;
}
$comments++;
$link = "reply to this comment";
$theme->comment($r_name, $r_subject, $r_tid, $r_date, $r_url, $r_email, $r_score, $r_reason, $r_comment, $link);
displayKids($r_tid, $mode, $order, $thold, $level + 1, $dummy + 1);
}
}
} elseif ($mode == 'flat') {
while (list($r_tid, $r_pid, $r_sid, $r_date, $r_name, $r_email, $r_url, $r_host_name, $r_subject, $r_comment, $r_score, $r_reason) = mysql_fetch_row($result)) {
if ($r_score >= $thold) {
if (!eregi("[a-z0-9]",$r_name)) $r_name = $anonymous;
if (!eregi("[a-z0-9]",$r_subject)) $r_subject = "[no subject]";
$link = "reply to this comment";
$theme->comment($r_name, $r_subject, $r_tid, $r_date, $r_url, $r_email, $r_score, $r_reason, $r_comment, $link);
}
displayKids($r_tid, $mode, $order, $thold);
}
} else {
echo "ERROR: we should not get here!";
}
if ($level && $comments) {
echo "
";
}
}
function displayBabies ($tid, $level = 0, $dummy = 0, $thread) {
global $datetime, $theme, $user, $cookie;
include "config.inc";
$comments = 0;
$result = mysql_query("SELECT tid, pid, sid, date, name, email, url, host_name, subject, comment, score, reason FROM comments WHERE pid = $tid ORDER BY date, tid");
if ($level == 0) $thread = "";
while (list($r_tid, $r_pid, $r_sid, $r_date, $r_name, $r_email, $r_url, $r_host_name, $r_subject, $r_comment, $r_score, $r_reason) = mysql_fetch_row($result)) {
if ($level && !$comments) {
$thread .= "
";
}
$comments++;
if (!eregi("[a-z0-9]",$r_name)) { $r_name = $anonymous; }
if (!eregi("[a-z0-9]",$r_subject)) { $r_subject = "[no subject]"; }
if ($user) {
### Make sure to respect the user preferences:
$thread .= "
$r_subject by $r_name (". formatTimestamp($r_date) .")
";
}
else {
$thread .= "
$r_subject by $r_name (". formatTimestamp($r_date) .")