Ejemplo n.º 1
0
                $ids_found++;
                $results[$range - 1]['message'] = stripslashes(formatLongMessage($results[$range - 1]['message'], $board_class->board['name'], $results[$range - 1][parentid], false));
                $relative_to_normal[$range - 1] = $results[$range - 1];
            }
        }
        if (count($relative_to_normal) > 0) {
            $board_class->dwoo_data->assign('posts', $relative_to_normal);
            $page .= $board_class->dwoo->get(KU_TEMPLATEDIR . '/txt_thread.tpl', $board_class->dwoo_data);
        }
    } else {
        $results = $tc_db->GetAll("SELECT * FROM `" . KU_DBPREFIX . "posts` WHERE `boardid` = " . $board_class->board['id'] . " AND ((`parentid` = 0 AND `id` = " . $tc_db->qstr($thread) . ") OR (`parentid` = " . $tc_db->qstr($thread) . ")) AND `IS_DELETED` = 0 ORDER BY `id` ASC");
        $ids_found = count($results);
        if (count($results) > 0) {
            $results[0]['replies'] = count($results) - 1;
            foreach ($results as $key => $post) {
                $results[$key]['message'] = stripslashes(formatLongMessage($results[$key]['message'], $board_class->board['name'], $results[$key][parentid], false));
            }
            $board_class->dwoo_data->assign('posts', $results);
            $page .= $board_class->dwoo->get(KU_TEMPLATEDIR . '/txt_thread.tpl', $board_class->dwoo_data);
        }
    }
    if ($ids_found == 0) {
        $page .= _gettext('Unable to find records of any posts matching that quote syntax.');
    }
} else {
    if (!$singlepost) {
        $page .= '<br />' . "\n";
    }
    $results = $tc_db->GetAll("SELECT * FROM `" . KU_DBPREFIX . "posts` WHERE `boardid` = " . $board_class->board['id'] . " AND (" . $postidquery . ") AND `IS_DELETED` = 0 ORDER BY `id` ASC");
    if ($board_class->board['type'] == 0) {
        $embeds = $tc_db->GetAll("SELECT filetype FROM `" . KU_DBPREFIX . "embeds`");
Ejemplo n.º 2
0
 function BuildPost($post, $page)
 {
     global $CURRENTLOCALE;
     if ($this->board['type'] == 1 && (isset($post['IS_DELETED']) && $post['IS_DELETED'] == 1 || isset($post['is_deleted']) && $post['is_deleted'] == 1)) {
         $post['name'] = '';
         $post['email'] = '';
         $post['tripcode'] = _gettext('Deleted');
         $post['message'] = '<font color="gray">' . _gettext('This post has been deleted.') . '</font>';
     }
     $dateEmail = empty($this->board['anonymous']) ? $post['email'] : 0;
     $post['message'] = stripslashes(formatLongMessage($post['message'], $this->board['name'], $post['parentid'] == 0 ? $post['id'] : $post['parentid'], $page));
     $post['timestamp_formatted'] = formatDate($post['timestamp'], 'post', $CURRENTLOCALE, $dateEmail);
     $post['reflink'] = formatReflink($this->board['name'], $post['parentid'] == 0 ? $post['id'] : $post['parentid'], $post['id'], $CURRENTLOCALE);
     if (isset($this->board['filetypes']) && in_array($post['file_type'], $this->board['filetypes'])) {
         $post['videobox'] = embeddedVideoBox($post);
     }
     if ($post['file_type'] == 'mp3' && $this->board['loadbalanceurl'] == '') {
         //Grab the ID3 info. TODO: Make this work for load-balanced boards.
         // include getID3() library
         require_once KU_ROOTDIR . 'lib/getid3/getid3.php';
         // Initialize getID3 engine
         $getID3 = new getID3();
         $post['id3'] = $getID3->analyze(KU_BOARDSDIR . $this->board['name'] . '/src/' . $post['file'] . '.mp3');
         getid3_lib::CopyTagsToComments($post['id3']);
     }
     if ($post['file_type'] != 'jpg' && $post['file_type'] != 'gif' && $post['file_type'] != 'png' && $post['file_type'] != '' && !in_array($post['file_type'], $this->board['filetypes'])) {
         if (!isset($filetype_info[$post['file_type']])) {
             $filetype_info[$post['file_type']] = getfiletypeinfo($post['file_type']);
         }
         $post['nonstandard_file'] = KU_WEBPATH . '/inc/filetypes/' . $filetype_info[$post['file_type']][0];
         if ($post['thumb_w'] != 0 && $post['thumb_h'] != 0) {
             if (file_exists(KU_BOARDSDIR . $this->board['name'] . '/thumb/' . $post['file'] . 's.jpg')) {
                 $post['nonstandard_file'] = KU_WEBPATH . '/' . $this->board['name'] . '/thumb/' . $post['file'] . 's.jpg';
             } elseif (file_exists(KU_BOARDSDIR . $this->board['name'] . '/thumb/' . $post['file'] . 's.png')) {
                 $post['nonstandard_file'] = KU_WEBPATH . '/' . $this->board['name'] . '/thumb/' . $post['file'] . 's.png';
             } elseif (file_exists(KU_BOARDSDIR . $this->board['name'] . '/thumb/' . $post['file'] . 's.gif')) {
                 $post['nonstandard_file'] = KU_WEBPATH . '/' . $this->board['name'] . '/thumb/' . $post['file'] . 's.gif';
             } else {
                 $post['thumb_w'] = $filetype_info[$post['file_type']][1];
                 $post['thumb_h'] = $filetype_info[$post['file_type']][2];
             }
         } else {
             $post['thumb_w'] = $filetype_info[$post['file_type']][1];
             $post['thumb_h'] = $filetype_info[$post['file_type']][2];
         }
     }
     return $post;
 }