示例#1
0
文件: get.php 项目: kastner/pgboard
function list_get()
{
    global $DB;
    $Query = new BoardQuery();
    $List = new BoardList();
    $List->type(LIST_MESSAGE);
    $List->title(TITLE_BOARD);
    $List->header();
    $DB->query($Query->list_message(cmd(2, true), cmd(3, true)));
    $List->data($DB->load_all());
    $List->message();
    $List->footer();
}
示例#2
0
function thread_get()
{
    global $DB;
    $Search = new Search();
    $offset = cmd(3, true) ? cmd(3, true) * 100 : 0;
    $res = $Search->query(cmd(2), "thread", $offset);
    $ids = array_keys($res['matches']);
    $page = cmd(3, true) + 1;
    $Query = new BoardQuery();
    $List = new BoardList();
    $List->type(LIST_THREAD_SEARCH);
    $List->title("Search Threads: " . htmlentities(cmd(2)));
    $List->subtitle(number_format($res['total']) . " results found showing " . ($offset ? $offset : 1) . "-" . ($offset + 100) . SPACE . ARROW_RIGHT . SPACE . "page: {$page}");
    $List->header(false);
    require_once DIR . "module/search/.content/main.php";
    $List->header_menu();
    if ($res['total'] == 0 || $offset > $res['total']) {
        $ids = array(0);
    }
    $DB->query($Query->list_thread(false, false, false, $ids));
    $List->data($DB->load_all());
    $List->thread();
    $List->footer();
}
示例#3
0
$list[0][LIST_SUBJECT] = "color schemer";
$list[0][LIST_POSTS] = "5";
$list[0][LIST_VIEWS] = "5";
$list[0][LIST_FIRSTPOST_BODY] = "test";
$list[0][LIST_LAST_VIEW_POSTS] = "";
$list[0][LIST_DOTFLAG] = "";
$list[0][LIST_STICKY] = "";
$list[0][LIST_LOCKED] = "";
$list[0][LIST_LEGENDARY] = "";
$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];
示例#4
0
文件: get.php 项目: kastner/pgboard
function listfavoritesbymember_get()
{
    global $DB, $Core;
    // get info
    $id = $Core->idfromname(id());
    $name = $Core->namefromid($id);
    $page = cmd(3, true) + 1;
    // get threads participiated in
    $DB->query("SELECT\r\n                f.thread_id\r\n              FROM\r\n                favorite f\r\n              LEFT JOIN\r\n                thread t\r\n              ON\r\n                t.id = f.thread_id\r\n              WHERE\r\n                f.member_id=\$1\r\n              ORDER BY\r\n                t.date_last_posted DESC", array($id));
    $threads = $DB->load_all('thread_id');
    if (!$id || !$name) {
        return to_index();
    }
    $Query = new BoardQuery();
    $List = new BoardList();
    $List->type(LIST_THREAD_HISTORY);
    $List->title("Favorites: {$name}");
    $List->subtitle("page: {$page}");
    $List->header();
    $DB->query($Query->list_thread(false, cmd(3, true), cmd(4, true), $threads));
    $List->data($DB->load_all());
    $List->thread();
    $List->footer();
}
示例#5
0
function listignoredthreadsbymember_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();
    }
    if (!IGNORED_THREADS_PUBLIC && $id != session('id')) {
        return to_index();
    }
    // get threads participiated in
    $DB->query("SELECT\n                tm.thread_id\n              FROM\n                thread_member tm\n              LEFT JOIN\n                thread t\n              ON\n                t.id = tm.thread_id\n              WHERE\n                tm.member_id=\$1 AND tm.ignore=true\n              ORDER BY\n                t.date_last_posted DESC", array($id));
    $threads = $DB->load_all('thread_id');
    if (!$threads) {
        $threads = array(0);
    }
    $Query = new BoardQuery();
    $List = new BoardList();
    $List->type(LIST_THREAD_HISTORY);
    $List->title("Ignored threads: {$name}");
    $List->subtitle("page: {$page}");
    $List->header();
    $DB->query($Query->list_thread(false, cmd(3, true), cmd(4, true), $threads, false, false));
    $List->data($DB->load_all());
    $List->thread();
    $List->footer();
}