Ejemplo n.º 1
0
 function InterthreadQuoteCheck($matches)
 {
     global $tc_db, $ispage, $thread_board_return, $thread_board_id;
     $lastchar = '';
     // If the quote ends with a , or -, cut it off.
     if (substr($matches[0], -1) == "," || substr($matches[0], -1) == "-") {
         $lastchar = substr($matches[0], -1);
         $matches[1] = substr($matches[1], 0, -1);
         $matches[0] = substr($matches[0], 0, -1);
     }
     if ($this->boardtype != 1 && is_numeric($matches[1])) {
         $query = "SELECT `parentid` FROM `" . KU_DBPREFIX . "posts` WHERE `boardid` = " . $this->boardid . " AND `id` = " . $tc_db->qstr($matches[1]);
         $result = $tc_db->GetOne($query);
         if ($result !== '') {
             if ($result == 0) {
                 $realid = $matches[1];
             } else {
                 $realid = $result;
             }
         } else {
             return $matches[0];
         }
         $return = '<a href="' . KU_BOARDSFOLDER . $thread_board_return . '/res/' . $realid . '.html#' . $matches[1] . '" onclick="return highlight(\'' . $matches[1] . '\', true);" class="ref|' . $thread_board_return . '|' . $realid . '|' . $matches[1] . '">' . $matches[0] . '</a>' . $lastchar;
     } else {
         $return = $matches[0];
         $postids = getQuoteIds($matches[1]);
         if (count($postids) > 0) {
             $realid = $this->parentid;
             if ($realid === 0) {
                 if ($this->id > 0) {
                     $realid = $this->id;
                 }
             }
             if ($realid !== '') {
                 $return = '<a href="' . KU_BOARDSFOLDER . 'read.php';
                 if (KU_TRADITIONALREAD) {
                     $return .= '/' . $thread_board_return . '/' . $realid . '/' . $matches[1];
                 } else {
                     $return .= '?b=' . $thread_board_return . '&t=' . $realid . '&p=' . $matches[1];
                 }
                 $return .= '">' . $matches[0] . '</a>';
             }
         }
     }
     return $return;
 }
Ejemplo n.º 2
0
}
$singlepost = isset($_GET['single']) ? true : false;
require KU_ROOTDIR . 'inc/functions.php';
require KU_ROOTDIR . 'inc/classes/board-post.class.php';
$executiontime_start = microtime_float();
$results = $tc_db->GetOne("SELECT COUNT(*) FROM `" . KU_DBPREFIX . "boards` WHERE `name` = " . $tc_db->qstr($board) . " LIMIT 1");
if ($results == 0) {
    die('Invalid board.');
}
$board_class = new Board($board);
if ($board_class->board['type'] == 1) {
    $replies = $tc_db->GetOne("SELECT COUNT(*) FROM `" . KU_DBPREFIX . "posts` WHERE `boardid` = " . $board_class->board['id'] . " AND `parentid` = " . $tc_db->qstr($thread) . "");
} else {
    $replies = false;
}
$postids = getQuoteIds($posts, $replies);
if (count($postids) == 0) {
    die('No valid posts specified.');
}
if ($board_class->board['type'] == 1) {
    $noboardlist = true;
    $hide_extra = true;
} else {
    $noboardlist = false;
    $hide_extra = false;
    $replies = false;
    $postidquery = '';
    if (count($postids) > 1 && (!empty($postids[1]) || !empty($postids['BETWEEN']))) {
        $i = 0;
        foreach ($postids as $key => $postid) {
            if (is_numeric($key)) {