treszoks
10-14-2001, 10:00 PM
Ok, this modification changes the current pagenav stuff such as: "Pages (3): [ < ? 1 ? 2 ? 3 ? ]" to a simple dropdown menu containing all the pages...no previous/next/first/last crap.
In functions.php:
Find this:
if ($pagenumber>1) {
$prevpage = $pagenumber-1;
eval("\$prevlink = \"".gettemplate("pagenav_prevlink")."\";");
}
if ($pagenumber<$totalpages) {
$nextpage = $pagenumber+1;
eval("\$nextlink = \"".gettemplate("pagenav_nextlink")."\";");
}
while ($curpage++<$totalpages) {
if ( ( $curpage <= $pagenumber-$pagenavpages || $curpage >= $pagenumber+$pagenavpages ) && $pagenavpages!=0 ) {
if ($curpage==1) {
eval("\$firstlink = \"".gettemplate("pagenav_firstlink")."\";");
}
if ($curpage==$totalpages) {
eval("\$lastlink = \"".gettemplate("pagenav_lastlink")."\";");
}
} else {
if ($curpage==$pagenumber) {
eval("\$pagenav .= \"".gettemplate("pagenav_curpage")."\";");
} else {
eval("\$pagenav .= \"".gettemplate("pagenav_pagelink")."\";");
}
}
}
Replace with this:
$pagenav = '<FORM ACTION="" METHOD=POST><SELECT NAME=url onchange="window.location.href=this.options[this.selectedIndex].value">';
while ($curpage++<$totalpages) {
if ($curpage == $pagenumber) {
$select=" SELECTED";
}
else {
$select="";
}
$pagenav .= '<OPTION VALUE="'.$address.'&pagenumber='.$curpage.'"'.$select.'>Page '.$curpage.' of '.$totalpages;
}
$pagenav .= '</SELECT><INPUT TYPE=submit NAME=Submit VALUE="Go!"></FORM>';
Modify the "pagenav" template so it just contains this:
$pagenav
That's it!
In functions.php:
Find this:
if ($pagenumber>1) {
$prevpage = $pagenumber-1;
eval("\$prevlink = \"".gettemplate("pagenav_prevlink")."\";");
}
if ($pagenumber<$totalpages) {
$nextpage = $pagenumber+1;
eval("\$nextlink = \"".gettemplate("pagenav_nextlink")."\";");
}
while ($curpage++<$totalpages) {
if ( ( $curpage <= $pagenumber-$pagenavpages || $curpage >= $pagenumber+$pagenavpages ) && $pagenavpages!=0 ) {
if ($curpage==1) {
eval("\$firstlink = \"".gettemplate("pagenav_firstlink")."\";");
}
if ($curpage==$totalpages) {
eval("\$lastlink = \"".gettemplate("pagenav_lastlink")."\";");
}
} else {
if ($curpage==$pagenumber) {
eval("\$pagenav .= \"".gettemplate("pagenav_curpage")."\";");
} else {
eval("\$pagenav .= \"".gettemplate("pagenav_pagelink")."\";");
}
}
}
Replace with this:
$pagenav = '<FORM ACTION="" METHOD=POST><SELECT NAME=url onchange="window.location.href=this.options[this.selectedIndex].value">';
while ($curpage++<$totalpages) {
if ($curpage == $pagenumber) {
$select=" SELECTED";
}
else {
$select="";
}
$pagenav .= '<OPTION VALUE="'.$address.'&pagenumber='.$curpage.'"'.$select.'>Page '.$curpage.' of '.$totalpages;
}
$pagenav .= '</SELECT><INPUT TYPE=submit NAME=Submit VALUE="Go!"></FORM>';
Modify the "pagenav" template so it just contains this:
$pagenav
That's it!