Use MySQL's LIMIT feature:
LIMIT 0,10 <-- will get 10 records, starting from the first one (0)
LIMIT 10,20 <-- will get 20 records, starting from the 11th
just add something like:
if (!$limitstart) {
$limitstart = 0;
}
$limitquery = "LIMIT $limitstart,25";
And reference $limitquery in your MySQL query.
Showing the paging mechanisms involves counting how many threads there actually are, then running a loop. Here's the code I used in mArticle to do it:
Code:
$acount=$DB_site->query_first("SELECT COUNT(id) AS id FROM $table[articlemain] WHERE section=$sec AND (notes NOT LIKE '%U%')");
$count=$acount[id];
$amntpages = ceil($count/$maxperpage);
if ($amntpages==0) { $amntpages = 1; }
$i = 0;
$pages = "";
while($i<$amntpages) {
$i2 = $i + 1;
$limit = $maxperpage * $i;
if ($limit==$limitstart) {
eval("\$pages .= \"".usetemplate("browsesec_pagecur")."\";");
} else {
eval("\$pages .= \"".usetemplate("browsesec_pageother")."\";");
}
$i++;
} //end while $i<=$amntpages
Obviously, you'll have to change the variable names and change the references to "usetemplate"