Example #1
0
function singlecomment($tid, $pollID, $mode, $order, $thold)
{
    include_once "header.php";
    global $userinfo, $user, $cookie, $datetime, $bgcolor1, $bgcolor2, $bgcolor3, $anonpost, $admin, $anonymous, $prefix, $db, $module_name;
    cookiedecode($user);
    getusrinfo($user);
    if (!isset($mode) or empty($mode)) {
        if (isset($userinfo['umode'])) {
            $mode = $userinfo['umode'];
        } else {
            $mode = "thread";
        }
    }
    if (!isset($order) or empty($order)) {
        if (isset($userinfo['uorder'])) {
            $order = $userinfo['uorder'];
        } else {
            $order = 0;
        }
    }
    if (!isset($thold) or empty($thold)) {
        if (isset($userinfo['thold'])) {
            $thold = $userinfo['thold'];
        } else {
            $thold = 0;
        }
    }
    $tid = intval($tid);
    $pollID = intval($pollID);
    $row = $db->sql_fetchrow($db->sql_query("SELECT date, name, email, subject, comment, score, reason from " . $prefix . "_pollcomments where tid='{$tid}' and pollID='{$pollID}'"));
    $date = $row['date'];
    $name = filter($row['name'], "nohtml");
    $email = filter($row['email'], "nohtml");
    $subject = filter($row['subject'], "nohtml");
    $comment = filter($row['comment']);
    $score = intval($row['score']);
    $reason = intval($row['reason']);
    $titlebar = "<b>{$subject}</b>";
    if (empty($name)) {
        $name = $anonymous;
    }
    if (empty($subject)) {
        $subject = "[" . _NOSUBJECT . "]";
    }
    modone();
    echo "<table width=99% border=0><tr bgcolor=\"{$bgcolor1}\"><td width=500>";
    formatTimestamp($date);
    if ($email) {
        echo "<p><b>{$subject}</b> <font class=content>(" . _SCORE . " {$score})<br>" . _BY . " <a href=\"mailto:{$email}\"><font color=\"{$bgcolor2}\">{$name}</font></a> <font class=content><b>({$email})</b></font> " . _ON . " {$datetime}";
    } else {
        echo "<p><b>{$subject}</b> <font class=content>(" . _SCORE . " {$score})<br>" . _BY . " {$name} " . _ON . " {$datetime}";
    }
    echo "</td></tr><tr><td>{$comment}</td></tr></table><br><p><font class=content color=\"{$bgcolor2}\"> [ <a href=\"modules.php?name={$module_name}&amp;file=comments&amp;op=Reply&pid={$tid}&pollID={$pollID}&mode={$mode}&order={$order}&thold={$thold}\">" . _REPLY . "</a> | <a href=\"modules.php?name={$module_name}&amp;pollID={$pollID}\">" . _ROOT . "</a>";
    modtwo($tid, $score, $reason);
    echo " ]";
    modthree($pollID, $mode, $order, $thold);
    include_once "footer.php";
}
function singlecomment($tid, $sid, $mode, $order, $thold)
{
    global $module_name, $user, $cookie, $datetime, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $admin, $anonpost, $prefix, $textcolor2, $db;
    include "header.php";
    $row = $db->sql_fetchrow($db->sql_query("SELECT date, name, email, subject, comment, score, reason FROM " . $prefix . "_comments WHERE tid='{$tid}' AND sid='{$sid}'"));
    $date = $row['date'];
    $name = stripslashes($row['name']);
    $email = stripslashes($row['email']);
    $subject = stripslashes(check_html($row['subject'], "nohtml"));
    $comment = stripslashes($row['comment']);
    $score = intval($row['score']);
    $reason = intval($row['reason']);
    $titlebar = "<b>{$subject}</b>";
    if ($name == "") {
        $name = $anonymous;
    }
    if ($subject == "") {
        $subject = "[" . _NOSUBJECT . "]";
    }
    modone();
    OpenTable();
    echo "<table width=\"99%\" border=\"0\"><tr bgcolor=\"{$bgcolor1}\"><td width=\"500\">";
    formatTimestamp($date);
    if ($email) {
        echo "<b>{$subject}</b> <font class=\"content\" color=\"{$textcolor2}\">(" . _SCORE . " {$score})<br>" . _BY . " <a href=\"mailto:{$email}\"><font color=\"{$bgcolor2}\">{$name}</font></a> <font class=content><b>({$email})</b></font> " . _ON . " {$datetime}";
    } else {
        echo "<b>{$subject}</b> <font class=content>(" . _SCORE . " {$score})<br>" . _BY . " {$name} " . _ON . " {$datetime}";
    }
    echo "</td></tr><tr><td>{$comment}</td></tr></table><br><br>";
    if ($anonpost == 1 or is_admin($admin) or is_user($user)) {
        echo "<font class=content> [ <a href=\"modules.php?name={$module_name}&amp;file=comments&amp;op=Reply&amp;pid={$tid}&amp;sid={$sid}&amp;mode={$mode}&amp;order={$order}&amp;thold={$thold}\">" . _REPLY . "</a> | <a href=\"modules.php?name={$module_name}&amp;file=article&amp;sid={$sid}&mode={$mode}&order={$order}&thold={$thold}\">" . _ROOT . "</a>";
    }
    modtwo($tid, $score, $reason);
    echo " ]";
    modthree($sid, $mode, $order, $thold);
    CloseTable();
    include "footer.php";
}