From: Hans-Emil Skogh Date: Thu, 22 Dec 2011 19:37:57 +0000 (+0100) Subject: Redesigned the next/previous page switcher to allow direct access to any page. X-Git-Tag: 0.1~1063^2~12^2~1 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ef4f189a1a3a5fdb0b9a4d372b591f6930bd8cb0;p=fdroidserver.git Redesigned the next/previous page switcher to allow direct access to any page. --- diff --git a/wp-fdroid/wp-fdroid.php b/wp-fdroid/wp-fdroid.php index 7d1b1dfc..2f1c253a 100644 --- a/wp-fdroid/wp-fdroid.php +++ b/wp-fdroid/wp-fdroid.php @@ -240,21 +240,31 @@ class FDroid $out.=$matches; $out.='

'; - if($query_vars['fdpage']==1) { - $out.="<<first "; - $out.="<prev "; - } else { - $out.='<<first '; - $out.='<<prev '; - } + + $out.='

'; $out.=' Page '.$query_vars['fdpage'].' of '.$numpages.' '; - if($query_vars['fdpage']==$numpages) { - $out.="next> "; - $out.="last>> "; - } else { + $out.='
'; + + $out.='
'; + if($query_vars['fdpage']!=$numpages) { $out.='next> '; - $out.='last>> '; } + $out.='
'; + + $out.='
'; + for($i=1;$i<=$numpages;$i++) { + if($i == $query_vars['fdpage']) { + $out.=''.$i.''; + } else { + $out.=''; + $out.=$i; + $out.=''; + } + $out.=' '; + } + $out.=' '; + $out.='
'; + $out.='

'; } else if($query_vars['fdfilter']!='') { $out.='

No matches

';