Version Description
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-PostViews |
Version | 1.50 |
Comparing to | |
See all releases |
Code changes from version 1.40 to 1.50
- postviews-options.php +6 -6
- readme.html +59 -19
- readme.txt +2 -2
- wp-postviews-widget.php +0 -107
- wp-postviews.mo +0 -0
- wp-postviews.php +330 -105
- wp-postviews.pot +96 -62
postviews-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 |
|
@@ -22,7 +22,7 @@ $base_name = plugin_basename('wp-postviews/postviews-options.php');
|
|
22 |
$base_page = 'admin.php?page='.$base_name;
|
23 |
$id = intval($_GET['id']);
|
24 |
$mode = trim($_GET['mode']);
|
25 |
-
$views_settings = array('views_options', 'widget_views_most_viewed');
|
26 |
$views_postmetas = array('views');
|
27 |
|
28 |
|
@@ -128,12 +128,12 @@ switch($mode) {
|
|
128 |
default_template = "<li><a href=\"%POST_URL%\" title=\"%POST_TITLE%\">%POST_TITLE%</a> - %VIEW_COUNT% <?php _e('views', 'wp-postviews'); ?></li>";
|
129 |
break;
|
130 |
}
|
131 |
-
|
132 |
}
|
133 |
/* ]]> */
|
134 |
</script>
|
135 |
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
136 |
-
<form method="post" action="<?php echo $_SERVER['
|
137 |
<div class="wrap">
|
138 |
<?php screen_icon(); ?>
|
139 |
<h2><?php _e('Post Views Options', 'wp-postviews'); ?></h2>
|
@@ -256,7 +256,7 @@ switch($mode) {
|
|
256 |
<p> </p>
|
257 |
|
258 |
<!-- Uninstall WP-PostViews -->
|
259 |
-
<form method="post" action="<?php echo $_SERVER['
|
260 |
<div class="wrap">
|
261 |
<h3><?php _e('Uninstall WP-PostViews', 'wp-postviews'); ?></h3>
|
262 |
<p>
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
+
| WordPress 2.7 Plugin: WP-PostViews 1.50 |
|
6 |
+
| Copyright (c) 2009 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
9 |
| - Lester "GaMerZ" Chan |
|
22 |
$base_page = 'admin.php?page='.$base_name;
|
23 |
$id = intval($_GET['id']);
|
24 |
$mode = trim($_GET['mode']);
|
25 |
+
$views_settings = array('views_options', 'widget_views_most_viewed', 'widget_views');
|
26 |
$views_postmetas = array('views');
|
27 |
|
28 |
|
128 |
default_template = "<li><a href=\"%POST_URL%\" title=\"%POST_TITLE%\">%POST_TITLE%</a> - %VIEW_COUNT% <?php _e('views', 'wp-postviews'); ?></li>";
|
129 |
break;
|
130 |
}
|
131 |
+
jQuery("#views_template_" + template).val(default_template);
|
132 |
}
|
133 |
/* ]]> */
|
134 |
</script>
|
135 |
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
136 |
+
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
|
137 |
<div class="wrap">
|
138 |
<?php screen_icon(); ?>
|
139 |
<h2><?php _e('Post Views Options', 'wp-postviews'); ?></h2>
|
256 |
<p> </p>
|
257 |
|
258 |
<!-- Uninstall WP-PostViews -->
|
259 |
+
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
|
260 |
<div class="wrap">
|
261 |
<h3><?php _e('Uninstall WP-PostViews', 'wp-postviews'); ?></h3>
|
262 |
<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-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,6 +234,7 @@
|
|
234 |
</p>
|
235 |
<p>
|
236 |
<strong>Download:</strong><br />
|
|
|
237 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-postviews.1.40.zip" title="http://downloads.wordpress.org/plugin/wp-postviews.1.40.zip">WP-PostViews 1.40 For WordPress 2.7.x</a><br />
|
238 |
<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, 2.5.x And 2.6.x</a><br />
|
239 |
<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 />
|
@@ -284,6 +285,21 @@
|
|
284 |
<div id="Changelog" style="display: none;">
|
285 |
<div class="SubTitle">» Changelog</div>
|
286 |
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
<li>
|
288 |
<strong>Version 1.40 (12-12-2008)</strong>
|
289 |
<ul>
|
@@ -388,7 +404,7 @@
|
|
388 |
<!-- Upgrade Instructions -->
|
389 |
<div id="Upgrade" style="display: none;">
|
390 |
<div class="SubTitle">» Upgrade Instructions</div>
|
391 |
-
<div class="SubSubTitle">From v1.0x To v1.
|
392 |
<ol>
|
393 |
<li>
|
394 |
<strong>Deactivate</strong> WP-PostViews Plugin
|
@@ -422,7 +438,7 @@
|
|
422 |
<ol>
|
423 |
<li>
|
424 |
Open <strong>wp-content/themes/<YOUR THEME NAME>/index.php</strong>
|
425 |
-
<p>You may place it in <strong>single.php</strong>, <strong>post.php</strong> or <strong>page.php</strong> also.</p>
|
426 |
</li>
|
427 |
<li>
|
428 |
Find:
|
@@ -437,28 +453,16 @@
|
|
437 |
</blockquote>
|
438 |
</li>
|
439 |
<li>
|
440 |
-
Go to <strong>'WP-Admin -> Settings ->
|
441 |
</li>
|
442 |
</ol>
|
443 |
<div class="SubSubTitle">View Stats (With Widgets)</div>
|
444 |
<ol>
|
445 |
-
<li>
|
446 |
-
<strong>Activate</strong> WP-PostViews Widget Plugin
|
447 |
-
</li>
|
448 |
<li>
|
449 |
Go to '<strong>WP-Admin -> Appearance -> Widgets</strong>'
|
450 |
</li>
|
451 |
<li>
|
452 |
-
|
453 |
-
</li>
|
454 |
-
<li>
|
455 |
-
You can <strong>add</strong> the Most Viewed Widget by clicking on the 'Add' link besides it.
|
456 |
-
</li>
|
457 |
-
<li>
|
458 |
-
After adding, you can <strong>configure</strong> the Most Viewed Widget by clicking on the 'Edit' link besides it.
|
459 |
-
</li>
|
460 |
-
<li>
|
461 |
-
Click 'Save Changes'
|
462 |
</li>
|
463 |
</ol>
|
464 |
<div class="SubSubTitle">View Stats (Outside WP Loop)</div>
|
@@ -499,6 +503,42 @@
|
|
499 |
</p>
|
500 |
<p>Default: get_most_viewed('both', 10);</p>
|
501 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
502 |
<li>
|
503 |
To Display <strong>Least Viewed Posts For A Category</strong>
|
504 |
</li>
|
@@ -553,6 +593,6 @@
|
|
553 |
</div>
|
554 |
</div>
|
555 |
</div>
|
556 |
-
<p id="Copyright">WP-PostViews 1.
|
557 |
</body>
|
558 |
</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-PostViews 1.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-PostViews 1.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-postviews.1.50.zip" title="http://downloads.wordpress.org/plugin/wp-postviews.1.50.zip">WP-PostViews 1.50 For WordPress 2.8.x</a><br />
|
238 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-postviews.1.40.zip" title="http://downloads.wordpress.org/plugin/wp-postviews.1.40.zip">WP-PostViews 1.40 For WordPress 2.7.x</a><br />
|
239 |
<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, 2.5.x And 2.6.x</a><br />
|
240 |
<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 />
|
285 |
<div id="Changelog" style="display: none;">
|
286 |
<div class="SubTitle">» Changelog</div>
|
287 |
<ul>
|
288 |
+
<li>
|
289 |
+
<strong>Version 1.50 (01-06-2009)</strong>
|
290 |
+
<ul>
|
291 |
+
<li>NEW: Works For WordPress 2.8 Only</li>
|
292 |
+
<li>NEW: Uses jQuery Framework</li>
|
293 |
+
<li>NEW: Added In Most Viewed Pages To WP-Stats</li>
|
294 |
+
<li>NEW: Use _n() Instead Of __ngettext() And _n_noop() Instead Of __ngettext_noop()</li>
|
295 |
+
<li>FIXED: Uses $_SERVER['PHP_SELF'] With plugin_basename(__FILE__) Instead Of Just $_SERVER['REQUEST_URI']</li>
|
296 |
+
<li>NEW: Uses New Widget Class From WordPress</li>
|
297 |
+
<li>NEW: Merge Widget Code To wp-postviews.php And Remove wp-postviews-widget.php</li>
|
298 |
+
<li>NEW: Added get_most_viewed_tag() And get_least_viewed_tag()</li>
|
299 |
+
<li>FIXED: Ensure That Post Is Not A Revision</li>
|
300 |
+
<li>FIXED: Multiple Loops Filtered Not Cleared</li>
|
301 |
+
</ul>
|
302 |
+
</li>
|
303 |
<li>
|
304 |
<strong>Version 1.40 (12-12-2008)</strong>
|
305 |
<ul>
|
404 |
<!-- Upgrade Instructions -->
|
405 |
<div id="Upgrade" style="display: none;">
|
406 |
<div class="SubTitle">» Upgrade Instructions</div>
|
407 |
+
<div class="SubSubTitle">From v1.0x To v1.50</div>
|
408 |
<ol>
|
409 |
<li>
|
410 |
<strong>Deactivate</strong> WP-PostViews Plugin
|
438 |
<ol>
|
439 |
<li>
|
440 |
Open <strong>wp-content/themes/<YOUR THEME NAME>/index.php</strong>
|
441 |
+
<p>You may place it in <strong>archive.php</strong>, <strong>single.php</strong>, <strong>post.php</strong> or <strong>page.php</strong> also.</p>
|
442 |
</li>
|
443 |
<li>
|
444 |
Find:
|
453 |
</blockquote>
|
454 |
</li>
|
455 |
<li>
|
456 |
+
Go to <strong>'WP-Admin -> Settings -> PostViews'</strong> to configure the plugin.
|
457 |
</li>
|
458 |
</ol>
|
459 |
<div class="SubSubTitle">View Stats (With Widgets)</div>
|
460 |
<ol>
|
|
|
|
|
|
|
461 |
<li>
|
462 |
Go to '<strong>WP-Admin -> Appearance -> Widgets</strong>'
|
463 |
</li>
|
464 |
<li>
|
465 |
+
The widget name is <strong>Views</strong>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
466 |
</li>
|
467 |
</ol>
|
468 |
<div class="SubSubTitle">View Stats (Outside WP Loop)</div>
|
503 |
</p>
|
504 |
<p>Default: get_most_viewed('both', 10);</p>
|
505 |
</li>
|
506 |
+
<li>
|
507 |
+
To Display <strong>Least Viewed Posts By Tag</strong>
|
508 |
+
</li>
|
509 |
+
<li>
|
510 |
+
Use:
|
511 |
+
<blockquote>
|
512 |
+
<?php if (function_exists('get_least_viewed_tag')): ?><br />
|
513 |
+
<ul><br />
|
514 |
+
<?php get_least_viewed_tag(); ?><br />
|
515 |
+
</ul><br />
|
516 |
+
<?php endif; ?>
|
517 |
+
</blockquote>
|
518 |
+
<p>
|
519 |
+
The <strong>first value</strong> you pass in is the tag id.<br />
|
520 |
+
The <strong>second value</strong> you pass in is what you want to get, 'post', 'page' or 'both'.<br />
|
521 |
+
The <strong>third value</strong> you pass in is the maximum number of post you want to get.</p>
|
522 |
+
<p>Default: get_least_viewed_tag(1, 'both', 10);</p>
|
523 |
+
</li>
|
524 |
+
<li>
|
525 |
+
To Display <strong>Most Viewed Posts By Tag</strong>
|
526 |
+
</li>
|
527 |
+
<li>
|
528 |
+
Use:
|
529 |
+
<blockquote>
|
530 |
+
<?php if (function_exists('get_most_viewed_tag')): ?><br />
|
531 |
+
<ul><br />
|
532 |
+
<?php get_most_viewed_tag(); ?><br />
|
533 |
+
</ul><br />
|
534 |
+
<?php endif; ?>
|
535 |
+
</blockquote>
|
536 |
+
<p>
|
537 |
+
The <strong>first value</strong> you pass in is the tag id.<br />
|
538 |
+
The <strong>second value</strong> you pass in is what you want to get, 'post', 'page' or 'both'.<br />
|
539 |
+
The <strong>third value</strong> you pass in is the maximum number of post you want to get.</p>
|
540 |
+
<p>Default: get_most_viewed_tag(1, 'both', 10);</p>
|
541 |
+
</li>
|
542 |
<li>
|
543 |
To Display <strong>Least Viewed Posts For A Category</strong>
|
544 |
</li>
|
593 |
</div>
|
594 |
</div>
|
595 |
</div>
|
596 |
+
<p id="Copyright">WP-PostViews 1.50<br />Copyright © 2009 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
|
597 |
</body>
|
598 |
</html>
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: GamerZ
|
3 |
Donate link: http://lesterchan.net/wordpress
|
4 |
Tags: views, hits, counter, postviews
|
5 |
-
Requires at least: 2.
|
6 |
-
Stable tag: 1.
|
7 |
|
8 |
Enables you to display how many times a post/page had been viewed.
|
9 |
|
2 |
Contributors: GamerZ
|
3 |
Donate link: http://lesterchan.net/wordpress
|
4 |
Tags: views, hits, counter, postviews
|
5 |
+
Requires at least: 2.8
|
6 |
+
Stable tag: 1.50
|
7 |
|
8 |
Enables you to display how many times a post/page had been viewed.
|
9 |
|
wp-postviews-widget.php
DELETED
@@ -1,107 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
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.40
|
7 |
-
Author: Lester 'GaMerZ' Chan
|
8 |
-
Author URI: http://lesterchan.net
|
9 |
-
*/
|
10 |
-
|
11 |
-
|
12 |
-
/*
|
13 |
-
Copyright 2008 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
|
17 |
-
the Free Software Foundation; either version 2 of the License, or
|
18 |
-
(at your option) any later version.
|
19 |
-
|
20 |
-
This program is distributed in the hope that it will be useful,
|
21 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
-
GNU General Public License for more details.
|
24 |
-
|
25 |
-
You should have received a copy of the GNU General Public License
|
26 |
-
along with this program; if not, write to the Free Software
|
27 |
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
-
*/
|
29 |
-
|
30 |
-
|
31 |
-
### Function: Init WP-PostViews Widget
|
32 |
-
function widget_views_init() {
|
33 |
-
if (!function_exists('register_sidebar_widget')) {
|
34 |
-
return;
|
35 |
-
}
|
36 |
-
|
37 |
-
### Function: WP-PostViews Most Viewed Widget
|
38 |
-
function widget_views_most_viewed($args) {
|
39 |
-
extract($args);
|
40 |
-
$options = get_option('widget_views_most_viewed');
|
41 |
-
$title = htmlspecialchars(stripslashes($options['title']));
|
42 |
-
if (function_exists('get_most_viewed')) {
|
43 |
-
echo $before_widget.$before_title.$title.$after_title;
|
44 |
-
echo '<ul>'."\n";
|
45 |
-
get_most_viewed($options['mode'], $options['limit'], $options['chars']);
|
46 |
-
echo '</ul>'."\n";
|
47 |
-
echo $after_widget;
|
48 |
-
}
|
49 |
-
}
|
50 |
-
|
51 |
-
### Function: WP-PostViews Most Viewed Widget Options
|
52 |
-
function widget_views_most_viewed_options() {
|
53 |
-
$options = get_option('widget_views_most_viewed');
|
54 |
-
if (!is_array($options)) {
|
55 |
-
$options = array('title' => __('Most Viewed', 'wp-postviews'), 'mode' => 'post', 'limit' => 10, 'chars' => 0);
|
56 |
-
}
|
57 |
-
if ($_POST['most_viewed-submit']) {
|
58 |
-
$options['title'] = strip_tags($_POST['most_viewed-title']);
|
59 |
-
$options['mode'] = strip_tags($_POST['most_viewed-mode']);
|
60 |
-
$options['limit'] = intval($_POST['most_viewed-limit']);
|
61 |
-
$options['chars'] = intval($_POST['most_viewed-chars']);
|
62 |
-
update_option('widget_views_most_viewed', $options);
|
63 |
-
}
|
64 |
-
echo '<p><label for="most_viewed-title">';
|
65 |
-
_e('Title', 'wp-postviews');
|
66 |
-
echo ': </label><input type="text" id="most_viewed-title" name="most_viewed-title" value="'.htmlspecialchars(stripslashes($options['title'])).'" /></p>'."\n";
|
67 |
-
echo '<p><label for="most_viewed-mode">';
|
68 |
-
_e('Show Views For: ', 'wp-postviews');
|
69 |
-
echo ' </label>'."\n";
|
70 |
-
echo '<select id="most_viewed-mode" name="most_viewed-mode" size="1">'."\n";
|
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');
|
88 |
-
echo '</p>'."\n";
|
89 |
-
echo '<p><label for="most_viewed-limit">';
|
90 |
-
_e('Limit', 'wp-postviews');
|
91 |
-
echo ': </label><input type="text" id="most_viewed-limit" name="most_viewed-limit" value="'.intval($options['limit']).'" size="3" /></p>'."\n";
|
92 |
-
echo '<p><label for="most_viewed-chars">';
|
93 |
-
_e('Post Title Length (Characters)', 'wp-postviews');
|
94 |
-
echo ': </label><input type="text" id="most_viewed-chars" name="most_viewed-chars" value="'.intval($options['chars']).'" size="5" /> '."\n";
|
95 |
-
_e('(<strong>0</strong> to disable)', 'wp-postviews');
|
96 |
-
echo '</p>'."\n";
|
97 |
-
echo '<input type="hidden" id="most_viewed-submit" name="most_viewed-submit" value="1" />'."\n";
|
98 |
-
}
|
99 |
-
// Register Widgets
|
100 |
-
register_sidebar_widget(array('Most Viewed', 'wp-postviews'), 'widget_views_most_viewed');
|
101 |
-
register_widget_control(array('Most Viewed', 'wp-postviews'), 'widget_views_most_viewed_options', 400, 200);
|
102 |
-
}
|
103 |
-
|
104 |
-
|
105 |
-
### Function: Load The WP-PostViews Widget
|
106 |
-
add_action('plugins_loaded', 'widget_views_init')
|
107 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wp-postviews.mo
CHANGED
Binary file
|
wp-postviews.php
CHANGED
@@ -3,14 +3,14 @@
|
|
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. Modified by <a href="http://DPotter.net/Technical/" title="David's Technical Musings">David Potter</a> to include options for when and where to display view counts.
|
6 |
-
Version: 1.
|
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
|
@@ -59,55 +59,52 @@ function postviews_menu() {
|
|
59 |
add_action('wp_head', 'process_postviews');
|
60 |
function process_postviews() {
|
61 |
global $user_ID, $post;
|
62 |
-
if(
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
break;
|
72 |
-
case 1:
|
73 |
-
if(empty($_COOKIE[USER_COOKIE]) && intval($user_ID) == 0) {
|
74 |
-
$should_count = true;
|
75 |
-
}
|
76 |
-
break;
|
77 |
-
case 2:
|
78 |
-
if(intval($user_ID) > 0) {
|
79 |
$should_count = true;
|
80 |
-
}
|
81 |
-
break;
|
82 |
-
}
|
83 |
-
if(intval($views_options['exclude_bots']) == 1) {
|
84 |
-
$bots = array('Google Bot' => 'googlebot', 'Google Bot' => 'google', 'MSN' => 'msnbot', 'Alex' => 'ia_archiver', 'Lycos' => 'lycos', 'Ask Jeeves' => 'jeeves', 'Altavista' => 'scooter', 'AllTheWeb' => 'fast-webcrawler', 'Inktomi' => 'slurp@inktomi', 'Turnitin.com' => 'turnitinbot', 'Technorati' => 'technorati', 'Yahoo' => 'yahoo', 'Findexa' => 'findexa', 'NextLinks' => 'findlinks', 'Gais' => 'gaisbo', 'WiseNut' => 'zyborg', 'WhoisSource' => 'surveybot', 'Bloglines' => 'bloglines', 'BlogSearch' => 'blogsearch', 'PubSub' => 'pubsub', 'Syndic8' => 'syndic8', 'RadioUserland' => 'userland', 'Gigabot' => 'gigabot', 'Become.com' => 'become.com');
|
85 |
-
$useragent = $_SERVER['HTTP_USER_AGENT'];
|
86 |
-
foreach ($bots as $name => $lookfor) {
|
87 |
-
if (stristr($useragent, $lookfor) !== false) {
|
88 |
-
$should_count = false;
|
89 |
break;
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
}
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
111 |
}
|
112 |
}
|
113 |
}
|
@@ -186,18 +183,17 @@ if(!function_exists('get_least_viewed')) {
|
|
186 |
foreach ($most_viewed as $post) {
|
187 |
$post_views = intval($post->views);
|
188 |
$post_title = get_the_title();
|
189 |
-
|
190 |
-
|
191 |
-
if($chars > 0) {
|
192 |
-
$temp = "<li><a href=\"".get_permalink()."\">".snippet_text($post_title, $chars)."</a> - ".sprintf(__ngettext('%s view', '%s views', $post_views, 'wp-postviews'), number_format_i18n($post_views))."</li>\n";
|
193 |
-
} else {
|
194 |
-
$temp = stripslashes($views_options['most_viewed_template']);
|
195 |
-
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
196 |
-
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
197 |
-
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
198 |
-
$temp = str_replace("%POST_CONTENT%", $post_content, $temp);
|
199 |
-
$temp = str_replace("%POST_URL%", get_permalink(), $temp);
|
200 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
$output .= $temp;
|
202 |
}
|
203 |
} else {
|
@@ -230,18 +226,17 @@ if(!function_exists('get_most_viewed')) {
|
|
230 |
foreach ($most_viewed as $post) {
|
231 |
$post_views = intval($post->views);
|
232 |
$post_title = get_the_title();
|
233 |
-
|
234 |
-
|
235 |
-
if($chars > 0) {
|
236 |
-
$temp = "<li><a href=\"".get_permalink()."\">".snippet_text($post_title, $chars)."</a> - ".sprintf(__ngettext('%s view', '%s views', $post_views, 'wp-postviews'), number_format_i18n($post_views))."</li>\n";
|
237 |
-
} else {
|
238 |
-
$temp = stripslashes($views_options['most_viewed_template']);
|
239 |
-
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
240 |
-
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
241 |
-
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
242 |
-
$temp = str_replace("%POST_CONTENT%", $post_content, $temp);
|
243 |
-
$temp = str_replace("%POST_URL%", get_permalink(), $temp);
|
244 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
$output .= $temp;
|
246 |
}
|
247 |
} else {
|
@@ -279,18 +274,17 @@ if(!function_exists('get_least_viewed_category')) {
|
|
279 |
foreach ($most_viewed as $post) {
|
280 |
$post_views = intval($post->views);
|
281 |
$post_title = get_the_title();
|
282 |
-
|
283 |
-
|
284 |
-
if($chars > 0) {
|
285 |
-
$temp = "<li><a href=\"".get_permalink()."\">".snippet_text($post_title, $chars)."</a> - ".sprintf(__ngettext('%s view', '%s views', $post_views, 'wp-postviews'), number_format_i18n($post_views))."</li>\n";
|
286 |
-
} else {
|
287 |
-
$temp = stripslashes($views_options['most_viewed_template']);
|
288 |
-
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
289 |
-
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
290 |
-
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
291 |
-
$temp = str_replace("%POST_CONTENT%", $post_content, $temp);
|
292 |
-
$temp = str_replace("%POST_URL%", get_permalink(), $temp);
|
293 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
$output .= $temp;
|
295 |
}
|
296 |
} else {
|
@@ -328,18 +322,113 @@ if(!function_exists('get_most_viewed_category')) {
|
|
328 |
foreach ($most_viewed as $post) {
|
329 |
$post_views = intval($post->views);
|
330 |
$post_title = get_the_title();
|
331 |
-
|
|
|
|
|
|
|
332 |
$post_content = get_the_content();
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
$output .= $temp;
|
344 |
}
|
345 |
} else {
|
@@ -391,14 +480,14 @@ if(!function_exists('snippet_text')) {
|
|
391 |
|
392 |
|
393 |
### Function: Process Post Excerpt, For Some Reasons, The Default get_post_excerpt() Does Not Work As Expected
|
394 |
-
function views_post_excerpt($post_excerpt, $post_content, $post_password) {
|
395 |
if(!empty($post_password)) {
|
396 |
if(!isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || $_COOKIE['wp-postpass_'.COOKIEHASH] != $post_password) {
|
397 |
return __('There is no excerpt because this is a protected post.', 'wp-postviews');
|
398 |
}
|
399 |
}
|
400 |
if(empty($post_excerpt)) {
|
401 |
-
return snippet_text(strip_tags($post_content),
|
402 |
} else {
|
403 |
return $post_excerpt;
|
404 |
}
|
@@ -433,9 +522,12 @@ function views_orderby($content) {
|
|
433 |
|
434 |
### Function: Add Views Custom Fields
|
435 |
add_action('publish_post', 'add_views_fields');
|
|
|
436 |
function add_views_fields($post_ID) {
|
437 |
global $wpdb;
|
438 |
-
|
|
|
|
|
439 |
}
|
440 |
|
441 |
|
@@ -443,7 +535,9 @@ function add_views_fields($post_ID) {
|
|
443 |
add_action('delete_post', 'delete_views_fields');
|
444 |
function delete_views_fields($post_ID) {
|
445 |
global $wpdb;
|
446 |
-
|
|
|
|
|
447 |
}
|
448 |
|
449 |
|
@@ -456,14 +550,19 @@ function views_variables($public_query_vars) {
|
|
456 |
}
|
457 |
|
458 |
|
459 |
-
### Function: Sort
|
460 |
add_action('pre_get_posts', 'views_sorting');
|
461 |
-
function views_sorting() {
|
462 |
-
if(
|
463 |
add_filter('posts_fields', 'views_fields');
|
464 |
add_filter('posts_join', 'views_join');
|
465 |
add_filter('posts_where', 'views_where');
|
466 |
add_filter('posts_orderby', 'views_orderby');
|
|
|
|
|
|
|
|
|
|
|
467 |
}
|
468 |
}
|
469 |
|
@@ -493,10 +592,15 @@ function postviews_page_admin_general_stats($content) {
|
|
493 |
function postviews_page_admin_most_stats($content) {
|
494 |
$stats_display = get_option('stats_display');
|
495 |
$stats_mostlimit = intval(get_option('stats_mostlimit'));
|
496 |
-
if($stats_display['
|
497 |
-
$content .= '<input type="checkbox" name="stats_display[]" id="
|
|
|
|
|
|
|
|
|
|
|
498 |
} else {
|
499 |
-
$content .= '<input type="checkbox" name="stats_display[]" id="
|
500 |
}
|
501 |
return $content;
|
502 |
}
|
@@ -508,7 +612,7 @@ function postviews_page_general_stats($content) {
|
|
508 |
if($stats_display['views'] == 1) {
|
509 |
$content .= '<p><strong>'.__('WP-PostViews', 'wp-postviews').'</strong></p>'."\n";
|
510 |
$content .= '<ul>'."\n";
|
511 |
-
$content .= '<li>'.sprintf(
|
512 |
$content .= '</ul>'."\n";
|
513 |
}
|
514 |
return $content;
|
@@ -519,12 +623,18 @@ function postviews_page_general_stats($content) {
|
|
519 |
function postviews_page_most_stats($content) {
|
520 |
$stats_display = get_option('stats_display');
|
521 |
$stats_mostlimit = intval(get_option('stats_mostlimit'));
|
522 |
-
if($stats_display['
|
523 |
-
$content .= '<p><strong>'.sprintf(
|
524 |
$content .= '<ul>'."\n";
|
525 |
$content .= get_most_viewed('post', $stats_mostlimit, 0, false);
|
526 |
$content .= '</ul>'."\n";
|
527 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
528 |
return $content;
|
529 |
}
|
530 |
|
@@ -534,7 +644,7 @@ increment_views();
|
|
534 |
function increment_views() {
|
535 |
global $wpdb;
|
536 |
$post_id = intval($_GET['postviews_id']);
|
537 |
-
if($post_id > 0) {
|
538 |
$post_views = get_post_custom($post_id);
|
539 |
$post_views = intval($post_views['views'][0]);
|
540 |
if(!update_post_meta($post_id, 'views', ($post_views+1))) {
|
@@ -544,6 +654,119 @@ function increment_views() {
|
|
544 |
}
|
545 |
|
546 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
547 |
### Function: Post Views Options
|
548 |
add_action('activate_wp-postviews/wp-postviews.php', 'views_init');
|
549 |
function views_init() {
|
@@ -561,5 +784,7 @@ function views_init() {
|
|
561 |
$views_options['template'] = __('%VIEW_COUNT% views', 'wp-postviews');
|
562 |
$views_options['most_viewed_template'] = '<li><a href="%POST_URL%" title="%POST_TITLE%">%POST_TITLE%</a> - %VIEW_COUNT% '.__('views', 'wp-postviews').'</li>';
|
563 |
add_option('views_options', $views_options, 'Post Views Options');
|
|
|
|
|
564 |
}
|
565 |
?>
|
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. Modified by <a href="http://DPotter.net/Technical/" title="David's Technical Musings">David Potter</a> to include options for when and where to display view counts.
|
6 |
+
Version: 1.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
|
59 |
add_action('wp_head', 'process_postviews');
|
60 |
function process_postviews() {
|
61 |
global $user_ID, $post;
|
62 |
+
if(!wp_is_post_revision($post)) {
|
63 |
+
if(is_single() || is_page()) {
|
64 |
+
$id = intval($post->ID);
|
65 |
+
$views_options = get_option('views_options');
|
66 |
+
$post_views = get_post_custom($id);
|
67 |
+
$post_views = intval($post_views['views'][0]);
|
68 |
+
$should_count = false;
|
69 |
+
switch(intval($views_options['count'])) {
|
70 |
+
case 0:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
$should_count = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
break;
|
73 |
+
case 1:
|
74 |
+
if(empty($_COOKIE[USER_COOKIE]) && intval($user_ID) == 0) {
|
75 |
+
$should_count = true;
|
76 |
+
}
|
77 |
+
break;
|
78 |
+
case 2:
|
79 |
+
if(intval($user_ID) > 0) {
|
80 |
+
$should_count = true;
|
81 |
+
}
|
82 |
+
break;
|
83 |
}
|
84 |
+
if(intval($views_options['exclude_bots']) == 1) {
|
85 |
+
$bots = array('Google Bot' => 'googlebot', 'Google Bot' => 'google', 'MSN' => 'msnbot', 'Alex' => 'ia_archiver', 'Lycos' => 'lycos', 'Ask Jeeves' => 'jeeves', 'Altavista' => 'scooter', 'AllTheWeb' => 'fast-webcrawler', 'Inktomi' => 'slurp@inktomi', 'Turnitin.com' => 'turnitinbot', 'Technorati' => 'technorati', 'Yahoo' => 'yahoo', 'Findexa' => 'findexa', 'NextLinks' => 'findlinks', 'Gais' => 'gaisbo', 'WiseNut' => 'zyborg', 'WhoisSource' => 'surveybot', 'Bloglines' => 'bloglines', 'BlogSearch' => 'blogsearch', 'PubSub' => 'pubsub', 'Syndic8' => 'syndic8', 'RadioUserland' => 'userland', 'Gigabot' => 'gigabot', 'Become.com' => 'become.com');
|
86 |
+
$useragent = $_SERVER['HTTP_USER_AGENT'];
|
87 |
+
foreach ($bots as $name => $lookfor) {
|
88 |
+
if (stristr($useragent, $lookfor) !== false) {
|
89 |
+
$should_count = false;
|
90 |
+
break;
|
91 |
+
}
|
92 |
+
}
|
93 |
+
}
|
94 |
+
if($should_count) {
|
95 |
+
if(defined('WP_CACHE') && WP_CACHE) {
|
96 |
+
echo "\n".'<!-- Start Of Script Generated By WP-PostViews 1.50 -->'."\n";
|
97 |
+
wp_print_scripts('jquery');
|
98 |
+
echo '<script type="text/javascript">'."\n";
|
99 |
+
echo '/* <![CDATA[ */'."\n";
|
100 |
+
echo "jQuery.ajax({type:'GET',url:'".plugins_url('wp-postviews/wp-postviews.php')."',data:'postviews_id=".$id."',cache:false});";
|
101 |
+
echo '/* ]]> */'."\n";
|
102 |
+
echo '</script>'."\n";
|
103 |
+
echo '<!-- End Of Script Generated By WP-PostViews 1.50 -->'."\n";
|
104 |
+
} else {
|
105 |
+
if(!update_post_meta($id, 'views', ($post_views+1))) {
|
106 |
+
add_post_meta($id, 'views', 1, true);
|
107 |
+
}
|
108 |
}
|
109 |
}
|
110 |
}
|
183 |
foreach ($most_viewed as $post) {
|
184 |
$post_views = intval($post->views);
|
185 |
$post_title = get_the_title();
|
186 |
+
if($chars > 0) {
|
187 |
+
$post_title = snippet_text($post_title, $chars);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
}
|
189 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password, $chars);
|
190 |
+
$post_content = get_the_content();
|
191 |
+
$temp = stripslashes($views_options['most_viewed_template']);
|
192 |
+
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
193 |
+
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
194 |
+
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
195 |
+
$temp = str_replace("%POST_CONTENT%", $post_content, $temp);
|
196 |
+
$temp = str_replace("%POST_URL%", get_permalink(), $temp);
|
197 |
$output .= $temp;
|
198 |
}
|
199 |
} else {
|
226 |
foreach ($most_viewed as $post) {
|
227 |
$post_views = intval($post->views);
|
228 |
$post_title = get_the_title();
|
229 |
+
if($chars > 0) {
|
230 |
+
$post_title = snippet_text($post_title, $chars);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
}
|
232 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password, $chars);
|
233 |
+
$post_content = get_the_content();
|
234 |
+
$temp = stripslashes($views_options['most_viewed_template']);
|
235 |
+
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
236 |
+
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
237 |
+
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
238 |
+
$temp = str_replace("%POST_CONTENT%", $post_content, $temp);
|
239 |
+
$temp = str_replace("%POST_URL%", get_permalink(), $temp);
|
240 |
$output .= $temp;
|
241 |
}
|
242 |
} else {
|
274 |
foreach ($most_viewed as $post) {
|
275 |
$post_views = intval($post->views);
|
276 |
$post_title = get_the_title();
|
277 |
+
if($chars > 0) {
|
278 |
+
$post_title = snippet_text($post_title, $chars);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
}
|
280 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password, $chars);
|
281 |
+
$post_content = get_the_content();
|
282 |
+
$temp = stripslashes($views_options['most_viewed_template']);
|
283 |
+
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
284 |
+
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
285 |
+
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
286 |
+
$temp = str_replace("%POST_CONTENT%", $post_content, $temp);
|
287 |
+
$temp = str_replace("%POST_URL%", get_permalink(), $temp);
|
288 |
$output .= $temp;
|
289 |
}
|
290 |
} else {
|
322 |
foreach ($most_viewed as $post) {
|
323 |
$post_views = intval($post->views);
|
324 |
$post_title = get_the_title();
|
325 |
+
if($chars > 0) {
|
326 |
+
$post_title = snippet_text($post_title, $chars);
|
327 |
+
}
|
328 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password, $chars);
|
329 |
$post_content = get_the_content();
|
330 |
+
$temp = stripslashes($views_options['most_viewed_template']);
|
331 |
+
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
332 |
+
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
333 |
+
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
334 |
+
$temp = str_replace("%POST_CONTENT%", $post_content, $temp);
|
335 |
+
$temp = str_replace("%POST_URL%", get_permalink(), $temp);
|
336 |
+
$output .= $temp;
|
337 |
+
}
|
338 |
+
} else {
|
339 |
+
$output = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
|
340 |
+
}
|
341 |
+
if($display) {
|
342 |
+
echo $output;
|
343 |
+
} else {
|
344 |
+
return $output;
|
345 |
+
}
|
346 |
+
}
|
347 |
+
}
|
348 |
+
|
349 |
+
|
350 |
+
### Function: Display Most Viewed Page/Post By Tag ID
|
351 |
+
if(!function_exists('get_most_viewed_tag')) {
|
352 |
+
function get_most_viewed_tag($tag_id = 0, $mode = '', $limit = 10, $chars = 0, $display = true) {
|
353 |
+
global $wpdb, $post;
|
354 |
+
$views_options = get_option('views_options');
|
355 |
+
$where = '';
|
356 |
+
$temp = '';
|
357 |
+
$output = '';
|
358 |
+
if(is_array($tag_id)) {
|
359 |
+
$tag_sql = "$wpdb->term_taxonomy.term_id IN (".join(',', $tag_id).')';
|
360 |
+
} else {
|
361 |
+
$tag_sql = "$wpdb->term_taxonomy.term_id = $tag_id";
|
362 |
+
}
|
363 |
+
if(!empty($mode) && $mode != 'both') {
|
364 |
+
$where = "post_type = '$mode'";
|
365 |
+
} else {
|
366 |
+
$where = '1=1';
|
367 |
+
}
|
368 |
+
$most_viewed = $wpdb->get_results("SELECT DISTINCT $wpdb->posts.*, (meta_value+0) AS views FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ON $wpdb->postmeta.post_id = $wpdb->posts.ID INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) WHERE post_date < '".current_time('mysql')."' AND $wpdb->term_taxonomy.taxonomy = 'post_tag' AND $tag_sql AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT $limit");
|
369 |
+
if($most_viewed) {
|
370 |
+
foreach ($most_viewed as $post) {
|
371 |
+
$post_views = intval($post->views);
|
372 |
+
$post_title = get_the_title();
|
373 |
+
if($chars > 0) {
|
374 |
+
$post_title = snippet_text($post_title, $chars);
|
375 |
+
}
|
376 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password, $chars);
|
377 |
+
$post_content = get_the_content();
|
378 |
+
$temp = stripslashes($views_options['most_viewed_template']);
|
379 |
+
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
380 |
+
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
381 |
+
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
382 |
+
$temp = str_replace("%POST_CONTENT%", $post_content, $temp);
|
383 |
+
$temp = str_replace("%POST_URL%", get_permalink(), $temp);
|
384 |
+
$output .= $temp;
|
385 |
+
}
|
386 |
+
} else {
|
387 |
+
$output = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
|
388 |
+
}
|
389 |
+
if($display) {
|
390 |
+
echo $output;
|
391 |
+
} else {
|
392 |
+
return $output;
|
393 |
+
}
|
394 |
+
}
|
395 |
+
}
|
396 |
+
|
397 |
+
|
398 |
+
### Function: Display Least Viewed Page/Post By Tag ID
|
399 |
+
if(!function_exists('get_least_viewed_tag')) {
|
400 |
+
function get_least_viewed_tag($tag_id = 0, $mode = '', $limit = 10, $chars = 0, $display = true) {
|
401 |
+
global $wpdb, $post;
|
402 |
+
$views_options = get_option('views_options');
|
403 |
+
$where = '';
|
404 |
+
$temp = '';
|
405 |
+
$output = '';
|
406 |
+
if(is_array($tag_id)) {
|
407 |
+
$tag_sql = "$wpdb->term_taxonomy.term_id IN (".join(',', $tag_id).')';
|
408 |
+
} else {
|
409 |
+
$tag_sql = "$wpdb->term_taxonomy.term_id = $tag_id";
|
410 |
+
}
|
411 |
+
if(!empty($mode) && $mode != 'both') {
|
412 |
+
$where = "post_type = '$mode'";
|
413 |
+
} else {
|
414 |
+
$where = '1=1';
|
415 |
+
}
|
416 |
+
$most_viewed = $wpdb->get_results("SELECT DISTINCT $wpdb->posts.*, (meta_value+0) AS views FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ON $wpdb->postmeta.post_id = $wpdb->posts.ID INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) WHERE post_date < '".current_time('mysql')."' AND $wpdb->term_taxonomy.taxonomy = 'post_tag' AND $tag_sql AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views ASC LIMIT $limit");
|
417 |
+
if($most_viewed) {
|
418 |
+
foreach ($most_viewed as $post) {
|
419 |
+
$post_views = intval($post->views);
|
420 |
+
$post_title = get_the_title();
|
421 |
+
if($chars > 0) {
|
422 |
+
$post_title = snippet_text($post_title, $chars);
|
423 |
}
|
424 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password, $chars);
|
425 |
+
$post_content = get_the_content();
|
426 |
+
$temp = stripslashes($views_options['most_viewed_template']);
|
427 |
+
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
428 |
+
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
429 |
+
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
430 |
+
$temp = str_replace("%POST_CONTENT%", $post_content, $temp);
|
431 |
+
$temp = str_replace("%POST_URL%", get_permalink(), $temp);
|
432 |
$output .= $temp;
|
433 |
}
|
434 |
} else {
|
480 |
|
481 |
|
482 |
### Function: Process Post Excerpt, For Some Reasons, The Default get_post_excerpt() Does Not Work As Expected
|
483 |
+
function views_post_excerpt($post_excerpt, $post_content, $post_password, $chars = 200) {
|
484 |
if(!empty($post_password)) {
|
485 |
if(!isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || $_COOKIE['wp-postpass_'.COOKIEHASH] != $post_password) {
|
486 |
return __('There is no excerpt because this is a protected post.', 'wp-postviews');
|
487 |
}
|
488 |
}
|
489 |
if(empty($post_excerpt)) {
|
490 |
+
return snippet_text(strip_tags($post_content), $chars);
|
491 |
} else {
|
492 |
return $post_excerpt;
|
493 |
}
|
522 |
|
523 |
### Function: Add Views Custom Fields
|
524 |
add_action('publish_post', 'add_views_fields');
|
525 |
+
add_action('publish_page', 'add_views_fields');
|
526 |
function add_views_fields($post_ID) {
|
527 |
global $wpdb;
|
528 |
+
if(!wp_is_post_revision($post_ID)) {
|
529 |
+
add_post_meta($post_ID, 'views', 0, true);
|
530 |
+
}
|
531 |
}
|
532 |
|
533 |
|
535 |
add_action('delete_post', 'delete_views_fields');
|
536 |
function delete_views_fields($post_ID) {
|
537 |
global $wpdb;
|
538 |
+
if(!wp_is_post_revision($post_ID)) {
|
539 |
+
delete_post_meta($post_ID, 'views');
|
540 |
+
}
|
541 |
}
|
542 |
|
543 |
|
550 |
}
|
551 |
|
552 |
|
553 |
+
### Function: Sort Views Posts
|
554 |
add_action('pre_get_posts', 'views_sorting');
|
555 |
+
function views_sorting($local_wp_query) {
|
556 |
+
if($local_wp_query->get('v_sortby') == 'views') {
|
557 |
add_filter('posts_fields', 'views_fields');
|
558 |
add_filter('posts_join', 'views_join');
|
559 |
add_filter('posts_where', 'views_where');
|
560 |
add_filter('posts_orderby', 'views_orderby');
|
561 |
+
} else {
|
562 |
+
remove_filter('posts_fields', 'views_fields');
|
563 |
+
remove_filter('posts_join', 'views_join');
|
564 |
+
remove_filter('posts_where', 'views_where');
|
565 |
+
remove_filter('posts_orderby', 'views_orderby');
|
566 |
}
|
567 |
}
|
568 |
|
592 |
function postviews_page_admin_most_stats($content) {
|
593 |
$stats_display = get_option('stats_display');
|
594 |
$stats_mostlimit = intval(get_option('stats_mostlimit'));
|
595 |
+
if($stats_display['viewed_most_post'] == 1) {
|
596 |
+
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most_post" value="viewed_most_post" checked="checked" /> <label for="wpstats_viewed_most_post">'.sprintf(_n('%s Most Viewed Post', '%s Most Viewed Posts', $stats_mostlimit, 'wp-postviews'), number_format_i18n($stats_mostlimit)).'</label><br />'."\n";
|
597 |
+
} else {
|
598 |
+
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most_post" value="viewed_most_post" /> <label for="wpstats_viewed_most_post">'.sprintf(_n('%s Most Viewed Post', '%s Most Viewed Posts', $stats_mostlimit, 'wp-postviews'), number_format_i18n($stats_mostlimit)).'</label><br />'."\n";
|
599 |
+
}
|
600 |
+
if($stats_display['viewed_most_page'] == 1) {
|
601 |
+
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most_page" value="viewed_most_page" checked="checked" /> <label for="wpstats_viewed_most_page">'.sprintf(_n('%s Most Viewed Page', '%s Most Viewed Pages', $stats_mostlimit, 'wp-postviews'), number_format_i18n($stats_mostlimit)).'</label><br />'."\n";
|
602 |
} else {
|
603 |
+
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most_page" value="viewed_most_page" /> <label for="wpstats_viewed_most_page">'.sprintf(_n('%s Most Viewed Page', '%s Most Viewed Pages', $stats_mostlimit, 'wp-postviews'), number_format_i18n($stats_mostlimit)).'</label><br />'."\n";
|
604 |
}
|
605 |
return $content;
|
606 |
}
|
612 |
if($stats_display['views'] == 1) {
|
613 |
$content .= '<p><strong>'.__('WP-PostViews', 'wp-postviews').'</strong></p>'."\n";
|
614 |
$content .= '<ul>'."\n";
|
615 |
+
$content .= '<li>'.sprintf(_n('<strong>%s</strong> view was generated.', '<strong>%s</strong> views were generated.', get_totalviews(false), 'wp-postviews'), number_format_i18n(get_totalviews(false))).'</li>'."\n";
|
616 |
$content .= '</ul>'."\n";
|
617 |
}
|
618 |
return $content;
|
623 |
function postviews_page_most_stats($content) {
|
624 |
$stats_display = get_option('stats_display');
|
625 |
$stats_mostlimit = intval(get_option('stats_mostlimit'));
|
626 |
+
if($stats_display['viewed_most_post'] == 1) {
|
627 |
+
$content .= '<p><strong>'.sprintf(_n('%s Most Viewed Post', '%s Most Viewed Posts', $stats_mostlimit, 'wp-postviews'), number_format_i18n($stats_mostlimit)).'</strong></p>'."\n";
|
628 |
$content .= '<ul>'."\n";
|
629 |
$content .= get_most_viewed('post', $stats_mostlimit, 0, false);
|
630 |
$content .= '</ul>'."\n";
|
631 |
}
|
632 |
+
if($stats_display['viewed_most_page'] == 1) {
|
633 |
+
$content .= '<p><strong>'.sprintf(_n('%s Most Viewed Page', '%s Most Viewed Pages', $stats_mostlimit, 'wp-postviews'), number_format_i18n($stats_mostlimit)).'</strong></p>'."\n";
|
634 |
+
$content .= '<ul>'."\n";
|
635 |
+
$content .= get_most_viewed('page', $stats_mostlimit, 0, false);
|
636 |
+
$content .= '</ul>'."\n";
|
637 |
+
}
|
638 |
return $content;
|
639 |
}
|
640 |
|
644 |
function increment_views() {
|
645 |
global $wpdb;
|
646 |
$post_id = intval($_GET['postviews_id']);
|
647 |
+
if($post_id > 0 && defined('WP_CACHE') && WP_CACHE) {
|
648 |
$post_views = get_post_custom($post_id);
|
649 |
$post_views = intval($post_views['views'][0]);
|
650 |
if(!update_post_meta($post_id, 'views', ($post_views+1))) {
|
654 |
}
|
655 |
|
656 |
|
657 |
+
### Class: WP-PostViews Widget
|
658 |
+
class WP_Widget_PostViews extends WP_Widget {
|
659 |
+
// Constructor
|
660 |
+
function WP_Widget_PostViews() {
|
661 |
+
$widget_ops = array('description' => __('WP-PostViews views statistics', 'wp-postviews'));
|
662 |
+
$this->WP_Widget('views', __('Views', 'wp-postviews'), $widget_ops);
|
663 |
+
}
|
664 |
+
|
665 |
+
// Display Widget
|
666 |
+
function widget($args, $instance) {
|
667 |
+
extract($args);
|
668 |
+
$title = apply_filters('widget_title', esc_attr($instance['title']));
|
669 |
+
$type = esc_attr($instance['type']);
|
670 |
+
$mode = esc_attr($instance['mode']);
|
671 |
+
$limit = intval($instance['limit']);
|
672 |
+
$chars = intval($instance['chars']);
|
673 |
+
$cat_ids = explode(',', esc_attr($instance['cat_ids']));
|
674 |
+
echo $before_widget.$before_title.$title.$after_title;
|
675 |
+
echo '<ul>'."\n";
|
676 |
+
switch($type) {
|
677 |
+
case 'least_viewed':
|
678 |
+
get_least_viewed($mode, $limit, $chars);
|
679 |
+
break;
|
680 |
+
case 'most_viewed':
|
681 |
+
get_most_viewed($mode, $limit, $chars);
|
682 |
+
break;
|
683 |
+
case 'most_viewed_category':
|
684 |
+
get_most_viewed_category($cat_ids, $mode, $limit, $chars);
|
685 |
+
break;
|
686 |
+
case 'least_viewed_category':
|
687 |
+
get_least_viewed_category($cat_ids, $mode, $limit, $chars);
|
688 |
+
break;
|
689 |
+
}
|
690 |
+
echo '</ul>'."\n";
|
691 |
+
echo $after_widget;
|
692 |
+
}
|
693 |
+
|
694 |
+
// When Widget Control Form Is Posted
|
695 |
+
function update($new_instance, $old_instance) {
|
696 |
+
if (!isset($new_instance['submit'])) {
|
697 |
+
return false;
|
698 |
+
}
|
699 |
+
$instance = $old_instance;
|
700 |
+
$instance['title'] = strip_tags($new_instance['title']);
|
701 |
+
$instance['type'] = strip_tags($new_instance['type']);
|
702 |
+
$instance['mode'] = strip_tags($new_instance['mode']);
|
703 |
+
$instance['limit'] = intval($new_instance['limit']);
|
704 |
+
$instance['chars'] = intval($new_instance['chars']);
|
705 |
+
$instance['cat_ids'] = strip_tags($new_instance['cat_ids']);
|
706 |
+
return $instance;
|
707 |
+
}
|
708 |
+
|
709 |
+
// DIsplay Widget Control Form
|
710 |
+
function form($instance) {
|
711 |
+
global $wpdb;
|
712 |
+
$instance = wp_parse_args((array) $instance, array('title' => __('Views', 'wp-postviews'), 'type' => 'most_viewed', 'mode' => 'both', 'limit' => 10, 'chars' => 200, 'cat_ids' => '0'));
|
713 |
+
$title = esc_attr($instance['title']);
|
714 |
+
$type = esc_attr($instance['type']);
|
715 |
+
$mode = esc_attr($instance['mode']);
|
716 |
+
$limit = intval($instance['limit']);
|
717 |
+
$chars = intval($instance['chars']);
|
718 |
+
$cat_ids = esc_attr($instance['cat_ids']);
|
719 |
+
?>
|
720 |
+
<p>
|
721 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'wp-postviews'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label>
|
722 |
+
</p>
|
723 |
+
<p>
|
724 |
+
<label for="<?php echo $this->get_field_id('type'); ?>"><?php _e('Statistics Type:', 'wp-postviews'); ?>
|
725 |
+
<select name="<?php echo $this->get_field_name('type'); ?>" id="<?php echo $this->get_field_id('type'); ?>" class="widefat">
|
726 |
+
<option value="least_viewed"<?php selected('least_viewed', $type); ?>><?php _e('Least Viewed', 'wp-postviews'); ?></option>
|
727 |
+
<option value="least_viewed_category"<?php selected('least_viewed_category', $type); ?>><?php _e('Least Viewed By Category', 'wp-postviews'); ?></option>
|
728 |
+
<optgroup> </optgroup>
|
729 |
+
<option value="most_viewed"<?php selected('most_viewed', $type); ?>><?php _e('Most Viewed', 'wp-postviews'); ?></option>
|
730 |
+
<option value="most_viewed_category"<?php selected('most_viewed_category', $type); ?>><?php _e('Most Viewed By Category', 'wp-postviews'); ?></option>
|
731 |
+
</select>
|
732 |
+
</label>
|
733 |
+
</p>
|
734 |
+
<p>
|
735 |
+
<label for="<?php echo $this->get_field_id('mode'); ?>"><?php _e('Include Views From:', 'wp-postviews'); ?>
|
736 |
+
<select name="<?php echo $this->get_field_name('mode'); ?>" id="<?php echo $this->get_field_id('mode'); ?>" class="widefat">
|
737 |
+
<option value="both"<?php selected('both', $mode); ?>><?php _e('Posts & Pages', 'wp-postviews'); ?></option>
|
738 |
+
<option value="post"<?php selected('post', $mode); ?>><?php _e('Posts Only', 'wp-postviews'); ?></option>
|
739 |
+
<option value="page"<?php selected('page', $mode); ?>><?php _e('Pages Only', 'wp-postviews'); ?></option>
|
740 |
+
</select>
|
741 |
+
</label>
|
742 |
+
</p>
|
743 |
+
<p>
|
744 |
+
<label for="<?php echo $this->get_field_id('limit'); ?>"><?php _e('No. Of Records To Show:', 'wp-postviews'); ?> <input class="widefat" id="<?php echo $this->get_field_id('limit'); ?>" name="<?php echo $this->get_field_name('limit'); ?>" type="text" value="<?php echo $limit; ?>" /></label>
|
745 |
+
</p>
|
746 |
+
<p>
|
747 |
+
<label for="<?php echo $this->get_field_id('chars'); ?>"><?php _e('Maximum Post Title Length (Characters):', 'wp-postviews'); ?> <input class="widefat" id="<?php echo $this->get_field_id('chars'); ?>" name="<?php echo $this->get_field_name('chars'); ?>" type="text" value="<?php echo $chars; ?>" /></label><br />
|
748 |
+
<small><?php _e('<strong>0</strong> to disable.', 'wp-postviews'); ?></small>
|
749 |
+
</p>
|
750 |
+
<p>
|
751 |
+
<label for="<?php echo $this->get_field_id('cat_ids'); ?>"><?php _e('Category IDs:', 'wp-postviews'); ?> <span style="color: red;">*</span> <input class="widefat" id="<?php echo $this->get_field_id('cat_ids'); ?>" name="<?php echo $this->get_field_name('cat_ids'); ?>" type="text" value="<?php echo $cat_ids; ?>" /></label><br />
|
752 |
+
<small><?php _e('Seperate mutiple categories with commas.', 'wp-postviews'); ?></small>
|
753 |
+
</p>
|
754 |
+
<p style="color: red;">
|
755 |
+
<small><?php _e('* If you are not using any category statistics, you can ignore it.', 'wp-postviews'); ?></small>
|
756 |
+
<p>
|
757 |
+
<input type="hidden" id="<?php echo $this->get_field_id('submit'); ?>" name="<?php echo $this->get_field_name('submit'); ?>" value="1" />
|
758 |
+
<?php
|
759 |
+
}
|
760 |
+
}
|
761 |
+
|
762 |
+
|
763 |
+
### Function: Init WP-PostViews Widget
|
764 |
+
add_action('widgets_init', 'widget_views_init');
|
765 |
+
function widget_views_init() {
|
766 |
+
register_widget('WP_Widget_PostViews');
|
767 |
+
}
|
768 |
+
|
769 |
+
|
770 |
### Function: Post Views Options
|
771 |
add_action('activate_wp-postviews/wp-postviews.php', 'views_init');
|
772 |
function views_init() {
|
784 |
$views_options['template'] = __('%VIEW_COUNT% views', 'wp-postviews');
|
785 |
$views_options['most_viewed_template'] = '<li><a href="%POST_URL%" title="%POST_TITLE%">%POST_TITLE%</a> - %VIEW_COUNT% '.__('views', 'wp-postviews').'</li>';
|
786 |
add_option('views_options', $views_options, 'Post Views Options');
|
787 |
+
// Veersion 1.50 Upgrade
|
788 |
+
delete_option('widget_views_most_viewed');
|
789 |
}
|
790 |
?>
|
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:
|
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"
|
@@ -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;
|
15 |
"X-Poedit-Basepath: .\n"
|
16 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
17 |
"X-Poedit-SearchPath-0: .\n"
|
@@ -65,12 +65,12 @@ msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-PostVie
|
|
65 |
msgstr ""
|
66 |
|
67 |
#: postviews-options.php:125
|
68 |
-
#: wp-postviews.php:
|
69 |
msgid "%VIEW_COUNT% views"
|
70 |
msgstr ""
|
71 |
|
72 |
#: postviews-options.php:128
|
73 |
-
#: wp-postviews.php:
|
74 |
msgid "views"
|
75 |
msgstr ""
|
76 |
|
@@ -231,90 +231,124 @@ msgid ""
|
|
231 |
" Choose [Cancel] To Stop, [OK] To Uninstall."
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: wp-postviews
|
235 |
-
msgid "
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: wp-postviews
|
239 |
-
|
|
|
|
|
|
|
|
|
|
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: wp-postviews
|
243 |
-
msgid "
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: wp-postviews
|
247 |
-
|
|
|
|
|
248 |
msgstr ""
|
249 |
|
250 |
-
#: wp-postviews
|
251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
msgstr ""
|
253 |
|
254 |
-
#: wp-postviews
|
255 |
-
|
|
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: wp-postviews
|
259 |
-
msgid "
|
260 |
msgstr ""
|
261 |
|
262 |
-
#: wp-postviews
|
263 |
-
msgid "
|
264 |
msgstr ""
|
265 |
|
266 |
-
#: wp-postviews
|
267 |
-
msgid "
|
268 |
msgstr ""
|
269 |
|
270 |
-
#: wp-postviews
|
271 |
-
msgid "
|
272 |
msgstr ""
|
273 |
|
274 |
-
#: wp-postviews.php:
|
275 |
-
msgid "
|
276 |
msgstr ""
|
277 |
|
278 |
-
#: wp-postviews.php:
|
279 |
-
|
280 |
-
|
281 |
-
#: wp-postviews.php:334
|
282 |
-
#, php-format
|
283 |
-
msgid "%s view"
|
284 |
-
msgid_plural "%s views"
|
285 |
-
msgstr[0] ""
|
286 |
-
msgstr[1] ""
|
287 |
|
288 |
-
#: wp-postviews.php:
|
289 |
-
|
290 |
-
#: wp-postviews.php:297
|
291 |
-
#: wp-postviews.php:346
|
292 |
-
msgid "N/A"
|
293 |
msgstr ""
|
294 |
|
295 |
-
#: wp-postviews.php:
|
296 |
-
msgid "
|
297 |
msgstr ""
|
298 |
|
299 |
-
#: wp-postviews.php:
|
300 |
-
|
301 |
-
#: wp-postviews.php:509
|
302 |
-
msgid "WP-PostViews"
|
303 |
msgstr ""
|
304 |
|
305 |
-
#: wp-postviews.php:
|
306 |
-
|
307 |
-
|
308 |
-
#, php-format
|
309 |
-
msgid "%s Most Viewed Post"
|
310 |
-
msgid_plural "%s Most Viewed Posts"
|
311 |
-
msgstr[0] ""
|
312 |
-
msgstr[1] ""
|
313 |
|
314 |
-
#: wp-postviews.php:
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: WP-PostViews 1.50\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2009-06-12 19:08+0800\n"
|
6 |
+
"PO-Revision-Date: 2009-06-12 19:08+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;_n:1,2;__ngettext_noop:1,2\n"
|
15 |
"X-Poedit-Basepath: .\n"
|
16 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
17 |
"X-Poedit-SearchPath-0: .\n"
|
65 |
msgstr ""
|
66 |
|
67 |
#: postviews-options.php:125
|
68 |
+
#: wp-postviews.php:784
|
69 |
msgid "%VIEW_COUNT% views"
|
70 |
msgstr ""
|
71 |
|
72 |
#: postviews-options.php:128
|
73 |
+
#: wp-postviews.php:785
|
74 |
msgid "views"
|
75 |
msgstr ""
|
76 |
|
231 |
" Choose [Cancel] To Stop, [OK] To Uninstall."
|
232 |
msgstr ""
|
233 |
|
234 |
+
#: wp-postviews.php:53
|
235 |
+
msgid "PostViews"
|
236 |
msgstr ""
|
237 |
|
238 |
+
#: wp-postviews.php:200
|
239 |
+
#: wp-postviews.php:243
|
240 |
+
#: wp-postviews.php:291
|
241 |
+
#: wp-postviews.php:339
|
242 |
+
#: wp-postviews.php:387
|
243 |
+
#: wp-postviews.php:435
|
244 |
+
msgid "N/A"
|
245 |
msgstr ""
|
246 |
|
247 |
+
#: wp-postviews.php:486
|
248 |
+
msgid "There is no excerpt because this is a protected post."
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: wp-postviews.php:583
|
252 |
+
#: wp-postviews.php:585
|
253 |
+
#: wp-postviews.php:613
|
254 |
+
msgid "WP-PostViews"
|
255 |
msgstr ""
|
256 |
|
257 |
+
#: wp-postviews.php:596
|
258 |
+
#: wp-postviews.php:598
|
259 |
+
#: wp-postviews.php:627
|
260 |
+
#, php-format
|
261 |
+
msgid "%s Most Viewed Post"
|
262 |
+
msgid_plural "%s Most Viewed Posts"
|
263 |
+
msgstr[0] ""
|
264 |
+
msgstr[1] ""
|
265 |
+
|
266 |
+
#: wp-postviews.php:601
|
267 |
+
#: wp-postviews.php:603
|
268 |
+
#: wp-postviews.php:633
|
269 |
+
#, php-format
|
270 |
+
msgid "%s Most Viewed Page"
|
271 |
+
msgid_plural "%s Most Viewed Pages"
|
272 |
+
msgstr[0] ""
|
273 |
+
msgstr[1] ""
|
274 |
+
|
275 |
+
#: wp-postviews.php:615
|
276 |
+
#, php-format
|
277 |
+
msgid "<strong>%s</strong> view was generated."
|
278 |
+
msgid_plural "<strong>%s</strong> views were generated."
|
279 |
+
msgstr[0] ""
|
280 |
+
msgstr[1] ""
|
281 |
+
|
282 |
+
#: wp-postviews.php:661
|
283 |
+
msgid "WP-PostViews views statistics"
|
284 |
msgstr ""
|
285 |
|
286 |
+
#: wp-postviews.php:662
|
287 |
+
#: wp-postviews.php:712
|
288 |
+
msgid "Views"
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: wp-postviews.php:721
|
292 |
+
msgid "Title:"
|
293 |
msgstr ""
|
294 |
|
295 |
+
#: wp-postviews.php:724
|
296 |
+
msgid "Statistics Type:"
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: wp-postviews.php:726
|
300 |
+
msgid "Least Viewed"
|
301 |
msgstr ""
|
302 |
|
303 |
+
#: wp-postviews.php:727
|
304 |
+
msgid "Least Viewed By Category"
|
305 |
msgstr ""
|
306 |
|
307 |
+
#: wp-postviews.php:729
|
308 |
+
msgid "Most Viewed"
|
309 |
msgstr ""
|
310 |
|
311 |
+
#: wp-postviews.php:730
|
312 |
+
msgid "Most Viewed By Category"
|
313 |
+
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
|
315 |
+
#: wp-postviews.php:735
|
316 |
+
msgid "Include Views From:"
|
|
|
|
|
|
|
317 |
msgstr ""
|
318 |
|
319 |
+
#: wp-postviews.php:737
|
320 |
+
msgid "Posts & Pages"
|
321 |
msgstr ""
|
322 |
|
323 |
+
#: wp-postviews.php:738
|
324 |
+
msgid "Posts Only"
|
|
|
|
|
325 |
msgstr ""
|
326 |
|
327 |
+
#: wp-postviews.php:739
|
328 |
+
msgid "Pages Only"
|
329 |
+
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
330 |
|
331 |
+
#: wp-postviews.php:744
|
332 |
+
msgid "No. Of Records To Show:"
|
333 |
+
msgstr ""
|
334 |
+
|
335 |
+
#: wp-postviews.php:747
|
336 |
+
msgid "Maximum Post Title Length (Characters):"
|
337 |
+
msgstr ""
|
338 |
+
|
339 |
+
#: wp-postviews.php:748
|
340 |
+
msgid "<strong>0</strong> to disable."
|
341 |
+
msgstr ""
|
342 |
+
|
343 |
+
#: wp-postviews.php:751
|
344 |
+
msgid "Category IDs:"
|
345 |
+
msgstr ""
|
346 |
+
|
347 |
+
#: wp-postviews.php:752
|
348 |
+
msgid "Seperate mutiple categories with commas."
|
349 |
+
msgstr ""
|
350 |
+
|
351 |
+
#: wp-postviews.php:755
|
352 |
+
msgid "* If you are not using any category statistics, you can ignore it."
|
353 |
+
msgstr ""
|
354 |
|