PDA

View Full Version : pagenav dropdown menu


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!

drumsy
10-15-2001, 05:39 PM
Screen shot????:confused:

MarkB
10-15-2001, 10:56 PM
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
10-15-2001, 11:03 PM
<a href="http://www.vbulletin.com/forum/showthread.php?s=&threadid=24044" target="_blank">http://www.vbulletin.com/forum/showt...threadid=24044</a>

treszoks
10-16-2001, 02:49 AM
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.

ghroob
07-10-2003, 12:37 PM
Hello
Very nice hack
But it has bug with member's cp when try to change avatar.
Submit not working!

Try to fix it please
Thanx