From 6a472ee371a6d6f5a56180412c6c1fdb012ebc77 Mon Sep 17 00:00:00 2001 From: Randy Jensen Date: Sat, 19 Nov 2011 21:57:21 -0600 Subject: [PATCH] styled pagination. couple bug fixes --- openphoto-wordpress.php | 114 ++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 50 deletions(-) diff --git a/openphoto-wordpress.php b/openphoto-wordpress.php index 130ffcc..859758e 100644 --- a/openphoto-wordpress.php +++ b/openphoto-wordpress.php @@ -140,61 +140,75 @@ class WP_OpenPhoto { return false; }); + // Weird empty page nav item showing. This removes it. Will break the nav once the code is fixed. + jQuery(".page-numbers").not(".next").eq(0).hide(); }); - -totalPages; - $current_page = $photos[0]->currentPage; - $total_photos = $photos[0]->totalRows; - -echo '

Images ('. $total_photos . ')

'; - - -}?> - - -
-
-
- - -
-
+ + + + + + +
    + totalPages; + $current_page = $photos[0]->currentPage; + $total_photos = $photos[0]->totalRows; + echo '
  • Total Images ('. $total_photos . ')
  • '; + }?> +
+
+ 1) + { + echo '
'; + if ($current_page > 1) + { + echo ''; + } + for($i==1;$i<=$total_pages;$i++) { + $current = ""; + if ($current_page == $i) { + $current = ' current '; + echo ''. $i . ''; + } else { + echo ''. $i . ''; + } + } + if ($current_page < $total_pages) + { + echo ''; + } + echo '
'; + } + } ?> + + +
+ +
- - + + +
+ + 1) - { - echo '
'; - for($i==1;$i<=$total_pages;$i++) { - $current = ""; - if ($current_page == $i) { - echo ''. $i . ''; - } else { - echo ''. $i . ''; - } - } - if ($current_page < $total_pages) - { - echo ''; - } - echo '
'; - } + { echo '
'; echo '';