PDA

View Full Version : pagenav dropdown menu


treszoks
Mon 15th Oct '01, 3:04pm
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!

drumsy
Mon 15th Oct '01, 3:39pm
Screen shot????:confused:

MarkB
Mon 15th Oct '01, 8:56pm
I installed it on my test board - nice! It will need some cleaning up to make it fit in a little (the dropdown makes it look a bit funky).

Here's a small screen shot:

floleb7
Mon 15th Oct '01, 9:03pm
http://www.vbulletin.com/forum/showthread.php?s=&threadid=24044

treszoks
Tue 16th Oct '01, 12:49am
Yeah, I saw that thread floleb7, but none of them did what I wanted. Those just require editing the templates and don't show every single page in the dropdown menu like this which requires editing more than just a template. Someone may want one of those other options in that thread though.