Ejemplo n.º 1
0
    //分頁處理
    $tpp = 15;
    $_GET['page'] = $_GET['page'] > 0 ? intval($_GET['page']) : 1;
    $pstart = ($_GET['page'] - 1) * $tpp;
    $query = DB::query("SELECT count(s.itemid) AS count  FROM " . tname('spacecomments') . " s " . $wheresql . ";");
    $value = DB::fetch($query);
    foreach ($_GET as $key => $_value) {
        if (in_array($key, array('action', 'formhash', 'filtersubmit', 'type', 'author', 'itemid', 'order', 'sc', 'message'))) {
            $url .= '&' . $key . '=' . $_value;
        }
    }
    $url = '?' . substr($url, 1);
    $multipage = multi($value['count'], $tpp, $_GET['page'], 'admin.php' . $url, $phpurl = 1);
    //數據查詢
    $query = DB::query('SELECT * FROM ' . tname("spacecomments") . ' s ' . $wheresql . ' ORDER BY s.' . $_GET['order'] . ' ' . $_GET['sc'] . ' LIMIT ' . $pstart . ', ' . $tpp . ';');
    while ($value = DB::fetch($query)) {
        if (!empty($value['upcid'])) {
            $currentmessage = array();
            preg_match_all("/\\<div class=\"new\">(.+)?\\<\\/div\\>/is", $value['message'], $currentmessage, PREG_SET_ORDER);
            if (!empty($currentmessage)) {
                $value['message'] = $currentmessage[0][0];
            }
            $value['message'] = preg_replace("/\\<div class=\"quote\"\\>\\<blockquote.+?\\<\\/blockquote\\>\\<\\/div\\>/is", '', $value['message']);
        }
        $mlist .= showcommentrow($mname, $value);
    }
    showlistcomment($mlist, $multipage, 'comment');
    showcommentmod($mname, 'comment');
} else {
    show_searchfrom_comment('comment');
}
Ejemplo n.º 2
0
    //分頁處理
    $tpp = 15;
    $_GET['page'] = $_GET['page'] > 0 ? intval($_GET['page']) : 1;
    $pstart = ($_GET['page'] - 1) * $tpp;
    $query = DB::query("SELECT count(s.itemid) AS count  FROM " . tname('spacecomments') . " s " . $wheresql . ";");
    $value = DB::fetch($query);
    foreach ($_GET as $key => $_value) {
        if (in_array($key, array('action', 'formhash', 'filtersubmit', 'type', 'author', 'itemid', 'order', 'sc', 'message'))) {
            $url .= '&' . $key . '=' . $_value;
        }
    }
    $url = '?' . substr($url, 1);
    $multipage = multi($value['count'], $tpp, $_GET['page'], 'admin.php' . $url, $phpurl = 1);
    //數據查詢
    $query = DB::query('SELECT * FROM ' . tname("spacecomments") . ' s ' . $wheresql . ' ORDER BY s.' . $_GET['order'] . ' ' . $_GET['sc'] . ' LIMIT ' . $pstart . ', ' . $tpp . ';');
    while ($value = DB::fetch($query)) {
        if (!empty($value['upcid'])) {
            $currentmessage = array();
            preg_match_all("/\\<div class=\"new\">(.+)?\\<\\/div\\>/is", $value['message'], $currentmessage, PREG_SET_ORDER);
            if (!empty($currentmessage)) {
                $value['message'] = $currentmessage[0][0];
            }
            $value['message'] = preg_replace("/\\<div class=\"quote\"\\>\\<blockquote.+?\\<\\/blockquote\\>\\<\\/div\\>/is", '', $value['message']);
        }
        $mlist .= showcommentrow($mname, $value);
    }
    showlistcomment($mlist, $multipage, 'remark');
    showcommentmod($mname, 'remark');
} else {
    show_searchfrom_comment('remark');
}