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";
}
Example #2
0
function singlecomment($tid, $poll_id)
{
    global $bgcolor1, $bgcolor2, $textcolor2, $MAIN_CFG, $prefix, $db, $cpgtpl;
    require_once 'header.php';
    list($date, $name, $email, $subject, $comment, $score, $reason) = $db->sql_ufetchrow("SELECT date, name, email, subject, comment, score, reason FROM " . $prefix . "_pollcomments WHERE tid='{$tid}' AND poll_id='{$poll_id}'", SQL_NUM);
    $comment = decode_bb_all($comment);
    $titlebar = "<b>{$subject}</b>";
    if ($name == '') {
        $name = _ANONYMOUS;
    }
    if ($subject == '') {
        $subject = '[' . _NOSUBJECT . ']';
    }
    if (is_admin() && $MAIN_CFG['global']['moderate'] > 0 || $MAIN_CFG['global']['moderate'] == 2 && is_user()) {
        $cpgtpl->assign_var('U_MODERATE', URL::index());
    }
    OpenTable();
    echo '<table width="99%" border="0"><tr style="background:;' . $bgcolor1 . ';"><td style="width:500px;">';
    $datetime = formatDateTime($date, _DATESTRING);
    if ($email) {
        echo "<b>{$subject}</b> <font class=\"content\" color=\"{$textcolor2}\">(" . _SCORE . " {$score})\n\t<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 ($MAIN_CFG['global']['anonpost'] || is_admin() || is_user()) {
        echo '<font class="content"> [ <a href="' . URL::index("&amp;reply={$tid}&amp;pollid={$poll_id}") . '">' . _REPLY . '</a> | <a href="' . URL::index('&amp;op=results&amp;pollid=' . $poll_id) . '">' . _ROOT . '</a>';
    }
    echo ' | ' . modtwo($tid, $score, $reason);
    echo ' ]';
    modthree($poll_id);
    CloseTable();
}
Example #3
0
function singlecomment($tid, $sid)
{
    global $bgcolor1, $bgcolor2, $textcolor2, $MAIN_CFG, $prefix, $db, $cpgtpl;
    require_once 'header.php';
    list($date, $name, $email, $subject, $comment, $score, $reason) = $db->sql_ufetchrow("SELECT date, name, email, subject, comment, score, reason FROM " . $prefix . "_comments WHERE tid='{$tid}' AND sid='{$sid}'", SQL_NUM);
    $titlebar = '<b>' . $subject . '</b>';
    if (is_admin() && $MAIN_CFG['global']['moderate'] > 0 || $MAIN_CFG['global']['moderate'] == 2 && is_user()) {
        $cpgtpl->assign_var('U_MODERATE', URL::index());
    }
    $cpgtpl->assign_vars('single', array('U_REPLY' => $MAIN_CFG['global']['anonpost'] || is_admin() || is_user() ? '<a href="' . URL::index("&amp;reply={$tid}&amp;sid={$sid}") . '">' . _REPLY . '</a> | <a href="' . URL::index('&amp;file=article&amp;sid=' . $sid) . '">' . _ROOT . '</a>' : '', 'S_TITLEBAR' => '<b>' . $subject . '</b>', 'I_SCORE' => $score, 'S_SCORE' => _SCORE, 'S_ON' => _ON, 'S_BY' => _BY, 'S_BGCOLOR1' => $bgcolor1, 'S_BGCOLOR2' => $bgcolor2, 'S_TEXTCOLOR2' => $textcolor2, 'S_EMAIL' => $email, 'S_DATE' => formatDateTime($date, _DATESTRING), 'S_NAME' => $name == '' ? _ANONYMOUS : $name, 'S_SUBJECT' => $subject == '' ? '[' . _NOSUBJECT . ']' : $subject, 'S_COMMENT' => decode_bb_all($comment), 'S_MODERATE2' => modtwo($tid, $score, $reason), 'S_MODERATE3' => $MAIN_CFG['global']['moderate'] ? modthree($sid) : ''));
    $cpgtpl->assign_var('S_NOCOMMENTS', false);
    $cpgtpl->assign_var('S_ONECOMMENT', true);
    $cpgtpl->set_filenames(array('single' => 'news/comments.html'));
    $cpgtpl->display('single');
}
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";
}