Version Description
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-PostViews |
Version | 1.31 |
Comparing to | |
See all releases |
Code changes from version 1.30 to 1.31
- postviews-options.php +1 -1
- readme.html +31 -7
- readme.txt +1 -1
- wp-postviews-widget.php +4 -4
- wp-postviews.mo +0 -0
- wp-postviews.php +55 -19
- wp-postviews.pot +38 -29
postviews-options.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
-
| WordPress 2.5 Plugin: WP-PostViews 1.
|
6 |
| Copyright (c) 2008 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
+
| WordPress 2.5 Plugin: WP-PostViews 1.31 |
|
6 |
| Copyright (c) 2008 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
readme.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<html>
|
3 |
<head>
|
4 |
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
5 |
-
<title>WP-PostViews 1.
|
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-PostViews 1.
|
207 |
|
208 |
<!-- Tabs -->
|
209 |
<ul id="Tabs">
|
@@ -234,7 +234,7 @@
|
|
234 |
</p>
|
235 |
<p>
|
236 |
<strong>Download:</strong><br />
|
237 |
-
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-postviews.1.
|
238 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-postviews.1.11.zip" title="http://downloads.wordpress.org/plugin/wp-postviews.1.11.zip">WP-PostViews 1.11 For WordPress 2.1.x And 2.2.x</a><br />
|
239 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-postviews.1.02.zip" title="http://downloads.wordpress.org/plugin/wp-postviews.1.02.zip">WP-PostViews 1.02 For WordPress 2.0.x</a><br />
|
240 |
</p>
|
@@ -259,7 +259,8 @@
|
|
259 |
</p>
|
260 |
<p>
|
261 |
<strong>Credits:</strong><br />
|
262 |
-
<strong>»</strong> WP-Cache/WP-SuperCache Compatibility By <a href="http://omninoggin.com/">Thaya Kareeson</a
|
|
|
263 |
</p>
|
264 |
<p>
|
265 |
<strong>Note:</strong><br />
|
@@ -280,7 +281,16 @@
|
|
280 |
<div id="Changelog" style="display: none;">
|
281 |
<div class="SubTitle">» Changelog</div>
|
282 |
<ul>
|
283 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
<strong>Version 1.30 (01-06-2008)</strong>
|
285 |
<ul>
|
286 |
<li>NEW: Uses /wp-postviews/ Folder Instead Of /postviews/</li>
|
@@ -362,7 +372,7 @@
|
|
362 |
<!-- Upgrade Instructions -->
|
363 |
<div id="Upgrade" style="display: none;">
|
364 |
<div class="SubTitle">» Upgrade Instructions</div>
|
365 |
-
<div class="SubSubTitle">From v1.0x To v1.
|
366 |
<ol>
|
367 |
<li>
|
368 |
<strong>Deactivate</strong> WP-PostViews Plugin
|
@@ -473,10 +483,24 @@
|
|
473 |
The <strong>third value</strong> you pass in is the maximum number of post you want to get.</p>
|
474 |
<p>Default: get_most_viewed_category(1, 'both', 10);</p>
|
475 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
</ul>
|
477 |
</div>
|
478 |
</div>
|
479 |
</div>
|
480 |
-
<p id="Copyright">WP-PostViews 1.
|
481 |
</body>
|
482 |
</html>
|
2 |
<html>
|
3 |
<head>
|
4 |
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
5 |
+
<title>WP-PostViews 1.31 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-PostViews 1.31 <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-postviews.1.31.zip" title="http://downloads.wordpress.org/plugin/wp-postviews.1.31.zip">WP-PostViews 1.31 For WordPress 2.3.x And Above</a><br />
|
238 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-postviews.1.11.zip" title="http://downloads.wordpress.org/plugin/wp-postviews.1.11.zip">WP-PostViews 1.11 For WordPress 2.1.x And 2.2.x</a><br />
|
239 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-postviews.1.02.zip" title="http://downloads.wordpress.org/plugin/wp-postviews.1.02.zip">WP-PostViews 1.02 For WordPress 2.0.x</a><br />
|
240 |
</p>
|
259 |
</p>
|
260 |
<p>
|
261 |
<strong>Credits:</strong><br />
|
262 |
+
<strong>»</strong> WP-Cache/WP-SuperCache Compatibility By <a href="http://omninoggin.com/">Thaya Kareeson</a>.<br />
|
263 |
+
<strong>»</strong> __ngetext() by <a href="http://hweia.ru/" title="http://hweia.ru/">Anna Ozeritskaya</a>.
|
264 |
</p>
|
265 |
<p>
|
266 |
<strong>Note:</strong><br />
|
281 |
<div id="Changelog" style="display: none;">
|
282 |
<div class="SubTitle">» Changelog</div>
|
283 |
<ul>
|
284 |
+
<li>
|
285 |
+
<strong>Version 1.31 (16-07-2008)</strong>
|
286 |
+
<ul>
|
287 |
+
<li>NEW: Works For WordPress 2.6</li>
|
288 |
+
<li>NEW: Renamed GET Variables sortby To v_sortby And orderby To v_orderby</li>
|
289 |
+
<li>NEW: Better Translation Using __ngetext() by <a href="http://hweia.ru/" title="http://hweia.ru/">Anna Ozeritskaya</a></li>
|
290 |
+
<li>FIXED: Able To Use v_sortby And v_orderby in query_posts()</li>
|
291 |
+
</ul>
|
292 |
+
</li>
|
293 |
+
<li>
|
294 |
<strong>Version 1.30 (01-06-2008)</strong>
|
295 |
<ul>
|
296 |
<li>NEW: Uses /wp-postviews/ Folder Instead Of /postviews/</li>
|
372 |
<!-- Upgrade Instructions -->
|
373 |
<div id="Upgrade" style="display: none;">
|
374 |
<div class="SubTitle">» Upgrade Instructions</div>
|
375 |
+
<div class="SubSubTitle">From v1.0x To v1.31</div>
|
376 |
<ol>
|
377 |
<li>
|
378 |
<strong>Deactivate</strong> WP-PostViews Plugin
|
483 |
The <strong>third value</strong> you pass in is the maximum number of post you want to get.</p>
|
484 |
<p>Default: get_most_viewed_category(1, 'both', 10);</p>
|
485 |
</li>
|
486 |
+
<li>
|
487 |
+
To Sort <strong>Most/Least Viewed Posts</strong>
|
488 |
+
</li>
|
489 |
+
<li>
|
490 |
+
You can use:
|
491 |
+
<blockquote>
|
492 |
+
<?php query_posts('v_sortby=views&v_orderby=desc') ?>
|
493 |
+
</blockquote>
|
494 |
+
<p>Or pass in the variables to the URL:</p>
|
495 |
+
<blockquote>
|
496 |
+
http://yoursite.com/?v_sortby=views&v_orderby=desc
|
497 |
+
</blockquote>
|
498 |
+
<p>You can replace <strong>desc</strong> with <strong>asc</strong> if you want the least viewed posts.</p>
|
499 |
+
</li>
|
500 |
</ul>
|
501 |
</div>
|
502 |
</div>
|
503 |
</div>
|
504 |
+
<p id="Copyright">WP-PostViews 1.31<br />Copyright © 2008 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
|
505 |
</body>
|
506 |
</html>
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: GamerZ
|
|
3 |
Donate link: http://lesterchan.net/wordpress
|
4 |
Tags: views, hits, counter, postviews
|
5 |
Requires at least: 2.5.0
|
6 |
-
Stable tag: 1.
|
7 |
|
8 |
Enables you to display how many times a post/page had been viewed.
|
9 |
|
3 |
Donate link: http://lesterchan.net/wordpress
|
4 |
Tags: views, hits, counter, postviews
|
5 |
Requires at least: 2.5.0
|
6 |
+
Stable tag: 1.31
|
7 |
|
8 |
Enables you to display how many times a post/page had been viewed.
|
9 |
|
wp-postviews-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP-PostViews Widget
|
4 |
Plugin URI: http://lesterchan.net/portfolio/programming/php/
|
5 |
Description: Adds a PostViews Widget to display most viewed posts and/or pages on your sidebar. You will need to activate WP-PostViews first.
|
6 |
-
Version: 1.
|
7 |
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: http://lesterchan.net
|
9 |
*/
|
@@ -71,17 +71,17 @@ function widget_views_init() {
|
|
71 |
echo '<option value="both"';
|
72 |
selected('both', $options['mode']);
|
73 |
echo '>';
|
74 |
-
_e('
|
75 |
echo '</option>'."\n";
|
76 |
echo '<option value="post"';
|
77 |
selected('post', $options['mode']);
|
78 |
echo '>';
|
79 |
-
_e('
|
80 |
echo '</option>'."\n";
|
81 |
echo '<option value="page"';
|
82 |
selected('page', $options['mode']);
|
83 |
echo '>';
|
84 |
-
_e('
|
85 |
echo '</option>'."\n";
|
86 |
echo '</select> ';
|
87 |
_e('Only', 'wp-postviews');
|
3 |
Plugin Name: WP-PostViews Widget
|
4 |
Plugin URI: http://lesterchan.net/portfolio/programming/php/
|
5 |
Description: Adds a PostViews Widget to display most viewed posts and/or pages on your sidebar. You will need to activate WP-PostViews first.
|
6 |
+
Version: 1.31
|
7 |
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: http://lesterchan.net
|
9 |
*/
|
71 |
echo '<option value="both"';
|
72 |
selected('both', $options['mode']);
|
73 |
echo '>';
|
74 |
+
_e('Posts & Pages', 'wp-postviews');
|
75 |
echo '</option>'."\n";
|
76 |
echo '<option value="post"';
|
77 |
selected('post', $options['mode']);
|
78 |
echo '>';
|
79 |
+
_e('Posts', 'wp-postviews');
|
80 |
echo '</option>'."\n";
|
81 |
echo '<option value="page"';
|
82 |
selected('page', $options['mode']);
|
83 |
echo '>';
|
84 |
+
_e('Pages', 'wp-postviews');
|
85 |
echo '</option>'."\n";
|
86 |
echo '</select> ';
|
87 |
_e('Only', 'wp-postviews');
|
wp-postviews.mo
CHANGED
Binary file
|
wp-postviews.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP-PostViews
|
4 |
Plugin URI: http://lesterchan.net/portfolio/programming/php/
|
5 |
Description: Enables you to display how many times a post/page had been viewed.
|
6 |
-
Version: 1.
|
7 |
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: http://lesterchan.net
|
9 |
*/
|
@@ -30,14 +30,38 @@ Author URI: http://lesterchan.net
|
|
30 |
|
31 |
### Load WP-Config File If This File Is Called Directly
|
32 |
if (!function_exists('add_action')) {
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
|
36 |
|
37 |
### Create Text Domain For Translations
|
38 |
add_action('init', 'postviews_textdomain');
|
39 |
function postviews_textdomain() {
|
40 |
-
|
|
|
|
|
|
|
|
|
41 |
}
|
42 |
|
43 |
|
@@ -87,11 +111,11 @@ function process_postviews() {
|
|
87 |
}
|
88 |
if($should_count) {
|
89 |
if(defined('WP_CACHE') && WP_CACHE) {
|
90 |
-
echo "\n".'<!-- Start Of Script Generated By WP-PostViews 1.
|
91 |
wp_print_scripts(array('sack'));
|
92 |
echo '<script type="text/javascript">'."\n";
|
93 |
echo '/* <![CDATA[ */'."\n";
|
94 |
-
echo "\t".'var postviews_ajax_url = \''.
|
95 |
echo "\t".'postviews_count = new sack(postviews_ajax_url);'."\n";
|
96 |
echo "\t".'postviews_count.setVar("postviews_id", '.$id.');'."\n";
|
97 |
echo "\t".'postviews_count.method = \'GET\';'."\n";
|
@@ -99,7 +123,7 @@ function process_postviews() {
|
|
99 |
echo "\t".'postviews_count = null;'."\n";
|
100 |
echo '/* ]]> */'."\n";
|
101 |
echo '</script>'."\n";
|
102 |
-
echo '<!-- End Of Script Generated By WP-PostViews 1.
|
103 |
} else {
|
104 |
if(!update_post_meta($id, 'views', ($post_views+1))) {
|
105 |
add_post_meta($id, 'views', 1, true);
|
@@ -144,7 +168,7 @@ if(!function_exists('get_most_viewed')) {
|
|
144 |
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password);
|
145 |
$post_content = get_the_content();
|
146 |
if($chars > 0) {
|
147 |
-
$temp = "<li><a href=\"".get_permalink()."\">".snippet_text($post_title, $chars)."</a> -
|
148 |
} else {
|
149 |
$temp = stripslashes($views_options['most_viewed_template']);
|
150 |
$temp = str_replace("%VIEW_COUNT%", $post_views, $temp);
|
@@ -193,7 +217,7 @@ if(!function_exists('get_most_viewed_category')) {
|
|
193 |
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password);
|
194 |
$post_content = get_the_content();
|
195 |
if($chars > 0) {
|
196 |
-
$temp = "<li><a href=\"".get_permalink()."\">".snippet_text($post_title, $chars)."</a> -
|
197 |
} else {
|
198 |
$temp = stripslashes($views_options['most_viewed_template']);
|
199 |
$temp = str_replace("%VIEW_COUNT%", $post_views, $temp);
|
@@ -275,7 +299,7 @@ function views_where($content) {
|
|
275 |
return $content;
|
276 |
}
|
277 |
function views_orderby($content) {
|
278 |
-
$orderby = trim(addslashes(
|
279 |
if(empty($orderby) || ($orderby != 'asc' && $orderby != 'desc')) {
|
280 |
$orderby = 'desc';
|
281 |
}
|
@@ -284,12 +308,24 @@ function views_orderby($content) {
|
|
284 |
}
|
285 |
|
286 |
|
287 |
-
###
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
}
|
294 |
|
295 |
|
@@ -319,9 +355,9 @@ function postviews_page_admin_most_stats($content) {
|
|
319 |
$stats_display = get_option('stats_display');
|
320 |
$stats_mostlimit = intval(get_option('stats_mostlimit'));
|
321 |
if($stats_display['viewed_most'] == 1) {
|
322 |
-
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most" value="viewed_most" checked="checked" /> <label for="wpstats_viewed_most">'
|
323 |
} else {
|
324 |
-
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most" value="viewed_most" /> <label for="wpstats_viewed_most">'
|
325 |
}
|
326 |
return $content;
|
327 |
}
|
@@ -333,7 +369,7 @@ function postviews_page_general_stats($content) {
|
|
333 |
if($stats_display['views'] == 1) {
|
334 |
$content .= '<p><strong>'.__('WP-PostViews', 'wp-postviews').'</strong></p>'."\n";
|
335 |
$content .= '<ul>'."\n";
|
336 |
-
$content .= '<li
|
337 |
$content .= '</ul>'."\n";
|
338 |
}
|
339 |
return $content;
|
@@ -345,7 +381,7 @@ function postviews_page_most_stats($content) {
|
|
345 |
$stats_display = get_option('stats_display');
|
346 |
$stats_mostlimit = intval(get_option('stats_mostlimit'));
|
347 |
if($stats_display['viewed_most'] == 1) {
|
348 |
-
$content .= '<p><strong>'
|
349 |
$content .= '<ul>'."\n";
|
350 |
$content .= get_most_viewed('post', $stats_mostlimit, 0, false);
|
351 |
$content .= '</ul>'."\n";
|
3 |
Plugin Name: WP-PostViews
|
4 |
Plugin URI: http://lesterchan.net/portfolio/programming/php/
|
5 |
Description: Enables you to display how many times a post/page had been viewed.
|
6 |
+
Version: 1.31
|
7 |
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: http://lesterchan.net
|
9 |
*/
|
30 |
|
31 |
### Load WP-Config File If This File Is Called Directly
|
32 |
if (!function_exists('add_action')) {
|
33 |
+
$wp_root = '../../..';
|
34 |
+
if (file_exists($wp_root.'/wp-load.php')) {
|
35 |
+
require_once($wp_root.'/wp-load.php');
|
36 |
+
} else {
|
37 |
+
require_once($wp_root.'/wp-config.php');
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
|
42 |
+
### Use WordPress 2.6 Constants
|
43 |
+
if (!defined('WP_CONTENT_DIR')) {
|
44 |
+
define( 'WP_CONTENT_DIR', ABSPATH.'wp-content');
|
45 |
+
}
|
46 |
+
if (!defined('WP_CONTENT_URL')) {
|
47 |
+
define('WP_CONTENT_URL', get_option('siteurl').'/wp-content');
|
48 |
+
}
|
49 |
+
if (!defined('WP_PLUGIN_DIR')) {
|
50 |
+
define('WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins');
|
51 |
+
}
|
52 |
+
if (!defined('WP_PLUGIN_URL')) {
|
53 |
+
define('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins');
|
54 |
}
|
55 |
|
56 |
|
57 |
### Create Text Domain For Translations
|
58 |
add_action('init', 'postviews_textdomain');
|
59 |
function postviews_textdomain() {
|
60 |
+
if (!function_exists('wp_print_styles')) {
|
61 |
+
load_plugin_textdomain('wp-postviews', 'wp-content/plugins/wp-postviews');
|
62 |
+
} else {
|
63 |
+
load_plugin_textdomain('wp-postviews', false, 'wp-postviews');
|
64 |
+
}
|
65 |
}
|
66 |
|
67 |
|
111 |
}
|
112 |
if($should_count) {
|
113 |
if(defined('WP_CACHE') && WP_CACHE) {
|
114 |
+
echo "\n".'<!-- Start Of Script Generated By WP-PostViews 1.31 -->'."\n";
|
115 |
wp_print_scripts(array('sack'));
|
116 |
echo '<script type="text/javascript">'."\n";
|
117 |
echo '/* <![CDATA[ */'."\n";
|
118 |
+
echo "\t".'var postviews_ajax_url = \''.WP_PLUGIN_URL.'/wp-postviews/wp-postviews.php'."';\n";
|
119 |
echo "\t".'postviews_count = new sack(postviews_ajax_url);'."\n";
|
120 |
echo "\t".'postviews_count.setVar("postviews_id", '.$id.');'."\n";
|
121 |
echo "\t".'postviews_count.method = \'GET\';'."\n";
|
123 |
echo "\t".'postviews_count = null;'."\n";
|
124 |
echo '/* ]]> */'."\n";
|
125 |
echo '</script>'."\n";
|
126 |
+
echo '<!-- End Of Script Generated By WP-PostViews 1.31 -->'."\n";
|
127 |
} else {
|
128 |
if(!update_post_meta($id, 'views', ($post_views+1))) {
|
129 |
add_post_meta($id, 'views', 1, true);
|
168 |
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password);
|
169 |
$post_content = get_the_content();
|
170 |
if($chars > 0) {
|
171 |
+
$temp = "<li><a href=\"".get_permalink()."\">".snippet_text($post_title, $chars)."</a> - ".sprintf(__ngettext('%s view', '%s views', $post_views, 'wp-postviews'), $post_views)."</li>\n";
|
172 |
} else {
|
173 |
$temp = stripslashes($views_options['most_viewed_template']);
|
174 |
$temp = str_replace("%VIEW_COUNT%", $post_views, $temp);
|
217 |
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password);
|
218 |
$post_content = get_the_content();
|
219 |
if($chars > 0) {
|
220 |
+
$temp = "<li><a href=\"".get_permalink()."\">".snippet_text($post_title, $chars)."</a> - ".sprintf(__ngettext('%s view', '%s views', $post_views, 'wp-postviews'), $post_views)."</li>\n";
|
221 |
} else {
|
222 |
$temp = stripslashes($views_options['most_viewed_template']);
|
223 |
$temp = str_replace("%VIEW_COUNT%", $post_views, $temp);
|
299 |
return $content;
|
300 |
}
|
301 |
function views_orderby($content) {
|
302 |
+
$orderby = trim(addslashes(get_query_var('v_orderby')));
|
303 |
if(empty($orderby) || ($orderby != 'asc' && $orderby != 'desc')) {
|
304 |
$orderby = 'desc';
|
305 |
}
|
308 |
}
|
309 |
|
310 |
|
311 |
+
### Function: Views Public Variables
|
312 |
+
add_filter('query_vars', 'views_variables');
|
313 |
+
function views_variables($public_query_vars) {
|
314 |
+
$public_query_vars[] = 'v_sortby';
|
315 |
+
$public_query_vars[] = 'v_orderby';
|
316 |
+
return $public_query_vars;
|
317 |
+
}
|
318 |
+
|
319 |
+
|
320 |
+
### Function: Sort Ratings Posts
|
321 |
+
add_action('pre_get_posts', 'views_sorting');
|
322 |
+
function views_sorting() {
|
323 |
+
if(get_query_var('v_sortby') == 'views') {
|
324 |
+
add_filter('posts_fields', 'views_fields');
|
325 |
+
add_filter('posts_join', 'views_join');
|
326 |
+
add_filter('posts_where', 'views_where');
|
327 |
+
add_filter('posts_orderby', 'views_orderby');
|
328 |
+
}
|
329 |
}
|
330 |
|
331 |
|
355 |
$stats_display = get_option('stats_display');
|
356 |
$stats_mostlimit = intval(get_option('stats_mostlimit'));
|
357 |
if($stats_display['viewed_most'] == 1) {
|
358 |
+
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most" value="viewed_most" checked="checked" /> <label for="wpstats_viewed_most">'.sprintf(__ngettext('%s Most Viewed Post', '%s Most Viewed Posts', $stats_mostlimit, 'wp-postviews'), $stats_mostlimit).'</label><br />'."\n";
|
359 |
} else {
|
360 |
+
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most" value="viewed_most" /> <label for="wpstats_viewed_most">'.sprintf(__ngettext('%s Most Viewed Post', '%s Most Viewed Posts', $stats_mostlimit, 'wp-postviews'), $stats_mostlimit).'</label><br />'."\n";
|
361 |
}
|
362 |
return $content;
|
363 |
}
|
369 |
if($stats_display['views'] == 1) {
|
370 |
$content .= '<p><strong>'.__('WP-PostViews', 'wp-postviews').'</strong></p>'."\n";
|
371 |
$content .= '<ul>'."\n";
|
372 |
+
$content .= '<li>'.sprintf(__ngettext('<strong>%s</strong> view was generated..', '<strong>%s</strong> views were generated.', get_totalviews(false), 'wp-postviews'), get_totalviews(false)).'</li>'."\n";
|
373 |
$content .= '</ul>'."\n";
|
374 |
}
|
375 |
return $content;
|
381 |
$stats_display = get_option('stats_display');
|
382 |
$stats_mostlimit = intval(get_option('stats_mostlimit'));
|
383 |
if($stats_display['viewed_most'] == 1) {
|
384 |
+
$content .= '<p><strong>'.sprintf(__ngettext('%s Most Viewed Post', '%s Most Viewed Posts', $stats_mostlimit, 'wp-postviews'), $stats_mostlimit).'</strong></p>'."\n";
|
385 |
$content .= '<ul>'."\n";
|
386 |
$content .= get_most_viewed('post', $stats_mostlimit, 0, false);
|
387 |
$content .= '</ul>'."\n";
|
wp-postviews.pot
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: WP-PostViews 1.
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: 2008-
|
6 |
-
"PO-Revision-Date: 2008-
|
7 |
"Last-Translator: Lester Chan <lesterchan@gmail.com>\n"
|
8 |
"Language-Team: Lester Chan <lesterchan@gmail.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
@@ -11,7 +11,7 @@ msgstr ""
|
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"X-Poedit-Language: English\n"
|
13 |
"X-Poedit-Country: SINGAPORE\n"
|
14 |
-
"X-Poedit-KeywordsList: __;_e\n"
|
15 |
"X-Poedit-Basepath: .\n"
|
16 |
"X-Poedit-SearchPath-0: .\n"
|
17 |
|
@@ -64,14 +64,12 @@ msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-PostVie
|
|
64 |
msgstr ""
|
65 |
|
66 |
#: postviews-options.php:119
|
67 |
-
#: wp-postviews.php:
|
68 |
msgid "%VIEW_COUNT% views"
|
69 |
msgstr ""
|
70 |
|
71 |
#: postviews-options.php:122
|
72 |
-
#: wp-postviews.php:
|
73 |
-
#: wp-postviews.php:196
|
74 |
-
#: wp-postviews.php:380
|
75 |
msgid "views"
|
76 |
msgstr ""
|
77 |
|
@@ -171,15 +169,15 @@ msgid "Show Views For: "
|
|
171 |
msgstr ""
|
172 |
|
173 |
#: wp-postviews-widget.php:74
|
174 |
-
msgid "
|
175 |
msgstr ""
|
176 |
|
177 |
#: wp-postviews-widget.php:79
|
178 |
-
msgid "
|
179 |
msgstr ""
|
180 |
|
181 |
#: wp-postviews-widget.php:84
|
182 |
-
msgid "
|
183 |
msgstr ""
|
184 |
|
185 |
#: wp-postviews-widget.php:87
|
@@ -198,35 +196,46 @@ msgstr ""
|
|
198 |
msgid "(<strong>0</strong> to disable)"
|
199 |
msgstr ""
|
200 |
|
201 |
-
#: wp-postviews.php:
|
202 |
msgid "Post Views"
|
203 |
msgstr ""
|
204 |
|
205 |
-
#: wp-postviews.php:
|
206 |
-
#: wp-postviews.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
msgid "N/A"
|
208 |
msgstr ""
|
209 |
|
210 |
-
#: wp-postviews.php:
|
211 |
msgid "There is no excerpt because this is a protected post."
|
212 |
msgstr ""
|
213 |
|
214 |
-
#: wp-postviews.php:
|
215 |
-
#: wp-postviews.php:
|
216 |
-
#: wp-postviews.php:
|
217 |
msgid "WP-PostViews"
|
218 |
msgstr ""
|
219 |
|
220 |
-
#: wp-postviews.php:
|
221 |
-
#: wp-postviews.php:
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
msgstr ""
|
228 |
|
229 |
-
#: wp-postviews.php:
|
230 |
-
|
231 |
-
|
|
|
|
|
|
|
232 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: WP-PostViews 1.31\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2008-07-15 15:49+0800\n"
|
6 |
+
"PO-Revision-Date: 2008-07-15 15:49+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"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"X-Poedit-Language: English\n"
|
13 |
"X-Poedit-Country: SINGAPORE\n"
|
14 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2\n"
|
15 |
"X-Poedit-Basepath: .\n"
|
16 |
"X-Poedit-SearchPath-0: .\n"
|
17 |
|
64 |
msgstr ""
|
65 |
|
66 |
#: postviews-options.php:119
|
67 |
+
#: wp-postviews.php:415
|
68 |
msgid "%VIEW_COUNT% views"
|
69 |
msgstr ""
|
70 |
|
71 |
#: postviews-options.php:122
|
72 |
+
#: wp-postviews.php:416
|
|
|
|
|
73 |
msgid "views"
|
74 |
msgstr ""
|
75 |
|
169 |
msgstr ""
|
170 |
|
171 |
#: wp-postviews-widget.php:74
|
172 |
+
msgid "Posts & Pages"
|
173 |
msgstr ""
|
174 |
|
175 |
#: wp-postviews-widget.php:79
|
176 |
+
msgid "Posts"
|
177 |
msgstr ""
|
178 |
|
179 |
#: wp-postviews-widget.php:84
|
180 |
+
msgid "Pages"
|
181 |
msgstr ""
|
182 |
|
183 |
#: wp-postviews-widget.php:87
|
196 |
msgid "(<strong>0</strong> to disable)"
|
197 |
msgstr ""
|
198 |
|
199 |
+
#: wp-postviews.php:72
|
200 |
msgid "Post Views"
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: wp-postviews.php:171
|
204 |
+
#: wp-postviews.php:220
|
205 |
+
#, php-format
|
206 |
+
msgid "%s view"
|
207 |
+
msgid_plural "%s views"
|
208 |
+
msgstr[0] ""
|
209 |
+
msgstr[1] ""
|
210 |
+
|
211 |
+
#: wp-postviews.php:183
|
212 |
+
#: wp-postviews.php:232
|
213 |
msgid "N/A"
|
214 |
msgstr ""
|
215 |
|
216 |
+
#: wp-postviews.php:274
|
217 |
msgid "There is no excerpt because this is a protected post."
|
218 |
msgstr ""
|
219 |
|
220 |
+
#: wp-postviews.php:345
|
221 |
+
#: wp-postviews.php:347
|
222 |
+
#: wp-postviews.php:370
|
223 |
msgid "WP-PostViews"
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: wp-postviews.php:358
|
227 |
+
#: wp-postviews.php:360
|
228 |
+
#: wp-postviews.php:384
|
229 |
+
#, php-format
|
230 |
+
msgid "%s Most Viewed Post"
|
231 |
+
msgid_plural "%s Most Viewed Posts"
|
232 |
+
msgstr[0] ""
|
233 |
+
msgstr[1] ""
|
234 |
|
235 |
+
#: wp-postviews.php:372
|
236 |
+
#, php-format
|
237 |
+
msgid "<strong>%s</strong> view was generated.."
|
238 |
+
msgid_plural "<strong>%s</strong> views were generated."
|
239 |
+
msgstr[0] ""
|
240 |
+
msgstr[1] ""
|
241 |
|