Esempio n. 1
0
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();
}
Esempio n. 2
0
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();
}
Esempio n. 3
0
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();
}