I'm not quite sure if the posted version of the app
does this (I have modified some of the code to support
my database structure) but if you have a large
database and run a browse/search that returns a large
number of pages. The resulting display is a bit
messy. Presently if the results of a browse/search
returns 50 pages, all 50 links are displayed at the
bottom of the screen.
Would it be possible to have it look more like the
searches on the internet? That is show the first 10
pages with a next link to display the 11th page. And
say if you are on the 15th page to have a previous
link.
Logged In: YES
user_id=1476397
I've modified the search.php to now support this feature.
Following is a snipet of my code along with some of the
original code to identify placement within the file...
// generate page_list
$page_list = "";
//calculate which page on currently
$cur_page = $pos/ROWS_PER_PAGE + 1;
//set min page number for pagelist
if ($cur_page-5 < 0) {
$minpage = 0;
}
elseif (($page_count-10) < $cur_page) {
$minpage = $page_count - 10;
}
else {
$minpage = $cur_page - 5;
}
//set maximum page number for page list
if (($minpage+10) < $page_count) {
$maxpage = $minpage + 10;
}
else {
$maxpage = $page_count;
}
//create page list
for ($i = $minpage; $i<$maxpage; ++$i) {
$tmp = $i+1;
if ($pos == $i*ROWS_PER_PAGE) {
$page_list .= $tmp . " ";
} else {
$page_list .= "<a href=\"search.php?" . $query . "&pos="
. $i*ROWS_PER_PAGE . "\">" . $tmp . "</a> ";
}
}
Logged In: YES
user_id=1476397
whoops found a bug...
Change
if ($cur_page-5 < 0) {
to
if (($cur_page-5 < 0) || ($page_count < 10)) {