function view_get() { global $DB, $Core; if (!id(true)) { return to_index(); } $Query = new BoardQuery(); $View = new BoardView(); $View->type(VIEW_THREAD); $View->increment_views(); $subtitle = ""; if (session('hidemedia')) { if (get('media')) { $subtitle .= "<a href=\"" . url() . "\">hide images</a>"; } if (!get('media')) { $subtitle .= "<a href=\"" . url() . "&media=true\">show images</a>"; } } if (!session('hidemedia')) { if (!get('media')) { $subtitle .= "<a href=\"" . url() . "&media=true\">hide images</a>"; } if (get('media')) { $subtitle .= "<a href=\"" . url() . "\">show images</a>"; } } if (session('id')) { if (!$Core->check_favorite(id())) { $subtitle .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"javascript:;\" onclick=\"toggle_favorite(" . id() . ");\"><span id=\"fcmd\">add</span> favorite</a>\n"; } else { $subtitle .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"javascript:;\" onclick=\"toggle_favorite(" . id() . ");\"><span id=\"fcmd\">remove</span> favorite</a>\n"; } } if (session('admin')) { $Admin = new BoardAdmin(); $sticky = $Admin->check_flag("sticky", id()); $locked = $Admin->check_flag("locked", id()); $subtitle .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"/admin/togglesticky/" . id() . "\">" . ($sticky ? "unsticky" : "sticky") . "</a>"; $subtitle .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"/admin/togglelocked/" . id() . "\">" . ($locked ? "unlock" : "lock") . "</a>"; } $View->title($View->subject(id())); $View->subtitle($subtitle); $View->header(); $DB->query($Query->view_thread(id(true), cmd(3, true), cmd(4, true))); $View->data($DB->load_all()); $View->thread(); $View->footer(); $View->member_update(); }
function thread_post_get() { global $DB; $Search = new Search(); $offset = cmd(3, true) ? cmd(3, true) * 100 : 0; $res = $Search->query(cmd(2), "thread_post", $offset); $ids = array_keys($res['matches']); $page = cmd(3, true) + 1; $Query = new BoardQuery(); $View = new BoardView(); $View->type(VIEW_THREAD_SEARCH); $View->title("Search Thread Posts: " . htmlentities(cmd(2))); $View->subtitle(number_format($res['total']) . " results found showing " . ($offset ? $offset : 1) . "-" . ($offset + 100) . SPACE . ARROW_RIGHT . SPACE . "page: {$page}"); $View->header(false); require_once DIR . "module/search/.content/main.php"; $View->header_menu(); if ($res['total'] == 0) { $ids = array(0); } $DB->query($Query->view_thread(false, cmd(3, true), cmd(4, true), $ids)); $View->data($DB->load_all()); $View->thread(); $View->footer(); }
function view_get() { global $DB, $Core; $xmldata = ''; if (!id(true)) { return to_index(); } $Query = new BoardQuery(); $View = new BoardView(); $View->type(VIEW_THREAD); $View->increment_views(); $subtitle = ""; // set flags for media link $flags = ""; if (!get('media')) { $flags .= "&media=true"; } if (get('uncollapse')) { $flags .= "&uncollapse=true"; } if (session('hidemedia')) { if (get('media')) { $subtitle .= "<a href=\"" . url() . "{$flags}\">hide images</a>"; } if (!get('media')) { $subtitle .= "<a href=\"" . url() . "{$flags}\">show images</a>"; } } if (!session('hidemedia')) { if (!get('media')) { $subtitle .= "<a href=\"" . url() . "{$flags}\">hide images</a>"; } if (get('media')) { $subtitle .= "<a href=\"" . url() . "{$flags}\">show images</a>"; } } // set flags for collase link $flags = ""; if (!get('uncollapse')) { $flags .= "&uncollapse=true"; } if (get('media')) { $flags .= "&media=true"; } if (!session('nocollapse')) { if (!get('uncollapse')) { $subtitle .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"" . url() . "{$flags}\">uncollapse</a>"; } if (get('uncollapse')) { $subtitle .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"" . url() . "{$flags}\">collapse</a>"; } } if (session('id')) { if (!$Core->check_favorite(id())) { $subtitle .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"javascript:;\" onclick=\"toggle_favorite(" . id() . ");\"><span id=\"fcmd\">add</span> favorite</a>\n"; } else { $subtitle .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"javascript:;\" onclick=\"toggle_favorite(" . id() . ");\"><span id=\"fcmd\">remove</span> favorite</a>\n"; } if (!$Core->check_ignored_thread(id())) { $subtitle .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"javascript:;\" onclick=\"toggle_ignore_thread(" . id() . ");\"><span id=\"ignorecmd\">ignore</span></a>\n"; } else { $subtitle .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"javascript:;\" onclick=\"toggle_ignore_thread(" . id() . ");\"><span id=\"ignorecmd\">unignore</span></a>\n"; } // undot if ($Core->check_dotted(id())) { $subtitle .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"javascript:;\" onclick=\"undot(" . id() . ");\" id=\"undot\">undot</a>\n"; } } if (session('admin')) { $Admin = new BoardAdmin(); $sticky = $Admin->check_flag("thread", "sticky", id()); $locked = $Admin->check_flag("thread", "locked", id()); $subtitle .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"/admin/togglesticky/" . id() . "/" . md5(session_id()) . "/\">" . ($sticky ? "unsticky" : "sticky") . "</a>"; $subtitle .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"/admin/togglelocked/" . id() . "/" . md5(session_id()) . "/\">" . ($locked ? "unlock" : "lock") . "</a>"; } $View->title($View->subject(id())); $View->subtitle($subtitle); $View->header(); $DB->query($Query->view_thread(id(true), cmd(3, true), cmd(4, true))); $View->data($DB->load_all()); if (get('xml')) { header("Content-type: text/xml"); print "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"; print "<posts>\n"; $View->thread_xml(); print "</posts>"; } else { if (get('uncollapse') && !session('nocollapse')) { $_SESSION['nocollapse'] = true; } $View->thread(); if (get('uncollapse')) { unset($_SESSION['nocollapse']); } } $View->footer(); $View->member_update(); }