function previewpost_post() { global $DB, $Core, $Security, $cmd; if (session('id') && (post('name') == "" && post('pass') == "")) { $_POST['member_id'] = session('id'); } else { if ($member_id = $Security->form_login(post('name'), post('pass'))) { $_POST['member_id'] = $member_id; } else { exit_clean(); } } // fake post count number a bit of a hack if (id()) { $cmd[3] = $DB->value("SELECT posts FROM thread WHERE id=\$1", array(id())); } // fake database resultset $data = array(); $data[0][VIEW_ID] = 99999999; // use new parser $data[0][VIEW_DATE_POSTED] = time(); $data[0][VIEW_CREATOR_ID] = post('member_id'); $data[0][VIEW_CREATOR_NAME] = $Core->namefromid(post('member_id')); $data[0][VIEW_BODY] = post('body'); $data[0][VIEW_CREATOR_IP] = ""; $data[0][VIEW_SUBJECT] = ""; $data[0][VIEW_THREAD_ID] = ""; $data[0][VIEW_CREATOR_IS_ADMIN] = session('admin') ? 't' : 'f'; // use standard board display to build preview $View = new BoardView(); $View->type(VIEW_THREAD_PREVIEW); $View->data($data); $View->thread(); exit_clean(); }
function view_get() { global $DB, $Core; if (!id()) { return to_index(); } if (!$DB->check("SELECT true FROM message_member WHERE message_id=\$1 AND member_id=\$2 AND deleted IS false", array(id(), session('id')))) { return to_index("/message/"); } $Query = new BoardQuery(); $View = new BoardView(); $View->type(VIEW_MESSAGE); $View->member_update(); $View->increment_views(); $subject = $View->subject(id()); $subject .= "<span class=\"smaller\">"; if (session('hidemedia')) { if (get('media')) { $subject .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"" . url() . "\">hide images</a>"; } if (!get('media')) { $subject .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"" . url() . "&media=true\">show images</a>"; } } if (!session('hidemedia')) { if (!get('media')) { $subject .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"" . url() . "&media=true\">hide images</a>"; } if (get('media')) { $subject .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"" . url() . "\">show images</a>"; } } $subject .= SPACE . ARROW_RIGHT . SPACE . "<a href=\"/message/delete/" . id() . "/" . md5(session_id()) . "/\">delete</a>"; $subject .= "</span>"; $View->title($subject); $DB->query("SELECT m.name,mm.deleted FROM message_member mm LEFT JOIN member m ON m.id=mm.member_id WHERE mm.message_id=\$1", array(id())); $subtitle = "<strong>Participating:</strong> "; while ($name = $DB->load_array()) { if ($name['deleted'] == 't') { $subtitle .= "<strike>" . $Core->member_link($name['name']) . "</strike>, "; } else { $subtitle .= $Core->member_link($name['name']) . ", "; } } $View->subtitle(substr($subtitle, 0, -2)); $View->header(); $DB->query($Query->view_message(id(true), cmd(3, true), cmd(4, true))); $View->data($DB->load_all()); $View->message(); $View->footer(); }
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(); }
$list[1] = $list[0]; $list[2] = $list[0]; $list[2][LIST_CREATOR_ID] = session('id'); $list[2][LIST_CREATOR_NAME] = $Core->namefromid(session('id')); $list[3] = $list[0]; $List = new BoardList(); $List->type(LIST_THREAD); $List->data($list); $List->thread(); print "<br/>"; $view = array(); $view[0][VIEW_ID] = ""; $view[0][VIEW_DATE_POSTED] = time(); $view[0][VIEW_CREATOR_ID] = 0; $view[0][VIEW_CREATOR_NAME] = "color scheme"; $view[0][VIEW_BODY] = "color scheme post text"; $view[0][VIEW_CREATOR_IP] = ""; $view[0][VIEW_SUBJECT] = ""; $view[0][VIEW_THREAD_ID] = ""; $view[0][VIEW_CREATOR_IS_ADMIN] = 'f'; $view[1] = $view[0]; $view[2] = $view[0]; $view[2][VIEW_CREATOR_ID] = session('id'); $view[2][VIEW_CREATOR_NAME] = $Core->namefromid(session('id')); $view[3] = $view[0]; // use standard board display to build preview $View = new BoardView(); $View->type(VIEW_THREAD_PREVIEW); $View->data($view); $View->thread(); $Base->footer();
function viewbymember_get() { global $DB, $Core; // get info $id = $Core->idfromname(id()); $name = $Core->namefromid($id); $page = cmd(3, true) + 1; if (!$id || !$name) { return to_index(); } $Query = new BoardQuery(); $View = new BoardView(); $View->type(VIEW_THREAD_HISTORY); $View->title("Posts Created: {$name}"); $View->subtitle("page {$page}"); $View->header(); $DB->query($Query->view_thread_bymember($id, cmd(3, true), cmd(4, true))); $View->data($DB->load_all()); $View->thread(); $View->footer(); }