From ef4f189a1a3a5fdb0b9a4d372b591f6930bd8cb0 Mon Sep 17 00:00:00 2001
From: Hans-Emil Skogh
Date: Thu, 22 Dec 2011 20:37:57 +0100
Subject: [PATCH] Redesigned the next/previous page switcher to allow direct
access to any page.
---
wp-fdroid/wp-fdroid.php | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
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
';
--
2.30.2