Esempio n. 1
0
function DisplayBabies($tid, $level = 0, $dummy = 0)
{
    global $userinfo, $datetime, $anonymous, $prefix, $db, $module_name;
    $comments = 0;
    $tid = intval($tid);
    $result = $db->sql_query("SELECT tid, pid, pollID, date, name, email, host_name, subject, comment, score, reason from " . $prefix . "_pollcomments where pid = '{$tid}' order by date, tid");
    while ($row = $db->sql_fetchrow($result)) {
        $r_tid = intval($row['tid']);
        $r_pid = intval($row['pid']);
        $r_pollID = intval($row['pollID']);
        $r_date = $row['date'];
        $r_name = filter($row['name'], "nohtml");
        $r_email = filter($row['email'], "nohtml");
        $r_host_name = filter($row['host_name'], "nohtml");
        $r_subject = filter($row['subject'], "nohtml");
        $r_comment = filter($row['comment']);
        $r_score = intval($row['score']);
        $r_reason = intval($row['reason']);
        if (!isset($level)) {
        } else {
            if (!$comments) {
                echo "<ul>";
            }
        }
        $comments++;
        if (!eregi("[a-z0-9]", $r_name)) {
            $r_name = $anonymous;
        }
        if (!eregi("[a-z0-9]", $r_subject)) {
            $r_subject = "[" . _NOSUBJECT . "]";
        }
        formatTimestamp($r_date);
        echo "<a href=\"modules.php?name={$module_name}&amp;file=comments&amp;op=showreply&amp;tid={$r_tid}&amp;mode={$mode}&amp;order={$order}&amp;thold={$thold}\">{$r_subject}</a><font class=\"content\"> " . _BY . " {$r_name} " . _ON . " {$datetime}<br>";
        DisplayBabies($r_tid, $level + 1, $dummy + 1);
    }
    if ($level && $comments) {
        echo "</ul>";
    }
}
Esempio n. 2
0
function DisplayBabies($tid, $level = 0, $dummy = 0)
{
    global $datetime, $anonymous, $prefix, $db, $module_name, $userinfo, $cookie, $user;
    cookiedecode($user);
    getusrinfo($user);
    $tid = intval($tid);
    $comments = 0;
    $result = $db->sql_query("SELECT tid, pid, sid, date, name, email, host_name, subject, comment, score, reason FROM " . $prefix . "_comments WHERE pid='{$tid}' ORDER BY date, tid");
    while ($row = $db->sql_fetchrow($result)) {
        $r_tid = intval($row['tid']);
        $r_pid = intval($row['pid']);
        $r_sid = intval($row['sid']);
        $r_date = $row['date'];
        $r_name = filter($row['name'], "nohtml");
        $r_email = filter($row['email'], "nohtml");
        $r_host_name = filter($row['host_name'], "nohtml");
        $r_subject = filter($row['subject'], "nohtml");
        $r_comment = filter($row['comment']);
        $r_score = intval($row['score']);
        $r_reason = intval($row['reason']);
        if (isset($level) and !$comments) {
            echo "<ul>";
        }
        $comments++;
        if (!eregi("[a-z0-9]", $r_name)) {
            $r_name = $anonymous;
        }
        if (!eregi("[a-z0-9]", $r_subject)) {
            $r_subject = "[" . _NOSUBJECT . "]";
        }
        formatTimestamp($r_date);
        $options = "";
        $options .= "&mode=" . $mode;
        $options .= "&order=" . $order;
        $options .= "&thold=" . $thold;
        echo "<a href=\"modules.php?name={$module_name}&amp;file=comments&amp;op=showreply&amp;tid={$r_tid}{$options}\">{$r_subject}</a></font><font class=\"content\"> " . _BY . " {$r_name} " . _ON . " {$datetime}<br>";
        DisplayBabies($r_tid, $level + 1, $dummy + 1);
    }
    if ($level and $comments) {
        echo "</ul>";
    }
}