Exemple #1
0
         }
         if ($row['content_flags'] & 0x4) {
             $icons .= ' <img border=0 src="' . $root_dir . $youtube_img . '"/> ';
         }
         if ($row['content_flags'] & $content_nsfw) {
             $nsfw .= '<span class="nsfw">NSFW</span>';
         }
         $subj = print_subject(encode_subject($row['subject']));
         if (extension_loaded('mbstring')) {
             $content_to_compare = $row['compare_to'];
             if (is_null($content_to_compare)) {
                 $content_to_compare = $row['msg_subject'];
             }
             $from_text = $subj;
             // htmlentities($body, HTML_ENTITIES,'UTF-8');
             $to_text = print_subject(encode_subject($content_to_compare));
             $from_text = mb_convert_encoding($from_text, 'HTML-ENTITIES', 'UTF-8');
             $to_text = mb_convert_encoding($to_text, 'HTML-ENTITIES', 'UTF-8');
             $diff_opcodes = FineDiff::getDiffOpcodes($from_text, $to_text);
             $subj = mb_convert_encoding(FineDiff::renderDiffToHTMLFromOpcodes($from_text, $diff_opcodes), 'UTF-8', 'HTML-ENTITIES');
         }
         $line = $icons . '<a id="' . $msg_id . '_' . $row['id'] . '" name="' . $msg_id . '_' . $row['id'] . '" target="bottom" href="' . $root_dir . $page_version . '?id=' . $msg_id . '&ver=' . $row['id'] . '">' . $subj . '</a> ' . $nsfw . ' ' . ' [' . $row['views'] . ' views] ' . $row['created'] . ' <b>' . $row['chars'] . '</b> bytes';
     }
     if (isset($version) && $version == $row['id']) {
         print '<font color="green">&gt;</font>';
     } else {
         print '<span style="opacity:0;">&gt;</span>';
     }
     print '<i><font color="gray">' . $line . '</font></i>';
     print '<br/>';
 }
Exemple #2
0
        die('Query failed ');
    }
    while ($row = mysql_fetch_assoc($result_ignored)) {
        array_push($ignored, $row['ignored']);
    }
}
while ($row = mysql_fetch_assoc($result)) {
    $id = $row['id'];
    $ban_ends = $row['ban_ends'];
    $banned = false;
    if (!is_null($ban_ends) && strcmp($ban_ends, '0000-00-00 00:00:00')) {
        $banned = true;
    }
    $auth_moder = $row['moder'];
    $subj = $row['subject'];
    $subj = encode_subject($subj);
    $enc_user = htmlentities($row['username'], HTML_ENTITIES, 'UTF-8');
    $post_author = $enc_user;
    if ($banned === true) {
        $enc_user = '******' . $enc_user . '</font>';
    }
    $enc_user = '******' . $root_dir . $page_byuser . '?author_id=' . $row['author'] . '" target="contents">' . $enc_user . '</a>';
    if ($num == 1) {
        setcookie('last_id2', $id, 1800000000, $root_dir, $host);
        $max_id = $id;
    }
    $icons = '';
    if ($row['content_flags'] & 0x2) {
        $icons = ' <img border=0 src="' . $root_dir . $image_img . '"/> ';
    }
    if ($row['content_flags'] & 0x4) {
Exemple #3
0
function m_print_threads($result, &$content)
{
    #global $pix;
    global $root_dir;
    global $page_msg;
    global $page_byuser;
    global $page_topthread;
    global $page;
    global $cur_page;
    global $page_collapsed;
    global $page_thread;
    global $prop_bold;
    global $content_nsfw;
    #$pix=0;
    $msgs = array();
    $content = array();
    $cur_content =& $content;
    $stack = array();
    $stack[0] =& $content;
    $level = 0;
    $armass = array();
    $glob = array();
    $l = 0;
    $b_start = '';
    $b_end = '';
    if (!is_null($prop_bold) && $prop_bold > 0 && strcmp($cur_page, $page_collapsed)) {
        $b_start = '<b>';
        $b_end = '</b>';
    }
    while ($row = mysql_fetch_assoc($result)) {
        $length = $row['chars'];
        $armass[$l] = array();
        $auth_text = '';
        $moder = $row['moder'];
        #if (!is_null($moder)) {
        if ($moder == 1) {
            $auth_text = '<font color="green"> *</font>';
        } else {
            $auth_text = '';
            #$auth_text = '<font color="red">*</font>';
        }
        $banned = false;
        $ban_ends = $row['ban_ends'];
        $subj = $row['subject'];
        $subj = encode_subject($subj);
        $enc_user = htmlentities($row['username'], HTML_ENTITIES, 'UTF-8');
        if (!is_null($ban_ends) && strcmp($ban_ends, '0000-00-00 00:00:00')) {
            $banned = true;
        }
        if ($banned === true) {
            $enc_user = '******' . $enc_user . '</font>';
        }
        $enc_user = '******' . $root_dir . $page_byuser . '?author_id=' . $row['user_id'] . '" target="contents">' . $enc_user . '</a>';
        if ($row['status'] == 2) {
            if ($row['level'] == 0) {
                $line = '&nbsp;<img border=0 src="images/bs.gif" alt="*"> <I><font color="gray"><del>This message has been deleted</del></font></I> ';
            } else {
                $line = '&nbsp;<img border=0 src="images/dc.gif" alt="*"> <I><font color="gray"><del>This message has been deleted</del></font></I> ';
            }
        } else {
            $nsfw = '';
            if ($row['content_flags'] & $content_nsfw) {
                $nsfw .= ' <span class="nsfw">NSFW</span>';
            }
            if ($row['level'] == 0) {
                $line = '<div id="div_mes_' . $row['msg_id'] . '" onclick="this.style.display=\'none\'" class="show_message"></div><a href="#" onclick="show_message(\'' . $row['msg_id'] . '\'); return false;" class="index"><b>' . $row["username"] . ': </b>' . $subj . '</a>' . $nsfw . '</dd>';
                #$line = '&nbsp;<a id="' . $row['msg_id'] . '" onClick="SelectAll(\'' . $row['msg_id'] . '\');"  name="' . $row['msg_id'] . '" target="' . detect_mobile() . '" href="' . $root_dir . $page_msg . '?id=' . $row['msg_id'] . '"><img border=0 src="images/bs.gif" width=16 height=16 alt="*"> ' . $b_start . $subj . $b_end . '  </a> ';
            } else {
                $line = '<div id="div_mes_' . $row['msg_id'] . '" onclick="this.style.display=\'none\'" class="show_message"></div><a href="#" onclick="show_message(\'' . $row['msg_id'] . '\'); return false;" class="index"><b>' . $row["username"] . ': </b>' . $subj . '</a>' . $nsfw . '</dd>';
                #$line = '&nbsp;<a id="' . $row['msg_id'] . '" onClick="SelectAll(\'' . $row['msg_id'] . '\');"  name="' . $row['msg_id'] . '" target="' . detect_mobile() . '" href="' . $root_dir . $page_msg . '?id=' . $row['msg_id'] . '"><img border=0 src="images/dc.gif" width=16 height=16 alt="*"> ' . $subj . '  </a> ';
            }
        }
        #$line .= '<b>' . $enc_user . '</b>' . $auth_text .  ' ' . $row['created'] . ' <b>' . $length . ' b</b>/' . $row['views'] . ' views';
        if (!strcmp($cur_page, $page_collapsed)) {
            $line .= ' <font color="gray">[ <a href="' . $root_dir . $page_topthread . '?thread=' . $row['thread_id'] . '&page=' . $page . '" target="contents">+' . $row['counter'] . '</a> ] </font>    ';
        }
        $msgs[$row['msg_id']] = $line;
        if ($row['level'] == 0) {
            $content[$row['msg_id']] =& $armass[$l];
            $glob[$row['msg_id']] =& $armass[$l];
        } else {
            $cur_content =& $glob[$row['parent']];
            $cur_content[$row['msg_id']] =& $armass[$l];
            $glob[$row['msg_id']] =& $armass[$l];
        }
        $l++;
    }
    return $msgs;
}