Version Description
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-PageNavi |
Version | 2.50 |
Comparing to | |
See all releases |
Code changes from version 2.40 to 2.50
- pagenavi-css.css +2 -2
- pagenavi-options.php +29 -5
- readme.html +15 -4
- readme.txt +2 -2
- wp-pagenavi.mo +0 -0
- wp-pagenavi.php +56 -32
- wp-pagenavi.pot +81 -53
pagenavi-css.css
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
/*
|
2 |
+----------------------------------------------------------------+
|
3 |
| |
|
4 |
-
| WordPress 2.
|
5 |
-
| Copyright (c)
|
6 |
| |
|
7 |
| File Written By: |
|
8 |
| - Lester "GaMerZ" Chan |
|
1 |
/*
|
2 |
+----------------------------------------------------------------+
|
3 |
| |
|
4 |
+
| WordPress 2.8 Plugin: WP-PageNavi 2.50 |
|
5 |
+
| Copyright (c) 2009 Lester "GaMerZ" Chan |
|
6 |
| |
|
7 |
| File Written By: |
|
8 |
| - Lester "GaMerZ" Chan |
|
pagenavi-options.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
-
| WordPress 2.
|
6 |
-
| Copyright (c)
|
7 |
| |
|
8 |
| File Written By: |
|
9 |
| - Lester "GaMerZ" Chan |
|
@@ -40,6 +40,8 @@ if(!empty($_POST['Submit'])) {
|
|
40 |
$pagenavi_options['style'] = intval(trim($_POST['pagenavi_style']));
|
41 |
$pagenavi_options['num_pages'] = intval(trim($_POST['pagenavi_num_pages']));
|
42 |
$pagenavi_options['always_show'] = intval(trim($_POST['pagenavi_always_show']));
|
|
|
|
|
43 |
$update_pagenavi_queries = array();
|
44 |
$update_pagenavi_text = array();
|
45 |
$update_pagenavi_queries[] = update_option('pagenavi_options', $pagenavi_options);
|
@@ -102,7 +104,7 @@ switch($mode) {
|
|
102 |
$pagenavi_options = get_option('pagenavi_options');
|
103 |
?>
|
104 |
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
105 |
-
<form method="post" action="<?php echo $_SERVER['
|
106 |
<div class="wrap">
|
107 |
<?php screen_icon(); ?>
|
108 |
<h2><?php _e('Page Navigation Options', 'wp-pagenavi'); ?></h2>
|
@@ -165,7 +167,7 @@ switch($mode) {
|
|
165 |
<tr>
|
166 |
<th scope="row" valign="top"><?php _e('Text For Previous ...', 'wp-pagenavi'); ?></th>
|
167 |
<td>
|
168 |
-
<input type="text" name="pagenavi_dotleft_text" value="<?php echo stripslashes(htmlspecialchars($pagenavi_options['
|
169 |
</td>
|
170 |
</tr>
|
171 |
</table>
|
@@ -195,6 +197,28 @@ switch($mode) {
|
|
195 |
</select>
|
196 |
</td>
|
197 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
</table>
|
199 |
<p class="submit">
|
200 |
<input type="submit" name="Submit" class="button" value="<?php _e('Save Changes', 'wp-pagenavi'); ?>" />
|
@@ -204,7 +228,7 @@ switch($mode) {
|
|
204 |
<p> </p>
|
205 |
|
206 |
<!-- Uninstall WP-PageNavi -->
|
207 |
-
<form method="post" action="<?php echo $_SERVER['
|
208 |
<div class="wrap">
|
209 |
<h3><?php _e('Uninstall WP-PageNavi', 'wp-pagenavi'); ?></h3>
|
210 |
<p>
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
+
| WordPress 2.8 Plugin: WP-PageNavi 2.50 |
|
6 |
+
| Copyright (c) 2009 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
9 |
| - Lester "GaMerZ" Chan |
|
40 |
$pagenavi_options['style'] = intval(trim($_POST['pagenavi_style']));
|
41 |
$pagenavi_options['num_pages'] = intval(trim($_POST['pagenavi_num_pages']));
|
42 |
$pagenavi_options['always_show'] = intval(trim($_POST['pagenavi_always_show']));
|
43 |
+
$pagenavi_options['num_larger_page_numbers'] = intval(trim($_POST['pagenavi_num_larger_page_numbers']));
|
44 |
+
$pagenavi_options['larger_page_numbers_multiple'] = intval(trim($_POST['pagenavi_larger_page_numbers_multiple']));
|
45 |
$update_pagenavi_queries = array();
|
46 |
$update_pagenavi_text = array();
|
47 |
$update_pagenavi_queries[] = update_option('pagenavi_options', $pagenavi_options);
|
104 |
$pagenavi_options = get_option('pagenavi_options');
|
105 |
?>
|
106 |
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
107 |
+
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
|
108 |
<div class="wrap">
|
109 |
<?php screen_icon(); ?>
|
110 |
<h2><?php _e('Page Navigation Options', 'wp-pagenavi'); ?></h2>
|
167 |
<tr>
|
168 |
<th scope="row" valign="top"><?php _e('Text For Previous ...', 'wp-pagenavi'); ?></th>
|
169 |
<td>
|
170 |
+
<input type="text" name="pagenavi_dotleft_text" value="<?php echo stripslashes(htmlspecialchars($pagenavi_options['dotleft_text'])); ?>" size="30" />
|
171 |
</td>
|
172 |
</tr>
|
173 |
</table>
|
197 |
</select>
|
198 |
</td>
|
199 |
</tr>
|
200 |
+
<tr>
|
201 |
+
<th scope="row" valign="top"><?php _e('Number Of Larger Page Numbers To Show?', 'wp-pagenavi'); ?></th>
|
202 |
+
<td>
|
203 |
+
<input type="text" name="pagenavi_num_larger_page_numbers" value="<?php echo stripslashes($pagenavi_options['num_larger_page_numbers']); ?>" size="4" />
|
204 |
+
<br />
|
205 |
+
<?php _e('Larger page numbers are in additional to the default page numbers. It is useful for authors who is paginating through many posts.', 'wp-pagenavi'); ?>
|
206 |
+
<br />
|
207 |
+
<?php _e('For example, WP-PageNavi will display: Pages 1, 2, 3, 4, 5, 10, 20, 30, 40, 50', 'wp-pagenavi'); ?>
|
208 |
+
<br />
|
209 |
+
<?php _e('Enter 0 to disable.', 'wp-pagenavi'); ?>
|
210 |
+
</td>
|
211 |
+
</tr>
|
212 |
+
<tr>
|
213 |
+
<th scope="row" valign="top"><?php _e('Show Larger Page Numbers In Multiples Of:', 'wp-pagenavi'); ?></th>
|
214 |
+
<td>
|
215 |
+
<input type="text" name="pagenavi_larger_page_numbers_multiple" value="<?php echo stripslashes($pagenavi_options['larger_page_numbers_multiple']); ?>" size="4" />
|
216 |
+
<br />
|
217 |
+
<?php _e('If mutiple is in 5, it will show: 5, 10, 15, 20, 25', 'wp-pagenavi'); ?>
|
218 |
+
<br />
|
219 |
+
<?php _e('If mutiple is in 10, it will show: 10, 20, 30, 40, 50', 'wp-pagenavi'); ?>
|
220 |
+
</td>
|
221 |
+
</tr>
|
222 |
</table>
|
223 |
<p class="submit">
|
224 |
<input type="submit" name="Submit" class="button" value="<?php _e('Save Changes', 'wp-pagenavi'); ?>" />
|
228 |
<p> </p>
|
229 |
|
230 |
<!-- Uninstall WP-PageNavi -->
|
231 |
+
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
|
232 |
<div class="wrap">
|
233 |
<h3><?php _e('Uninstall WP-PageNavi', 'wp-pagenavi'); ?></h3>
|
234 |
<p>
|
readme.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
3 |
<head>
|
4 |
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
5 |
-
<title>WP-PageNavi 2.
|
6 |
<style type="text/css" media="screen">
|
7 |
/* Default Style */
|
8 |
BODY {
|
@@ -203,7 +203,7 @@
|
|
203 |
<body>
|
204 |
<div id="Container">
|
205 |
<!-- Title -->
|
206 |
-
<div id="Title">WP-PageNavi 2.
|
207 |
|
208 |
<!-- Tabs -->
|
209 |
<ul id="Tabs">
|
@@ -234,6 +234,7 @@
|
|
234 |
</p>
|
235 |
<p>
|
236 |
<strong>Download:</strong><br />
|
|
|
237 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-pagenavi.2.40.zip" title="http://downloads.wordpress.org/plugin/wp-pagenavi.2.40.zip">WP-PageNavi 2.40 For WordPress 2.7.x</a><br />
|
238 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-pagenavi.2.31.zip" title="http://downloads.wordpress.org/plugin/wp-pagenavi.2.31.zip">WP-PageNavi 2.31 For WordPress 2.1.x To WordPress 2.6.x</a><br />
|
239 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-pagenavi.2.03.zip" title="http://downloads.wordpress.org/plugin/wp-pagenavi.2.03.zip">WP-PageNavi 2.03 For WordPress 2.0.x</a><br />
|
@@ -281,6 +282,16 @@
|
|
281 |
<div id="Changelog" style="display: none;">
|
282 |
<div class="SubTitle">» Changelog</div>
|
283 |
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
<li>
|
285 |
<strong>Version 2.40 (12-12-2008)</strong>
|
286 |
<ul>
|
@@ -380,7 +391,7 @@
|
|
380 |
<!-- Upgrade Instructions -->
|
381 |
<div id="Upgrade" style="display: none;">
|
382 |
<div class="SubTitle">» Upgrade Instructions</div>
|
383 |
-
<div class="SubSubTitle">From v2.0x To v2.
|
384 |
<ol>
|
385 |
<li>
|
386 |
<strong>Deactivate</strong> WP-PageNavi Plugin
|
@@ -444,6 +455,6 @@
|
|
444 |
</div>
|
445 |
</div>
|
446 |
</div>
|
447 |
-
<p id="Copyright">WP-PageNavi 2.
|
448 |
</body>
|
449 |
</html>
|
2 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
3 |
<head>
|
4 |
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
5 |
+
<title>WP-PageNavi 2.50 Readme</title>
|
6 |
<style type="text/css" media="screen">
|
7 |
/* Default Style */
|
8 |
BODY {
|
203 |
<body>
|
204 |
<div id="Container">
|
205 |
<!-- Title -->
|
206 |
+
<div id="Title">WP-PageNavi 2.50 <span style="color: #aaaaaa;">Readme</span></div>
|
207 |
|
208 |
<!-- Tabs -->
|
209 |
<ul id="Tabs">
|
234 |
</p>
|
235 |
<p>
|
236 |
<strong>Download:</strong><br />
|
237 |
+
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-pagenavi.2.50.zip" title="http://downloads.wordpress.org/plugin/wp-pagenavi.2.50.zip">WP-PageNavi 2.50 For WordPress 2.8.x</a><br />
|
238 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-pagenavi.2.40.zip" title="http://downloads.wordpress.org/plugin/wp-pagenavi.2.40.zip">WP-PageNavi 2.40 For WordPress 2.7.x</a><br />
|
239 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-pagenavi.2.31.zip" title="http://downloads.wordpress.org/plugin/wp-pagenavi.2.31.zip">WP-PageNavi 2.31 For WordPress 2.1.x To WordPress 2.6.x</a><br />
|
240 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-pagenavi.2.03.zip" title="http://downloads.wordpress.org/plugin/wp-pagenavi.2.03.zip">WP-PageNavi 2.03 For WordPress 2.0.x</a><br />
|
282 |
<div id="Changelog" style="display: none;">
|
283 |
<div class="SubTitle">» Changelog</div>
|
284 |
<ul>
|
285 |
+
<li>
|
286 |
+
<strong>Version 2.50 (01-06-2009)</strong>
|
287 |
+
<ul>
|
288 |
+
<li>NEW: Works For WordPress 2.8</li>
|
289 |
+
<li>NEW: Added Larger Page Number Pagination</li>
|
290 |
+
<li>NEW: Added "first", "page" and "last" CSS Name To Link<li>
|
291 |
+
<li>FIXED: Removed "&#8201;" Entity</li>
|
292 |
+
<li>FIXED: Uses $_SERVER['PHP_SELF'] With plugin_basename(__FILE__) Instead Of Just $_SERVER['REQUEST_URI']</li>
|
293 |
+
</ul>
|
294 |
+
</li>
|
295 |
<li>
|
296 |
<strong>Version 2.40 (12-12-2008)</strong>
|
297 |
<ul>
|
391 |
<!-- Upgrade Instructions -->
|
392 |
<div id="Upgrade" style="display: none;">
|
393 |
<div class="SubTitle">» Upgrade Instructions</div>
|
394 |
+
<div class="SubSubTitle">From v2.0x To v2.50</div>
|
395 |
<ol>
|
396 |
<li>
|
397 |
<strong>Deactivate</strong> WP-PageNavi Plugin
|
455 |
</div>
|
456 |
</div>
|
457 |
</div>
|
458 |
+
<p id="Copyright">WP-PageNavi 2.50<br />Copyright © 2009 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
|
459 |
</body>
|
460 |
</html>
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: GamerZ
|
3 |
Donate link: http://lesterchan.net/wordpress
|
4 |
Tags: pagenavi, navi, navigation, wp-pagenavi, page
|
5 |
-
Requires at least: 2.
|
6 |
-
Stable tag: 2.
|
7 |
|
8 |
Adds a more advanced paging navigation your WordPress blog.
|
9 |
|
2 |
Contributors: GamerZ
|
3 |
Donate link: http://lesterchan.net/wordpress
|
4 |
Tags: pagenavi, navi, navigation, wp-pagenavi, page
|
5 |
+
Requires at least: 2.8
|
6 |
+
Stable tag: 2.50
|
7 |
|
8 |
Adds a more advanced paging navigation your WordPress blog.
|
9 |
|
wp-pagenavi.mo
CHANGED
Binary file
|
wp-pagenavi.php
CHANGED
@@ -3,14 +3,14 @@
|
|
3 |
Plugin Name: WP-PageNavi
|
4 |
Plugin URI: http://lesterchan.net/portfolio/programming/php/
|
5 |
Description: Adds a more advanced paging navigation to your WordPress blog.
|
6 |
-
Version: 2.
|
7 |
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: http://lesterchan.net
|
9 |
*/
|
10 |
|
11 |
|
12 |
/*
|
13 |
-
Copyright
|
14 |
|
15 |
This program is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License as published by
|
@@ -44,16 +44,14 @@ function pagenavi_menu() {
|
|
44 |
}
|
45 |
|
46 |
|
47 |
-
### Function:
|
48 |
-
add_action('
|
49 |
-
function
|
50 |
-
echo "\n".'<!-- Start Of Script Generated By WP-PageNavi 2.40 -->'."\n";
|
51 |
if(@file_exists(TEMPLATEPATH.'/pagenavi-css.css')) {
|
52 |
-
|
53 |
} else {
|
54 |
-
|
55 |
}
|
56 |
-
echo '<!-- End Of Script Generated By WP-PageNavi 2.40 -->'."\n";
|
57 |
}
|
58 |
|
59 |
|
@@ -67,25 +65,13 @@ function wp_pagenavi($before = '', $after = '') {
|
|
67 |
$pagenavi_options = get_option('pagenavi_options');
|
68 |
$numposts = $wp_query->found_posts;
|
69 |
$max_page = $wp_query->max_num_pages;
|
70 |
-
/*
|
71 |
-
$numposts = 0;
|
72 |
-
if(strpos(get_query_var('tag'), " ")) {
|
73 |
-
preg_match('#^(.*)\sLIMIT#siU', $request, $matches);
|
74 |
-
$fromwhere = $matches[1];
|
75 |
-
$results = $wpdb->get_results($fromwhere);
|
76 |
-
$numposts = count($results);
|
77 |
-
} else {
|
78 |
-
preg_match('#FROM\s*+(.+?)\s+(GROUP BY|ORDER BY)#si', $request, $matches);
|
79 |
-
$fromwhere = $matches[1];
|
80 |
-
$numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere");
|
81 |
-
}
|
82 |
-
$max_page = ceil($numposts/$posts_per_page);
|
83 |
-
*/
|
84 |
if(empty($paged) || $paged == 0) {
|
85 |
$paged = 1;
|
86 |
}
|
87 |
$pages_to_show = intval($pagenavi_options['num_pages']);
|
88 |
-
$
|
|
|
|
|
89 |
$half_page_start = floor($pages_to_show_minus_1/2);
|
90 |
$half_page_end = ceil($pages_to_show_minus_1/2);
|
91 |
$start_page = $paged - $half_page_start;
|
@@ -103,6 +89,24 @@ function wp_pagenavi($before = '', $after = '') {
|
|
103 |
if($start_page <= 0) {
|
104 |
$start_page = 1;
|
105 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
if($max_page > 1 || intval($pagenavi_options['always_show']) == 1) {
|
107 |
$pages_text = str_replace("%CURRENT_PAGE%", number_format_i18n($paged), $pagenavi_options['pages_text']);
|
108 |
$pages_text = str_replace("%TOTAL_PAGES%", number_format_i18n($max_page), $pages_text);
|
@@ -110,32 +114,44 @@ function wp_pagenavi($before = '', $after = '') {
|
|
110 |
switch(intval($pagenavi_options['style'])) {
|
111 |
case 1:
|
112 |
if(!empty($pages_text)) {
|
113 |
-
echo '<span class="pages"
|
114 |
-
}
|
115 |
if ($start_page >= 2 && $pages_to_show < $max_page) {
|
116 |
$first_page_text = str_replace("%TOTAL_PAGES%", number_format_i18n($max_page), $pagenavi_options['first_text']);
|
117 |
-
echo '<a href="'.clean_url(get_pagenum_link()).'" title="'.$first_page_text.'"
|
118 |
if(!empty($pagenavi_options['dotleft_text'])) {
|
119 |
-
echo '<span class="extend"
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
}
|
121 |
}
|
122 |
previous_posts_link($pagenavi_options['prev_text']);
|
123 |
for($i = $start_page; $i <= $end_page; $i++) {
|
124 |
if($i == $paged) {
|
125 |
$current_page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['current_text']);
|
126 |
-
echo '<span class="current"
|
127 |
} else {
|
128 |
$page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['page_text']);
|
129 |
-
echo '<a href="'.clean_url(get_pagenum_link($i)).'" title="'.$page_text.'"
|
130 |
}
|
131 |
}
|
132 |
next_posts_link($pagenavi_options['next_text'], $max_page);
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
if ($end_page < $max_page) {
|
134 |
if(!empty($pagenavi_options['dotright_text'])) {
|
135 |
-
echo '<span class="extend"
|
136 |
}
|
137 |
$last_page_text = str_replace("%TOTAL_PAGES%", number_format_i18n($max_page), $pagenavi_options['last_text']);
|
138 |
-
echo '<a href="'.clean_url(get_pagenum_link($max_page)).'" title="'.$last_page_text.'"
|
139 |
}
|
140 |
break;
|
141 |
case 2;
|
@@ -170,6 +186,12 @@ function wp_pagenavi_dropdown() {
|
|
170 |
}
|
171 |
|
172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
### Function: Page Navigation Options
|
174 |
add_action('activate_wp-pagenavi/wp-pagenavi.php', 'pagenavi_init');
|
175 |
function pagenavi_init() {
|
@@ -188,6 +210,8 @@ function pagenavi_init() {
|
|
188 |
$pagenavi_options['style'] = 1;
|
189 |
$pagenavi_options['num_pages'] = 5;
|
190 |
$pagenavi_options['always_show'] = 0;
|
|
|
|
|
191 |
add_option('pagenavi_options', $pagenavi_options, 'PageNavi Options');
|
192 |
}
|
193 |
?>
|
3 |
Plugin Name: WP-PageNavi
|
4 |
Plugin URI: http://lesterchan.net/portfolio/programming/php/
|
5 |
Description: Adds a more advanced paging navigation to your WordPress blog.
|
6 |
+
Version: 2.50
|
7 |
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: http://lesterchan.net
|
9 |
*/
|
10 |
|
11 |
|
12 |
/*
|
13 |
+
Copyright 2009 Lester Chan (email : lesterchan@gmail.com)
|
14 |
|
15 |
This program is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License as published by
|
44 |
}
|
45 |
|
46 |
|
47 |
+
### Function: Enqueue PageNavi Stylesheets
|
48 |
+
add_action('wp_print_styles', 'pagenavi_stylesheets');
|
49 |
+
function pagenavi_stylesheets() {
|
|
|
50 |
if(@file_exists(TEMPLATEPATH.'/pagenavi-css.css')) {
|
51 |
+
wp_enqueue_style('wp-pagenavi', get_stylesheet_directory_uri().'/pagenavi-css.css', false, '2.50', 'all');
|
52 |
} else {
|
53 |
+
wp_enqueue_style('wp-pagenavi', plugins_url('wp-pagenavi/pagenavi-css.css'), false, '2.50', 'all');
|
54 |
}
|
|
|
55 |
}
|
56 |
|
57 |
|
65 |
$pagenavi_options = get_option('pagenavi_options');
|
66 |
$numposts = $wp_query->found_posts;
|
67 |
$max_page = $wp_query->max_num_pages;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
if(empty($paged) || $paged == 0) {
|
69 |
$paged = 1;
|
70 |
}
|
71 |
$pages_to_show = intval($pagenavi_options['num_pages']);
|
72 |
+
$larger_page_to_show = intval($pagenavi_options['num_larger_page_numbers']);
|
73 |
+
$larger_page_multiple = intval($pagenavi_options['larger_page_numbers_multiple']);
|
74 |
+
$pages_to_show_minus_1 = $pages_to_show - 1;
|
75 |
$half_page_start = floor($pages_to_show_minus_1/2);
|
76 |
$half_page_end = ceil($pages_to_show_minus_1/2);
|
77 |
$start_page = $paged - $half_page_start;
|
89 |
if($start_page <= 0) {
|
90 |
$start_page = 1;
|
91 |
}
|
92 |
+
$larger_per_page = $larger_page_to_show*$larger_page_multiple;
|
93 |
+
$larger_start_page_start = (n_round($start_page, 10) + $larger_page_multiple) - $larger_per_page;
|
94 |
+
$larger_start_page_end = n_round($start_page, 10) + $larger_page_multiple;
|
95 |
+
$larger_end_page_start = n_round($end_page, 10) + $larger_page_multiple;
|
96 |
+
$larger_end_page_end = n_round($end_page, 10) + ($larger_per_page);
|
97 |
+
if($larger_start_page_end - $larger_page_multiple == $start_page) {
|
98 |
+
$larger_start_page_start = $larger_start_page_start - $larger_page_multiple;
|
99 |
+
$larger_start_page_end = $larger_start_page_end - $larger_page_multiple;
|
100 |
+
}
|
101 |
+
if($larger_start_page_start <= 0) {
|
102 |
+
$larger_start_page_start = $larger_page_multiple;
|
103 |
+
}
|
104 |
+
if($larger_start_page_end > $max_page) {
|
105 |
+
$larger_start_page_end = $max_page;
|
106 |
+
}
|
107 |
+
if($larger_end_page_end > $max_page) {
|
108 |
+
$larger_end_page_end = $max_page;
|
109 |
+
}
|
110 |
if($max_page > 1 || intval($pagenavi_options['always_show']) == 1) {
|
111 |
$pages_text = str_replace("%CURRENT_PAGE%", number_format_i18n($paged), $pagenavi_options['pages_text']);
|
112 |
$pages_text = str_replace("%TOTAL_PAGES%", number_format_i18n($max_page), $pages_text);
|
114 |
switch(intval($pagenavi_options['style'])) {
|
115 |
case 1:
|
116 |
if(!empty($pages_text)) {
|
117 |
+
echo '<span class="pages">'.$pages_text.'</span>';
|
118 |
+
}
|
119 |
if ($start_page >= 2 && $pages_to_show < $max_page) {
|
120 |
$first_page_text = str_replace("%TOTAL_PAGES%", number_format_i18n($max_page), $pagenavi_options['first_text']);
|
121 |
+
echo '<a href="'.clean_url(get_pagenum_link()).'" class="first" title="'.$first_page_text.'">'.$first_page_text.'</a>';
|
122 |
if(!empty($pagenavi_options['dotleft_text'])) {
|
123 |
+
echo '<span class="extend">'.$pagenavi_options['dotleft_text'].'</span>';
|
124 |
+
}
|
125 |
+
}
|
126 |
+
if($larger_page_to_show > 0 && $larger_start_page_start > 0 && $larger_start_page_end <= $max_page) {
|
127 |
+
for($i = $larger_start_page_start; $i < $larger_start_page_end; $i+=$larger_page_multiple) {
|
128 |
+
$page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['page_text']);
|
129 |
+
echo '<a href="'.clean_url(get_pagenum_link($i)).'" class="page" title="'.$page_text.'">'.$page_text.'</a>';
|
130 |
}
|
131 |
}
|
132 |
previous_posts_link($pagenavi_options['prev_text']);
|
133 |
for($i = $start_page; $i <= $end_page; $i++) {
|
134 |
if($i == $paged) {
|
135 |
$current_page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['current_text']);
|
136 |
+
echo '<span class="current">'.$current_page_text.'</span>';
|
137 |
} else {
|
138 |
$page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['page_text']);
|
139 |
+
echo '<a href="'.clean_url(get_pagenum_link($i)).'" class="page" title="'.$page_text.'">'.$page_text.'</a>';
|
140 |
}
|
141 |
}
|
142 |
next_posts_link($pagenavi_options['next_text'], $max_page);
|
143 |
+
if($larger_page_to_show > 0 && $larger_end_page_start < $max_page) {
|
144 |
+
for($i = $larger_end_page_start; $i <= $larger_end_page_end; $i+=$larger_page_multiple) {
|
145 |
+
$page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['page_text']);
|
146 |
+
echo '<a href="'.clean_url(get_pagenum_link($i)).'" class="page" title="'.$page_text.'">'.$page_text.'</a>';
|
147 |
+
}
|
148 |
+
}
|
149 |
if ($end_page < $max_page) {
|
150 |
if(!empty($pagenavi_options['dotright_text'])) {
|
151 |
+
echo '<span class="extend">'.$pagenavi_options['dotright_text'].'</span>';
|
152 |
}
|
153 |
$last_page_text = str_replace("%TOTAL_PAGES%", number_format_i18n($max_page), $pagenavi_options['last_text']);
|
154 |
+
echo '<a href="'.clean_url(get_pagenum_link($max_page)).'" class="last" title="'.$last_page_text.'">'.$last_page_text.'</a>';
|
155 |
}
|
156 |
break;
|
157 |
case 2;
|
186 |
}
|
187 |
|
188 |
|
189 |
+
### Function: Round To The Nearest Value
|
190 |
+
function n_round($num, $tonearest) {
|
191 |
+
return floor($num/$tonearest)*$tonearest;
|
192 |
+
}
|
193 |
+
|
194 |
+
|
195 |
### Function: Page Navigation Options
|
196 |
add_action('activate_wp-pagenavi/wp-pagenavi.php', 'pagenavi_init');
|
197 |
function pagenavi_init() {
|
210 |
$pagenavi_options['style'] = 1;
|
211 |
$pagenavi_options['num_pages'] = 5;
|
212 |
$pagenavi_options['always_show'] = 0;
|
213 |
+
$pagenavi_options['num_larger_page_numbers'] = 3;
|
214 |
+
$pagenavi_options['larger_page_numbers_multiple'] = 10;
|
215 |
add_option('pagenavi_options', $pagenavi_options, 'PageNavi Options');
|
216 |
}
|
217 |
?>
|
wp-pagenavi.pot
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: WP-PageNavi 2.
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date:
|
6 |
-
"PO-Revision-Date:
|
7 |
"Last-Translator: Lester Chan <lesterchan@gmail.com>\n"
|
8 |
"Language-Team: Lester Chan <lesterchan@gmail.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
@@ -16,154 +16,182 @@ msgstr ""
|
|
16 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
17 |
"X-Poedit-SearchPath-0: .\n"
|
18 |
|
19 |
-
#: pagenavi-options.php:
|
20 |
-
#: pagenavi-options.php:
|
21 |
-
#: pagenavi-options.php:
|
22 |
msgid "Page Navigation Options"
|
23 |
msgstr ""
|
24 |
|
25 |
-
#: pagenavi-options.php:
|
26 |
msgid "Updated"
|
27 |
msgstr ""
|
28 |
|
29 |
-
#: pagenavi-options.php:
|
30 |
msgid "No Page Navigation Option Updated"
|
31 |
msgstr ""
|
32 |
|
33 |
-
#: pagenavi-options.php:
|
34 |
-
#: pagenavi-options.php:
|
35 |
msgid "UNINSTALL WP-PageNavi"
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: pagenavi-options.php:
|
39 |
#, php-format
|
40 |
msgid "Setting Key '%s' has been deleted."
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: pagenavi-options.php:
|
44 |
#, php-format
|
45 |
msgid "Error deleting Setting Key '%s'."
|
46 |
msgstr ""
|
47 |
|
48 |
-
#: pagenavi-options.php:
|
49 |
-
#: pagenavi-options.php:
|
50 |
msgid "Uninstall WP-PageNavi"
|
51 |
msgstr ""
|
52 |
|
53 |
-
#: pagenavi-options.php:
|
54 |
#, php-format
|
55 |
msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-PageNavi Will Be Deactivated Automatically."
|
56 |
msgstr ""
|
57 |
|
58 |
-
#: pagenavi-options.php:
|
59 |
msgid "Page Navigation Text"
|
60 |
msgstr ""
|
61 |
|
62 |
-
#: pagenavi-options.php:
|
63 |
msgid "Text For Number Of Pages"
|
64 |
msgstr ""
|
65 |
|
66 |
-
#: pagenavi-options.php:
|
67 |
msgid "The current page number."
|
68 |
msgstr ""
|
69 |
|
70 |
-
#: pagenavi-options.php:
|
71 |
-
#: pagenavi-options.php:
|
72 |
-
#: pagenavi-options.php:
|
73 |
msgid "The total number of pages."
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: pagenavi-options.php:
|
77 |
msgid "Text For Current Page"
|
78 |
msgstr ""
|
79 |
|
80 |
-
#: pagenavi-options.php:
|
81 |
-
#: pagenavi-options.php:
|
82 |
msgid "The page number."
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: pagenavi-options.php:
|
86 |
msgid "Text For Page"
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: pagenavi-options.php:
|
90 |
msgid "Text For First Post"
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: pagenavi-options.php:
|
94 |
msgid "Text For Last Post"
|
95 |
msgstr ""
|
96 |
|
97 |
-
#: pagenavi-options.php:
|
98 |
msgid "Text For Next Post"
|
99 |
msgstr ""
|
100 |
|
101 |
-
#: pagenavi-options.php:
|
102 |
msgid "Text For Previous Post"
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: pagenavi-options.php:
|
106 |
msgid "Text For Next ..."
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: pagenavi-options.php:
|
110 |
msgid "Text For Previous ..."
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: pagenavi-options.php:
|
114 |
msgid "Page Navigation Style"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: pagenavi-options.php:
|
118 |
msgid "Normal"
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: pagenavi-options.php:
|
122 |
msgid "Drop Down List"
|
123 |
msgstr ""
|
124 |
|
125 |
-
#: pagenavi-options.php:
|
126 |
msgid "Number Of Pages To Show?"
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: pagenavi-options.php:
|
130 |
msgid "Always Show Page Navigation?"
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: pagenavi-options.php:
|
134 |
-
#: pagenavi-options.php:
|
135 |
msgid "Yes"
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: pagenavi-options.php:
|
139 |
msgid "No"
|
140 |
msgstr ""
|
141 |
|
142 |
-
#: pagenavi-options.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
msgid "Save Changes"
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: pagenavi-options.php:
|
147 |
msgid "Deactivating WP-PageNavi plugin does not remove any data that may have been created, such as the page navigation options. To completely remove this plugin, you can uninstall it here."
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: pagenavi-options.php:
|
151 |
msgid "WARNING:"
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: pagenavi-options.php:
|
155 |
msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first."
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: pagenavi-options.php:
|
159 |
msgid "The following WordPress Options will be DELETED:"
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: pagenavi-options.php:
|
163 |
msgid "WordPress Options"
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: pagenavi-options.php:
|
167 |
msgid ""
|
168 |
"You Are About To Uninstall WP-PageNavi From WordPress.\\n"
|
169 |
"This Action Is Not Reversible.\\n"
|
@@ -175,28 +203,28 @@ msgstr ""
|
|
175 |
msgid "PageNavi"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: wp-pagenavi.php:
|
179 |
msgid "Page %CURRENT_PAGE% of %TOTAL_PAGES%"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: wp-pagenavi.php:
|
183 |
msgid "« First"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: wp-pagenavi.php:
|
187 |
msgid "Last »"
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: wp-pagenavi.php:
|
191 |
msgid "»"
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: wp-pagenavi.php:
|
195 |
msgid "«"
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: wp-pagenavi.php:
|
199 |
-
#: wp-pagenavi.php:
|
200 |
msgid "..."
|
201 |
msgstr ""
|
202 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: WP-PageNavi 2.50\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2009-06-08 18:58+0800\n"
|
6 |
+
"PO-Revision-Date: 2009-06-08 18:59+0800\n"
|
7 |
"Last-Translator: Lester Chan <lesterchan@gmail.com>\n"
|
8 |
"Language-Team: Lester Chan <lesterchan@gmail.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
16 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
17 |
"X-Poedit-SearchPath-0: .\n"
|
18 |
|
19 |
+
#: pagenavi-options.php:48
|
20 |
+
#: pagenavi-options.php:110
|
21 |
+
#: pagenavi-options.php:174
|
22 |
msgid "Page Navigation Options"
|
23 |
msgstr ""
|
24 |
|
25 |
+
#: pagenavi-options.php:53
|
26 |
msgid "Updated"
|
27 |
msgstr ""
|
28 |
|
29 |
+
#: pagenavi-options.php:58
|
30 |
msgid "No Page Navigation Option Updated"
|
31 |
msgstr ""
|
32 |
|
33 |
+
#: pagenavi-options.php:64
|
34 |
+
#: pagenavi-options.php:265
|
35 |
msgid "UNINSTALL WP-PageNavi"
|
36 |
msgstr ""
|
37 |
|
38 |
+
#: pagenavi-options.php:72
|
39 |
#, php-format
|
40 |
msgid "Setting Key '%s' has been deleted."
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: pagenavi-options.php:76
|
44 |
#, php-format
|
45 |
msgid "Error deleting Setting Key '%s'."
|
46 |
msgstr ""
|
47 |
|
48 |
+
#: pagenavi-options.php:98
|
49 |
+
#: pagenavi-options.php:233
|
50 |
msgid "Uninstall WP-PageNavi"
|
51 |
msgstr ""
|
52 |
|
53 |
+
#: pagenavi-options.php:99
|
54 |
#, php-format
|
55 |
msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-PageNavi Will Be Deactivated Automatically."
|
56 |
msgstr ""
|
57 |
|
58 |
+
#: pagenavi-options.php:111
|
59 |
msgid "Page Navigation Text"
|
60 |
msgstr ""
|
61 |
|
62 |
+
#: pagenavi-options.php:114
|
63 |
msgid "Text For Number Of Pages"
|
64 |
msgstr ""
|
65 |
|
66 |
+
#: pagenavi-options.php:117
|
67 |
msgid "The current page number."
|
68 |
msgstr ""
|
69 |
|
70 |
+
#: pagenavi-options.php:118
|
71 |
+
#: pagenavi-options.php:139
|
72 |
+
#: pagenavi-options.php:146
|
73 |
msgid "The total number of pages."
|
74 |
msgstr ""
|
75 |
|
76 |
+
#: pagenavi-options.php:122
|
77 |
msgid "Text For Current Page"
|
78 |
msgstr ""
|
79 |
|
80 |
+
#: pagenavi-options.php:125
|
81 |
+
#: pagenavi-options.php:132
|
82 |
msgid "The page number."
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: pagenavi-options.php:129
|
86 |
msgid "Text For Page"
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: pagenavi-options.php:136
|
90 |
msgid "Text For First Post"
|
91 |
msgstr ""
|
92 |
|
93 |
+
#: pagenavi-options.php:143
|
94 |
msgid "Text For Last Post"
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: pagenavi-options.php:150
|
98 |
msgid "Text For Next Post"
|
99 |
msgstr ""
|
100 |
|
101 |
+
#: pagenavi-options.php:156
|
102 |
msgid "Text For Previous Post"
|
103 |
msgstr ""
|
104 |
|
105 |
+
#: pagenavi-options.php:162
|
106 |
msgid "Text For Next ..."
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: pagenavi-options.php:168
|
110 |
msgid "Text For Previous ..."
|
111 |
msgstr ""
|
112 |
|
113 |
+
#: pagenavi-options.php:177
|
114 |
msgid "Page Navigation Style"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: pagenavi-options.php:180
|
118 |
msgid "Normal"
|
119 |
msgstr ""
|
120 |
|
121 |
+
#: pagenavi-options.php:181
|
122 |
msgid "Drop Down List"
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: pagenavi-options.php:186
|
126 |
msgid "Number Of Pages To Show?"
|
127 |
msgstr ""
|
128 |
|
129 |
+
#: pagenavi-options.php:192
|
130 |
msgid "Always Show Page Navigation?"
|
131 |
msgstr ""
|
132 |
|
133 |
+
#: pagenavi-options.php:195
|
134 |
+
#: pagenavi-options.php:264
|
135 |
msgid "Yes"
|
136 |
msgstr ""
|
137 |
|
138 |
+
#: pagenavi-options.php:196
|
139 |
msgid "No"
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: pagenavi-options.php:201
|
143 |
+
msgid "Number Of Larger Page Numbers To Show?"
|
144 |
+
msgstr ""
|
145 |
+
|
146 |
+
#: pagenavi-options.php:205
|
147 |
+
msgid "Larger page numbers are in additional to the default page numbers. It is useful for authors who is paginating through many posts."
|
148 |
+
msgstr ""
|
149 |
+
|
150 |
+
#: pagenavi-options.php:207
|
151 |
+
msgid "For example, WP-PageNavi will display: Pages 1, 2, 3, 4, 5, 10, 20, 30, 40, 50"
|
152 |
+
msgstr ""
|
153 |
+
|
154 |
+
#: pagenavi-options.php:209
|
155 |
+
msgid "Enter 0 to disable."
|
156 |
+
msgstr ""
|
157 |
+
|
158 |
+
#: pagenavi-options.php:213
|
159 |
+
msgid "Show Larger Page Numbers In Multiples Of:"
|
160 |
+
msgstr ""
|
161 |
+
|
162 |
+
#: pagenavi-options.php:217
|
163 |
+
msgid "If mutiple is in 5, it will show: 5, 10, 15, 20, 25"
|
164 |
+
msgstr ""
|
165 |
+
|
166 |
+
#: pagenavi-options.php:219
|
167 |
+
msgid "If mutiple is in 10, it will show: 10, 20, 30, 40, 50"
|
168 |
+
msgstr ""
|
169 |
+
|
170 |
+
#: pagenavi-options.php:224
|
171 |
msgid "Save Changes"
|
172 |
msgstr ""
|
173 |
|
174 |
+
#: pagenavi-options.php:235
|
175 |
msgid "Deactivating WP-PageNavi plugin does not remove any data that may have been created, such as the page navigation options. To completely remove this plugin, you can uninstall it here."
|
176 |
msgstr ""
|
177 |
|
178 |
+
#: pagenavi-options.php:238
|
179 |
msgid "WARNING:"
|
180 |
msgstr ""
|
181 |
|
182 |
+
#: pagenavi-options.php:239
|
183 |
msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first."
|
184 |
msgstr ""
|
185 |
|
186 |
+
#: pagenavi-options.php:242
|
187 |
msgid "The following WordPress Options will be DELETED:"
|
188 |
msgstr ""
|
189 |
|
190 |
+
#: pagenavi-options.php:247
|
191 |
msgid "WordPress Options"
|
192 |
msgstr ""
|
193 |
|
194 |
+
#: pagenavi-options.php:265
|
195 |
msgid ""
|
196 |
"You Are About To Uninstall WP-PageNavi From WordPress.\\n"
|
197 |
"This Action Is Not Reversible.\\n"
|
203 |
msgid "PageNavi"
|
204 |
msgstr ""
|
205 |
|
206 |
+
#: wp-pagenavi.php:201
|
207 |
msgid "Page %CURRENT_PAGE% of %TOTAL_PAGES%"
|
208 |
msgstr ""
|
209 |
|
210 |
+
#: wp-pagenavi.php:204
|
211 |
msgid "« First"
|
212 |
msgstr ""
|
213 |
|
214 |
+
#: wp-pagenavi.php:205
|
215 |
msgid "Last »"
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: wp-pagenavi.php:206
|
219 |
msgid "»"
|
220 |
msgstr ""
|
221 |
|
222 |
+
#: wp-pagenavi.php:207
|
223 |
msgid "«"
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: wp-pagenavi.php:208
|
227 |
+
#: wp-pagenavi.php:209
|
228 |
msgid "..."
|
229 |
msgstr ""
|
230 |
|