Version Description
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-PostViews |
Version | 1.40 |
Comparing to | |
See all releases |
Code changes from version 1.31 to 1.40
- postviews-options.php +77 -6
- readme.html +63 -11
- readme.txt +2 -2
- wp-postviews-widget.php +5 -5
- wp-postviews.mo +0 -0
- wp-postviews.php +198 -52
- wp-postviews.pot +137 -58
postviews-options.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
-
| WordPress 2.
|
6 |
| Copyright (c) 2008 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
@@ -32,6 +32,12 @@ if(!empty($_POST['Submit'])) {
|
|
32 |
$views_options = array();
|
33 |
$views_options['count'] = intval($_POST['views_count']);
|
34 |
$views_options['exclude_bots'] = intval($_POST['views_exclude_bots']);
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
$views_options['template'] = trim($_POST['views_template_template']);
|
36 |
$views_options['most_viewed_template'] = trim($_POST['views_template_most_viewed']);
|
37 |
$update_views_queries = array();
|
@@ -128,7 +134,8 @@ switch($mode) {
|
|
128 |
</script>
|
129 |
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
130 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
131 |
-
<div class="wrap">
|
|
|
132 |
<h2><?php _e('Post Views Options', 'wp-postviews'); ?></h2>
|
133 |
<table class="form-table">
|
134 |
<tr>
|
@@ -177,6 +184,70 @@ switch($mode) {
|
|
177 |
</td>
|
178 |
</tr>
|
179 |
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
<p class="submit">
|
181 |
<input type="submit" name="Submit" class="button" value="<?php _e('Save Changes', 'wp-postviews'); ?>" />
|
182 |
</p>
|
@@ -187,15 +258,15 @@ switch($mode) {
|
|
187 |
<!-- Uninstall WP-PostViews -->
|
188 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
189 |
<div class="wrap">
|
190 |
-
<
|
191 |
-
<p
|
192 |
<?php _e('Deactivating WP-PostViews plugin does not remove any data that may have been created, such as the views data. To completely remove this plugin, you can uninstall it here.', 'wp-postviews'); ?>
|
193 |
</p>
|
194 |
-
<p style="
|
195 |
<strong><?php _e('WARNING:', 'wp-postviews'); ?></strong><br />
|
196 |
<?php _e('Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.', 'wp-postviews'); ?>
|
197 |
</p>
|
198 |
-
<p style="
|
199 |
<strong><?php _e('The following WordPress Options/PostMetas will be DELETED:', 'wp-postviews'); ?></strong><br />
|
200 |
</p>
|
201 |
<table class="widefat">
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
+
| WordPress 2.6 Plugin: WP-PostViews 1.40 |
|
6 |
| Copyright (c) 2008 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
32 |
$views_options = array();
|
33 |
$views_options['count'] = intval($_POST['views_count']);
|
34 |
$views_options['exclude_bots'] = intval($_POST['views_exclude_bots']);
|
35 |
+
$views_options['display_home'] = intval($_POST['views_display_home']);
|
36 |
+
$views_options['display_single'] = intval($_POST['views_display_single']);
|
37 |
+
$views_options['display_page'] = intval($_POST['views_display_page']);
|
38 |
+
$views_options['display_archive'] = intval($_POST['views_display_archive']);
|
39 |
+
$views_options['display_search'] = intval($_POST['views_display_search']);
|
40 |
+
$views_options['display_other'] = intval($_POST['views_display_other']);
|
41 |
$views_options['template'] = trim($_POST['views_template_template']);
|
42 |
$views_options['most_viewed_template'] = trim($_POST['views_template_most_viewed']);
|
43 |
$update_views_queries = array();
|
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['REQUEST_URI']; ?>">
|
137 |
+
<div class="wrap">
|
138 |
+
<?php screen_icon(); ?>
|
139 |
<h2><?php _e('Post Views Options', 'wp-postviews'); ?></h2>
|
140 |
<table class="form-table">
|
141 |
<tr>
|
184 |
</td>
|
185 |
</tr>
|
186 |
</table>
|
187 |
+
<h3><?php _e('Display Options', 'wp-postviews'); ?></h3>
|
188 |
+
<p><?php _e('These options specify where the view counts should be displayed and to whom. By default view counts will be displayed to all visitors. Note that the theme files must contain a call to <code>the_views()</code> in order for any view count to be displayed.', 'wp-postviews'); ?></p>
|
189 |
+
<table class="form-table">
|
190 |
+
<tr>
|
191 |
+
<td valign="top"><strong><?php _e('Home Page:', 'wp-postviews'); ?></strong></td>
|
192 |
+
<td>
|
193 |
+
<select name="views_display_home" size="1">
|
194 |
+
<option value="0"<?php selected('0', $views_options['display_home']); ?>><?php _e('Display to everyone', 'wp-postviews'); ?></option>
|
195 |
+
<option value="1"<?php selected('1', $views_options['display_home']); ?>><?php _e('Display to registered users only', 'wp-postviews'); ?></option>
|
196 |
+
<option value="2"<?php selected('2', $views_options['display_home']); ?>><?php _e('Don\'t display on home page', 'wp-postviews'); ?></option>
|
197 |
+
</select>
|
198 |
+
</td>
|
199 |
+
</tr>
|
200 |
+
<tr>
|
201 |
+
<td valign="top"><strong><?php _e('Singe Posts:', 'wp-postviews'); ?></strong></td>
|
202 |
+
<td>
|
203 |
+
<select name="views_display_single" size="1">
|
204 |
+
<option value="0"<?php selected('0', $views_options['display_single']); ?>><?php _e('Display to everyone', 'wp-postviews'); ?></option>
|
205 |
+
<option value="1"<?php selected('1', $views_options['display_single']); ?>><?php _e('Display to registered users only', 'wp-postviews'); ?></option>
|
206 |
+
<option value="2"<?php selected('2', $views_options['display_single']); ?>><?php _e('Don\'t display on single posts', 'wp-postviews'); ?></option>
|
207 |
+
</select>
|
208 |
+
</td>
|
209 |
+
</tr>
|
210 |
+
<tr>
|
211 |
+
<td valign="top"><strong><?php _e('Pages:', 'wp-postviews'); ?></strong></td>
|
212 |
+
<td>
|
213 |
+
<select name="views_display_page" size="1">
|
214 |
+
<option value="0"<?php selected('0', $views_options['display_page']); ?>><?php _e('Display to everyone', 'wp-postviews'); ?></option>
|
215 |
+
<option value="1"<?php selected('1', $views_options['display_page']); ?>><?php _e('Display to registered users only', 'wp-postviews'); ?></option>
|
216 |
+
<option value="2"<?php selected('2', $views_options['display_page']); ?>><?php _e('Don\'t display on pages', 'wp-postviews'); ?></option>
|
217 |
+
</select>
|
218 |
+
</td>
|
219 |
+
</tr>
|
220 |
+
<tr>
|
221 |
+
<td valign="top"><strong><?php _e('Archive Pages:', 'wp-postviews'); ?></strong></td>
|
222 |
+
<td>
|
223 |
+
<select name="views_display_archive" size="1">
|
224 |
+
<option value="0"<?php selected('0', $views_options['display_archive']); ?>><?php _e('Display to everyone', 'wp-postviews'); ?></option>
|
225 |
+
<option value="1"<?php selected('1', $views_options['display_archive']); ?>><?php _e('Display to registered users only', 'wp-postviews'); ?></option>
|
226 |
+
<option value="2"<?php selected('2', $views_options['display_archive']); ?>><?php _e('Don\'t display on archive pages', 'wp-postviews'); ?></option>
|
227 |
+
</select>
|
228 |
+
</td>
|
229 |
+
</tr>
|
230 |
+
<tr>
|
231 |
+
<td valign="top"><strong><?php _e('Search Pages:', 'wp-postviews'); ?></strong></td>
|
232 |
+
<td>
|
233 |
+
<select name="views_display_search" size="1">
|
234 |
+
<option value="0"<?php selected('0', $views_options['display_search']); ?>><?php _e('Display to everyone', 'wp-postviews'); ?></option>
|
235 |
+
<option value="1"<?php selected('1', $views_options['display_search']); ?>><?php _e('Display to registered users only', 'wp-postviews'); ?></option>
|
236 |
+
<option value="2"<?php selected('2', $views_options['display_search']); ?>><?php _e('Don\'t display on search pages', 'wp-postviews'); ?></option>
|
237 |
+
</select>
|
238 |
+
</td>
|
239 |
+
</tr>
|
240 |
+
<tr>
|
241 |
+
<td valign="top"><strong><?php _e('Other Pages:', 'wp-postviews'); ?></strong></td>
|
242 |
+
<td>
|
243 |
+
<select name="views_display_other" size="1">
|
244 |
+
<option value="0"<?php selected('0', $views_options['display_other']); ?>><?php _e('Display to everyone', 'wp-postviews'); ?></option>
|
245 |
+
<option value="1"<?php selected('1', $views_options['display_other']); ?>><?php _e('Display to registered users only', 'wp-postviews'); ?></option>
|
246 |
+
<option value="2"<?php selected('2', $views_options['display_other']); ?>><?php _e('Don\'t display on other pages', 'wp-postviews'); ?></option>
|
247 |
+
</select>
|
248 |
+
</td>
|
249 |
+
</tr>
|
250 |
+
</table>
|
251 |
<p class="submit">
|
252 |
<input type="submit" name="Submit" class="button" value="<?php _e('Save Changes', 'wp-postviews'); ?>" />
|
253 |
</p>
|
258 |
<!-- Uninstall WP-PostViews -->
|
259 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
260 |
<div class="wrap">
|
261 |
+
<h3><?php _e('Uninstall WP-PostViews', 'wp-postviews'); ?></h3>
|
262 |
+
<p>
|
263 |
<?php _e('Deactivating WP-PostViews plugin does not remove any data that may have been created, such as the views data. To completely remove this plugin, you can uninstall it here.', 'wp-postviews'); ?>
|
264 |
</p>
|
265 |
+
<p style="color: red">
|
266 |
<strong><?php _e('WARNING:', 'wp-postviews'); ?></strong><br />
|
267 |
<?php _e('Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.', 'wp-postviews'); ?>
|
268 |
</p>
|
269 |
+
<p style="color: red">
|
270 |
<strong><?php _e('The following WordPress Options/PostMetas will be DELETED:', 'wp-postviews'); ?></strong><br />
|
271 |
</p>
|
272 |
<table class="widefat">
|
readme.html
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
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,8 @@
|
|
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,8 +260,10 @@
|
|
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="
|
|
|
|
|
264 |
</p>
|
265 |
<p>
|
266 |
<strong>Note:</strong><br />
|
@@ -281,6 +284,19 @@
|
|
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>
|
@@ -372,7 +388,7 @@
|
|
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.
|
376 |
<ol>
|
377 |
<li>
|
378 |
<strong>Deactivate</strong> WP-PostViews Plugin
|
@@ -430,7 +446,7 @@
|
|
430 |
<strong>Activate</strong> WP-PostViews Widget Plugin
|
431 |
</li>
|
432 |
<li>
|
433 |
-
Go to '<strong>WP-Admin ->
|
434 |
</li>
|
435 |
<li>
|
436 |
To Display <strong>Most Viewed Post</strong>
|
@@ -448,7 +464,25 @@
|
|
448 |
<div class="SubSubTitle">View Stats (Outside WP Loop)</div>
|
449 |
<ul>
|
450 |
<li>
|
451 |
-
To Display <strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
452 |
</li>
|
453 |
<li>
|
454 |
Use:
|
@@ -466,7 +500,25 @@
|
|
466 |
<p>Default: get_most_viewed('both', 10);</p>
|
467 |
</li>
|
468 |
<li>
|
469 |
-
To Display <strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
470 |
</li>
|
471 |
<li>
|
472 |
Use:
|
@@ -501,6 +553,6 @@
|
|
501 |
</div>
|
502 |
</div>
|
503 |
</div>
|
504 |
-
<p id="Copyright">WP-PostViews 1.
|
505 |
</body>
|
506 |
</html>
|
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
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.40 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.40 <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.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 />
|
240 |
<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 />
|
241 |
</p>
|
260 |
</p>
|
261 |
<p>
|
262 |
<strong>Credits:</strong><br />
|
263 |
+
<strong>»</strong> WP-Cache/WP-SuperCache Compatibility By <a href="http://omninoggin.com/" title="Thaya Kareeson">Thaya Kareeson</a>.<br />
|
264 |
+
<strong>»</strong> __ngetext() by <a href="http://hweia.ru/" title="Anna Ozeritskaya">Anna Ozeritskaya</a>.<br />
|
265 |
+
<strong>»</strong> Right To Left Language Support by <a href="http://persian-programming.com/" title="Kambiz R. Khojasteh">Kambiz R. Khojasteh</a>.
|
266 |
+
<strong>»</strong> Options To Display Views On Certain Places by <a href="http://dpotter.net/Technical/" title="David Potter">David Potter</a>.
|
267 |
</p>
|
268 |
<p>
|
269 |
<strong>Note:</strong><br />
|
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>
|
290 |
+
<li>NEW: Works For WordPress 2.7 Only</li>
|
291 |
+
<li>NEW: Options To Display Views On Certain Places by <a href="http://dpotter.net/Technical/" title="http://dpotter.net/Technical/">David Potter</a></li>
|
292 |
+
<li>NEW: Right To Left Language Support by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a></li>
|
293 |
+
<li>NEW: Output Of the_views() Applied To "the_views" Filter by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a>
|
294 |
+
<li>NEW: Called postviews_textdomain() In views_init() by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a></li>
|
295 |
+
<li>NEW: Uses plugins_url() And site_url()</li>
|
296 |
+
<li>NEW: Added get_least_viewed() And get_least_viewed_category() By <a href="http://foo.upc.es/blog/" title="http://foo.upc.es/blog/">JBrinx</li>
|
297 |
+
<li>FIXED: "views" Custom Field Gets Created Now When Post Is Published</li>
|
298 |
+
</ul>
|
299 |
+
</li>
|
300 |
<li>
|
301 |
<strong>Version 1.31 (16-07-2008)</strong>
|
302 |
<ul>
|
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.40</div>
|
392 |
<ol>
|
393 |
<li>
|
394 |
<strong>Deactivate</strong> WP-PostViews Plugin
|
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 |
To Display <strong>Most Viewed Post</strong>
|
464 |
<div class="SubSubTitle">View Stats (Outside WP Loop)</div>
|
465 |
<ul>
|
466 |
<li>
|
467 |
+
To Display <strong>Least Viewed Posts</strong>
|
468 |
+
</li>
|
469 |
+
<li>
|
470 |
+
Use:
|
471 |
+
<blockquote>
|
472 |
+
<?php if (function_exists('get_least_viewed')): ?><br />
|
473 |
+
<ul><br />
|
474 |
+
<?php get_least_viewed(); ?><br />
|
475 |
+
</ul><br />
|
476 |
+
<?php endif; ?>
|
477 |
+
</blockquote>
|
478 |
+
<p>
|
479 |
+
The <strong>first value</strong> you pass in is what you want to get, 'post', 'page' or 'both'.<br />
|
480 |
+
The <strong>second value</strong> you pass in is the maximum number of post you want to get.
|
481 |
+
</p>
|
482 |
+
<p>Default: get_least_viewed('both', 10);</p>
|
483 |
+
</li>
|
484 |
+
<li>
|
485 |
+
To Display <strong>Most Viewed Posts</strong>
|
486 |
</li>
|
487 |
<li>
|
488 |
Use:
|
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>
|
505 |
+
<li>
|
506 |
+
Use:
|
507 |
+
<blockquote>
|
508 |
+
<?php if (function_exists('get_least_viewed_category')): ?><br />
|
509 |
+
<ul><br />
|
510 |
+
<?php get_least_viewed_category(); ?><br />
|
511 |
+
</ul><br />
|
512 |
+
<?php endif; ?>
|
513 |
+
</blockquote>
|
514 |
+
<p>
|
515 |
+
The <strong>first value</strong> you pass in is the category id.<br />
|
516 |
+
The <strong>second value</strong> you pass in is what you want to get, 'post', 'page' or 'both'.<br />
|
517 |
+
The <strong>third value</strong> you pass in is the maximum number of post you want to get.</p>
|
518 |
+
<p>Default: get_least_viewed_category(1, 'both', 10);</p>
|
519 |
+
</li>
|
520 |
+
<li>
|
521 |
+
To Display <strong>Most Viewed Posts For A Category</strong>
|
522 |
</li>
|
523 |
<li>
|
524 |
Use:
|
553 |
</div>
|
554 |
</div>
|
555 |
</div>
|
556 |
+
<p id="Copyright">WP-PostViews 1.40<br />Copyright © 2008 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
|
557 |
</body>
|
558 |
</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.7
|
6 |
+
Stable tag: 1.40
|
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 |
*/
|
@@ -61,10 +61,10 @@ function widget_views_init() {
|
|
61 |
$options['chars'] = intval($_POST['most_viewed-chars']);
|
62 |
update_option('widget_views_most_viewed', $options);
|
63 |
}
|
64 |
-
echo '<p
|
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
|
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";
|
@@ -86,10 +86,10 @@ function widget_views_init() {
|
|
86 |
echo '</select> ';
|
87 |
_e('Only', 'wp-postviews');
|
88 |
echo '</p>'."\n";
|
89 |
-
echo '<p
|
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
|
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');
|
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 |
*/
|
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";
|
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');
|
wp-postviews.mo
CHANGED
Binary file
|
wp-postviews.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
/*
|
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 |
*/
|
@@ -39,29 +39,10 @@ if (!function_exists('add_action')) {
|
|
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 |
-
|
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 |
|
@@ -69,7 +50,7 @@ function postviews_textdomain() {
|
|
69 |
add_action('admin_menu', 'postviews_menu');
|
70 |
function postviews_menu() {
|
71 |
if (function_exists('add_options_page')) {
|
72 |
-
add_options_page(__('
|
73 |
}
|
74 |
}
|
75 |
|
@@ -111,11 +92,11 @@ function process_postviews() {
|
|
111 |
}
|
112 |
if($should_count) {
|
113 |
if(defined('WP_CACHE') && WP_CACHE) {
|
114 |
-
echo "\n".'<!-- Start Of Script Generated By WP-PostViews 1.
|
115 |
wp_print_scripts(array('sack'));
|
116 |
echo '<script type="text/javascript">'."\n";
|
117 |
echo '/* <![CDATA[ */'."\n";
|
118 |
-
echo "\t".'var postviews_ajax_url = \''.
|
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,7 +104,7 @@ function process_postviews() {
|
|
123 |
echo "\t".'postviews_count = null;'."\n";
|
124 |
echo '/* ]]> */'."\n";
|
125 |
echo '</script>'."\n";
|
126 |
-
echo '<!-- End Of Script Generated By WP-PostViews 1.
|
127 |
} else {
|
128 |
if(!update_post_meta($id, 'views', ($post_views+1))) {
|
129 |
add_post_meta($id, 'views', 1, true);
|
@@ -134,15 +115,99 @@ function process_postviews() {
|
|
134 |
}
|
135 |
|
136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
### Function: Display The Post Views
|
138 |
-
function the_views($display = true) {
|
139 |
$post_views = intval(post_custom('views'));
|
140 |
$views_options = get_option('views_options');
|
141 |
-
$
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
}
|
147 |
}
|
148 |
|
@@ -163,15 +228,15 @@ if(!function_exists('get_most_viewed')) {
|
|
163 |
$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 WHERE post_date < '".current_time('mysql')."' AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT $limit");
|
164 |
if($most_viewed) {
|
165 |
foreach ($most_viewed as $post) {
|
166 |
-
$post_views =
|
167 |
$post_title = get_the_title();
|
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);
|
175 |
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
176 |
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
177 |
$temp = str_replace("%POST_CONTENT%", $post_content, $temp);
|
@@ -191,6 +256,55 @@ if(!function_exists('get_most_viewed')) {
|
|
191 |
}
|
192 |
|
193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
### Function: Display Most Viewed Page/Post By Category ID
|
195 |
if(!function_exists('get_most_viewed_category')) {
|
196 |
function get_most_viewed_category($category_id = 0, $mode = '', $limit = 10, $chars = 0, $display = true) {
|
@@ -212,15 +326,15 @@ if(!function_exists('get_most_viewed_category')) {
|
|
212 |
$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 = 'category' AND $category_sql AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT $limit");
|
213 |
if($most_viewed) {
|
214 |
foreach ($most_viewed as $post) {
|
215 |
-
$post_views =
|
216 |
$post_title = get_the_title();
|
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);
|
224 |
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
225 |
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
226 |
$temp = str_replace("%POST_CONTENT%", $post_content, $temp);
|
@@ -244,11 +358,11 @@ if(!function_exists('get_most_viewed_category')) {
|
|
244 |
if(!function_exists('get_totalviews')) {
|
245 |
function get_totalviews($display = true) {
|
246 |
global $wpdb;
|
247 |
-
$total_views = $wpdb->get_var("SELECT SUM(meta_value+0) FROM $wpdb->postmeta WHERE meta_key = 'views'");
|
248 |
if($display) {
|
249 |
-
echo
|
250 |
} else {
|
251 |
-
return
|
252 |
}
|
253 |
}
|
254 |
}
|
@@ -257,12 +371,21 @@ if(!function_exists('get_totalviews')) {
|
|
257 |
### Function: Snippet Text
|
258 |
if(!function_exists('snippet_text')) {
|
259 |
function snippet_text($text, $length = 0) {
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
}
|
267 |
}
|
268 |
|
@@ -275,7 +398,7 @@ function views_post_excerpt($post_excerpt, $post_content, $post_password) {
|
|
275 |
}
|
276 |
}
|
277 |
if(empty($post_excerpt)) {
|
278 |
-
return snippet_text($post_content, 200);
|
279 |
} else {
|
280 |
return $post_excerpt;
|
281 |
}
|
@@ -308,6 +431,22 @@ function views_orderby($content) {
|
|
308 |
}
|
309 |
|
310 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
### Function: Views Public Variables
|
312 |
add_filter('query_vars', 'views_variables');
|
313 |
function views_variables($public_query_vars) {
|
@@ -355,9 +494,9 @@ function postviews_page_admin_most_stats($content) {
|
|
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,7 +508,7 @@ function postviews_page_general_stats($content) {
|
|
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
|
373 |
$content .= '</ul>'."\n";
|
374 |
}
|
375 |
return $content;
|
@@ -381,7 +520,7 @@ function postviews_page_most_stats($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";
|
@@ -408,10 +547,17 @@ function increment_views() {
|
|
408 |
### Function: Post Views Options
|
409 |
add_action('activate_wp-postviews/wp-postviews.php', 'views_init');
|
410 |
function views_init() {
|
|
|
411 |
// Add Options
|
412 |
$views_options = array();
|
413 |
$views_options['count'] = 1;
|
414 |
$views_options['exclude_bots'] = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
$views_options['template'] = __('%VIEW_COUNT% views', 'wp-postviews');
|
416 |
$views_options['most_viewed_template'] = '<li><a href="%POST_URL%" title="%POST_TITLE%">%POST_TITLE%</a> - %VIEW_COUNT% '.__('views', 'wp-postviews').'</li>';
|
417 |
add_option('views_options', $views_options, 'Post Views Options');
|
2 |
/*
|
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.40
|
7 |
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: http://lesterchan.net
|
9 |
*/
|
39 |
}
|
40 |
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
### Create Text Domain For Translations
|
43 |
add_action('init', 'postviews_textdomain');
|
44 |
function postviews_textdomain() {
|
45 |
+
load_plugin_textdomain('wp-postviews', false, 'wp-postviews');
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
|
48 |
|
50 |
add_action('admin_menu', 'postviews_menu');
|
51 |
function postviews_menu() {
|
52 |
if (function_exists('add_options_page')) {
|
53 |
+
add_options_page(__('PostViews', 'wp-postviews'), __('PostViews', 'wp-postviews'), 'manage_options', 'wp-postviews/postviews-options.php') ;
|
54 |
}
|
55 |
}
|
56 |
|
92 |
}
|
93 |
if($should_count) {
|
94 |
if(defined('WP_CACHE') && WP_CACHE) {
|
95 |
+
echo "\n".'<!-- Start Of Script Generated By WP-PostViews 1.40 -->'."\n";
|
96 |
wp_print_scripts(array('sack'));
|
97 |
echo '<script type="text/javascript">'."\n";
|
98 |
echo '/* <![CDATA[ */'."\n";
|
99 |
+
echo "\t".'var postviews_ajax_url = \''.plugins_url('wp-postviews/wp-postviews.php')."';\n";
|
100 |
echo "\t".'postviews_count = new sack(postviews_ajax_url);'."\n";
|
101 |
echo "\t".'postviews_count.setVar("postviews_id", '.$id.');'."\n";
|
102 |
echo "\t".'postviews_count.method = \'GET\';'."\n";
|
104 |
echo "\t".'postviews_count = null;'."\n";
|
105 |
echo '/* ]]> */'."\n";
|
106 |
echo '</script>'."\n";
|
107 |
+
echo '<!-- End Of Script Generated By WP-PostViews 1.40 -->'."\n";
|
108 |
} else {
|
109 |
if(!update_post_meta($id, 'views', ($post_views+1))) {
|
110 |
add_post_meta($id, 'views', 1, true);
|
115 |
}
|
116 |
|
117 |
|
118 |
+
### Function: Determine If Post Views Should Be Displayed (By: David Potter)
|
119 |
+
function should_views_be_displayed($views_options = null) {
|
120 |
+
if ($views_options == null) {
|
121 |
+
$views_options = get_option('views_options');
|
122 |
+
}
|
123 |
+
$display_option = 0;
|
124 |
+
if (is_home()) {
|
125 |
+
if (array_key_exists('display_home', $views_options)) {
|
126 |
+
$display_option = $views_options['display_home'];
|
127 |
+
}
|
128 |
+
} elseif (is_single()) {
|
129 |
+
if (array_key_exists('display_single', $views_options)) {
|
130 |
+
$display_option = $views_options['display_single'];
|
131 |
+
}
|
132 |
+
} elseif (is_page()) {
|
133 |
+
if (array_key_exists('display_page', $views_options)) {
|
134 |
+
$display_option = $views_options['display_page'];
|
135 |
+
}
|
136 |
+
} elseif (is_archive()) {
|
137 |
+
if (array_key_exists('display_archive', $views_options)) {
|
138 |
+
$display_option = $views_options['display_archive'];
|
139 |
+
}
|
140 |
+
} elseif (is_search()) {
|
141 |
+
if (array_key_exists('display_search', $views_options)) {
|
142 |
+
$display_option = $views_options['display_search'];
|
143 |
+
}
|
144 |
+
} else {
|
145 |
+
if (array_key_exists('display_other', $views_options)) {
|
146 |
+
$display_option = $views_options['display_other'];
|
147 |
+
}
|
148 |
+
}
|
149 |
+
return (($display_option == 0) || (($display_option == 1) && is_user_logged_in()));
|
150 |
+
}
|
151 |
+
|
152 |
+
|
153 |
### Function: Display The Post Views
|
154 |
+
function the_views($display = true, $prefix = '', $postfix = '', $always = false) {
|
155 |
$post_views = intval(post_custom('views'));
|
156 |
$views_options = get_option('views_options');
|
157 |
+
if ($always || should_views_be_displayed($views_options)) {
|
158 |
+
$output = $prefix.str_replace('%VIEW_COUNT%', number_format_i18n($post_views), $views_options['template']).$postfix;
|
159 |
+
if($display) {
|
160 |
+
echo apply_filters('the_views', $output);
|
161 |
+
} else {
|
162 |
+
return apply_filters('the_views', $output);
|
163 |
+
}
|
164 |
+
}
|
165 |
+
elseif (!$display) {
|
166 |
+
return '';
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
|
171 |
+
### Function: Display Least Viewed Page/Post
|
172 |
+
if(!function_exists('get_least_viewed')) {
|
173 |
+
function get_least_viewed($mode = '', $limit = 10, $chars = 0, $display = true) {
|
174 |
+
global $wpdb, $post;
|
175 |
+
$views_options = get_option('views_options');
|
176 |
+
$where = '';
|
177 |
+
$temp = '';
|
178 |
+
$output = '';
|
179 |
+
if(!empty($mode) && $mode != 'both') {
|
180 |
+
$where = "post_type = '$mode'";
|
181 |
+
} else {
|
182 |
+
$where = '1=1';
|
183 |
+
}
|
184 |
+
$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 WHERE post_date < '".current_time('mysql')."' AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views ASC LIMIT $limit");
|
185 |
+
if($most_viewed) {
|
186 |
+
foreach ($most_viewed as $post) {
|
187 |
+
$post_views = intval($post->views);
|
188 |
+
$post_title = get_the_title();
|
189 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password);
|
190 |
+
$post_content = get_the_content();
|
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 {
|
204 |
+
$output = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
|
205 |
+
}
|
206 |
+
if($display) {
|
207 |
+
echo $output;
|
208 |
+
} else {
|
209 |
+
return $output;
|
210 |
+
}
|
211 |
}
|
212 |
}
|
213 |
|
228 |
$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 WHERE post_date < '".current_time('mysql')."' AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT $limit");
|
229 |
if($most_viewed) {
|
230 |
foreach ($most_viewed as $post) {
|
231 |
+
$post_views = intval($post->views);
|
232 |
$post_title = get_the_title();
|
233 |
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password);
|
234 |
$post_content = get_the_content();
|
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);
|
256 |
}
|
257 |
|
258 |
|
259 |
+
### Function: Display Leased Viewed Page/Post By Category ID
|
260 |
+
if(!function_exists('get_least_viewed_category')) {
|
261 |
+
function get_least_viewed_category($category_id = 0, $mode = '', $limit = 10, $chars = 0, $display = true) {
|
262 |
+
global $wpdb, $post;
|
263 |
+
$views_options = get_option('views_options');
|
264 |
+
$where = '';
|
265 |
+
$temp = '';
|
266 |
+
$output = '';
|
267 |
+
if(is_array($category_id)) {
|
268 |
+
$category_sql = "$wpdb->term_taxonomy.term_id IN (".join(',', $category_id).')';
|
269 |
+
} else {
|
270 |
+
$category_sql = "$wpdb->term_taxonomy.term_id = $category_id";
|
271 |
+
}
|
272 |
+
if(!empty($mode) && $mode != 'both') {
|
273 |
+
$where = "post_type = '$mode'";
|
274 |
+
} else {
|
275 |
+
$where = '1=1';
|
276 |
+
}
|
277 |
+
$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 = 'category' AND $category_sql AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views ASC LIMIT $limit");
|
278 |
+
if($most_viewed) {
|
279 |
+
foreach ($most_viewed as $post) {
|
280 |
+
$post_views = intval($post->views);
|
281 |
+
$post_title = get_the_title();
|
282 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password);
|
283 |
+
$post_content = get_the_content();
|
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 {
|
297 |
+
$output = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
|
298 |
+
}
|
299 |
+
if($display) {
|
300 |
+
echo $output;
|
301 |
+
} else {
|
302 |
+
return $output;
|
303 |
+
}
|
304 |
+
}
|
305 |
+
}
|
306 |
+
|
307 |
+
|
308 |
### Function: Display Most Viewed Page/Post By Category ID
|
309 |
if(!function_exists('get_most_viewed_category')) {
|
310 |
function get_most_viewed_category($category_id = 0, $mode = '', $limit = 10, $chars = 0, $display = true) {
|
326 |
$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 = 'category' AND $category_sql AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT $limit");
|
327 |
if($most_viewed) {
|
328 |
foreach ($most_viewed as $post) {
|
329 |
+
$post_views = intval($post->views);
|
330 |
$post_title = get_the_title();
|
331 |
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password);
|
332 |
$post_content = get_the_content();
|
333 |
if($chars > 0) {
|
334 |
+
$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";
|
335 |
} else {
|
336 |
$temp = stripslashes($views_options['most_viewed_template']);
|
337 |
+
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
338 |
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
339 |
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
340 |
$temp = str_replace("%POST_CONTENT%", $post_content, $temp);
|
358 |
if(!function_exists('get_totalviews')) {
|
359 |
function get_totalviews($display = true) {
|
360 |
global $wpdb;
|
361 |
+
$total_views = intval($wpdb->get_var("SELECT SUM(meta_value+0) FROM $wpdb->postmeta WHERE meta_key = 'views'"));
|
362 |
if($display) {
|
363 |
+
echo $total_views;
|
364 |
} else {
|
365 |
+
return $total_views;
|
366 |
}
|
367 |
}
|
368 |
}
|
371 |
### Function: Snippet Text
|
372 |
if(!function_exists('snippet_text')) {
|
373 |
function snippet_text($text, $length = 0) {
|
374 |
+
if (defined('MB_OVERLOAD_STRING')) {
|
375 |
+
$text = @html_entity_decode($text, ENT_QUOTES, get_option('blog_charset'));
|
376 |
+
if (mb_strlen($text) > $length) {
|
377 |
+
return htmlentities(mb_substr($text,0,$length), ENT_COMPAT, get_option('blog_charset')).'...';
|
378 |
+
} else {
|
379 |
+
return htmlentities($text, ENT_COMPAT, get_option('blog_charset'));
|
380 |
+
}
|
381 |
+
} else {
|
382 |
+
$text = @html_entity_decode($text, ENT_QUOTES, get_option('blog_charset'));
|
383 |
+
if (strlen($text) > $length) {
|
384 |
+
return htmlentities(substr($text,0,$length), ENT_COMPAT, get_option('blog_charset')).'...';
|
385 |
+
} else {
|
386 |
+
return htmlentities($text, ENT_COMPAT, get_option('blog_charset'));
|
387 |
+
}
|
388 |
+
}
|
389 |
}
|
390 |
}
|
391 |
|
398 |
}
|
399 |
}
|
400 |
if(empty($post_excerpt)) {
|
401 |
+
return snippet_text(strip_tags($post_content), 200);
|
402 |
} else {
|
403 |
return $post_excerpt;
|
404 |
}
|
431 |
}
|
432 |
|
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 |
+
add_post_meta($post_ID, 'views', 0, true);
|
439 |
+
}
|
440 |
+
|
441 |
+
|
442 |
+
### Function: Delete Views Custom Fields
|
443 |
+
add_action('delete_post', 'delete_views_fields');
|
444 |
+
function delete_views_fields($post_ID) {
|
445 |
+
global $wpdb;
|
446 |
+
delete_post_meta($post_ID, 'views');
|
447 |
+
}
|
448 |
+
|
449 |
+
|
450 |
### Function: Views Public Variables
|
451 |
add_filter('query_vars', 'views_variables');
|
452 |
function views_variables($public_query_vars) {
|
494 |
$stats_display = get_option('stats_display');
|
495 |
$stats_mostlimit = intval(get_option('stats_mostlimit'));
|
496 |
if($stats_display['viewed_most'] == 1) {
|
497 |
+
$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'), number_format_i18n($stats_mostlimit)).'</label><br />'."\n";
|
498 |
} else {
|
499 |
+
$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'), number_format_i18n($stats_mostlimit)).'</label><br />'."\n";
|
500 |
}
|
501 |
return $content;
|
502 |
}
|
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(__ngettext('<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";
|
512 |
$content .= '</ul>'."\n";
|
513 |
}
|
514 |
return $content;
|
520 |
$stats_display = get_option('stats_display');
|
521 |
$stats_mostlimit = intval(get_option('stats_mostlimit'));
|
522 |
if($stats_display['viewed_most'] == 1) {
|
523 |
+
$content .= '<p><strong>'.sprintf(__ngettext('%s Most Viewed Post', '%s Most Viewed Posts', $stats_mostlimit, 'wp-postviews'), number_format_i18n($stats_mostlimit)).'</strong></p>'."\n";
|
524 |
$content .= '<ul>'."\n";
|
525 |
$content .= get_most_viewed('post', $stats_mostlimit, 0, false);
|
526 |
$content .= '</ul>'."\n";
|
547 |
### Function: Post Views Options
|
548 |
add_action('activate_wp-postviews/wp-postviews.php', 'views_init');
|
549 |
function views_init() {
|
550 |
+
postviews_textdomain();
|
551 |
// Add Options
|
552 |
$views_options = array();
|
553 |
$views_options['count'] = 1;
|
554 |
$views_options['exclude_bots'] = 0;
|
555 |
+
$views_options['display_home'] = 0;
|
556 |
+
$views_options['display_single'] = 0;
|
557 |
+
$views_options['display_page'] = 0;
|
558 |
+
$views_options['display_archive'] = 0;
|
559 |
+
$views_options['display_search'] = 0;
|
560 |
+
$views_options['display_other'] = 0;
|
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');
|
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,144 +11,219 @@ msgstr ""
|
|
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 |
|
18 |
-
#: postviews-options.php:
|
19 |
-
#: postviews-options.php:
|
20 |
msgid "Post Views Options"
|
21 |
msgstr ""
|
22 |
|
23 |
-
#: postviews-options.php:
|
24 |
msgid "Updated"
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: postviews-options.php:
|
28 |
msgid "No Post Views Option Updated"
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: postviews-options.php:
|
32 |
-
#: postviews-options.php:
|
33 |
msgid "UNINSTALL WP-PostViews"
|
34 |
msgstr ""
|
35 |
|
36 |
-
#: postviews-options.php:
|
37 |
#, php-format
|
38 |
msgid "Setting Key '%s' has been deleted."
|
39 |
msgstr ""
|
40 |
|
41 |
-
#: postviews-options.php:
|
42 |
#, php-format
|
43 |
msgid "Error deleting Setting Key '%s'."
|
44 |
msgstr ""
|
45 |
|
46 |
-
#: postviews-options.php:
|
47 |
#, php-format
|
48 |
msgid "Post Meta Key '%s' has been deleted."
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: postviews-options.php:
|
52 |
#, php-format
|
53 |
msgid "Error deleting Post Meta Key '%s'."
|
54 |
msgstr ""
|
55 |
|
56 |
-
#: postviews-options.php:
|
57 |
-
#: postviews-options.php:
|
58 |
msgid "Uninstall WP-PostViews"
|
59 |
msgstr ""
|
60 |
|
61 |
-
#: postviews-options.php:
|
62 |
#, php-format
|
63 |
msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-PostViews Will Be Deactivated Automatically."
|
64 |
msgstr ""
|
65 |
|
66 |
-
#: postviews-options.php:
|
67 |
-
#: wp-postviews.php:
|
68 |
msgid "%VIEW_COUNT% views"
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: postviews-options.php:
|
72 |
-
#: wp-postviews.php:
|
73 |
msgid "views"
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: postviews-options.php:
|
77 |
msgid "Count Views From:"
|
78 |
msgstr ""
|
79 |
|
80 |
-
#: postviews-options.php:
|
81 |
msgid "Everyone"
|
82 |
msgstr ""
|
83 |
|
84 |
-
#: postviews-options.php:
|
85 |
msgid "Guests Only"
|
86 |
msgstr ""
|
87 |
|
88 |
-
#: postviews-options.php:
|
89 |
msgid "Registered Users Only"
|
90 |
msgstr ""
|
91 |
|
92 |
-
#: postviews-options.php:
|
93 |
msgid "Exclude Bot Views:"
|
94 |
msgstr ""
|
95 |
|
96 |
-
#: postviews-options.php:
|
97 |
msgid "No"
|
98 |
msgstr ""
|
99 |
|
100 |
-
#: postviews-options.php:
|
101 |
-
#: postviews-options.php:
|
102 |
msgid "Yes"
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: postviews-options.php:
|
106 |
msgid "Views Template:"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: postviews-options.php:
|
110 |
-
#: postviews-options.php:
|
111 |
msgid "Allowed Variables:"
|
112 |
msgstr ""
|
113 |
|
114 |
-
#: postviews-options.php:
|
115 |
-
#: postviews-options.php:
|
116 |
msgid "Restore Default Template"
|
117 |
msgstr ""
|
118 |
|
119 |
-
#: postviews-options.php:
|
120 |
msgid "Most Viewed Template:"
|
121 |
msgstr ""
|
122 |
|
123 |
-
#: postviews-options.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
msgid "Save Changes"
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: postviews-options.php:
|
128 |
msgid "Deactivating WP-PostViews plugin does not remove any data that may have been created, such as the views data. To completely remove this plugin, you can uninstall it here."
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: postviews-options.php:
|
132 |
msgid "WARNING:"
|
133 |
msgstr ""
|
134 |
|
135 |
-
#: postviews-options.php:
|
136 |
msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first."
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: postviews-options.php:
|
140 |
msgid "The following WordPress Options/PostMetas will be DELETED:"
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: postviews-options.php:
|
144 |
msgid "WordPress Options"
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: postviews-options.php:
|
148 |
msgid "WordPress PostMetas"
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: postviews-options.php:
|
152 |
msgid ""
|
153 |
"You Are About To Uninstall WP-PostViews From WordPress.\\n"
|
154 |
"This Action Is Not Reversible.\\n"
|
@@ -196,45 +271,49 @@ msgstr ""
|
|
196 |
msgid "(<strong>0</strong> to disable)"
|
197 |
msgstr ""
|
198 |
|
199 |
-
#: wp-postviews.php:
|
200 |
-
msgid "
|
201 |
msgstr ""
|
202 |
|
203 |
-
#: wp-postviews.php:
|
204 |
-
#: wp-postviews.php:
|
|
|
|
|
205 |
#, php-format
|
206 |
msgid "%s view"
|
207 |
msgid_plural "%s views"
|
208 |
msgstr[0] ""
|
209 |
msgstr[1] ""
|
210 |
|
211 |
-
#: wp-postviews.php:
|
212 |
-
#: wp-postviews.php:
|
|
|
|
|
213 |
msgid "N/A"
|
214 |
msgstr ""
|
215 |
|
216 |
-
#: wp-postviews.php:
|
217 |
msgid "There is no excerpt because this is a protected post."
|
218 |
msgstr ""
|
219 |
|
220 |
-
#: wp-postviews.php:
|
221 |
-
#: wp-postviews.php:
|
222 |
-
#: wp-postviews.php:
|
223 |
msgid "WP-PostViews"
|
224 |
msgstr ""
|
225 |
|
226 |
-
#: wp-postviews.php:
|
227 |
-
#: wp-postviews.php:
|
228 |
-
#: wp-postviews.php:
|
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:
|
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] ""
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: WP-PostViews 1.40\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2008-12-10 00:35+0800\n"
|
6 |
+
"PO-Revision-Date: 2008-12-10 00:35+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;__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"
|
18 |
|
19 |
+
#: postviews-options.php:46
|
20 |
+
#: postviews-options.php:139
|
21 |
msgid "Post Views Options"
|
22 |
msgstr ""
|
23 |
|
24 |
+
#: postviews-options.php:51
|
25 |
msgid "Updated"
|
26 |
msgstr ""
|
27 |
|
28 |
+
#: postviews-options.php:56
|
29 |
msgid "No Post Views Option Updated"
|
30 |
msgstr ""
|
31 |
|
32 |
+
#: postviews-options.php:63
|
33 |
+
#: postviews-options.php:303
|
34 |
msgid "UNINSTALL WP-PostViews"
|
35 |
msgstr ""
|
36 |
|
37 |
+
#: postviews-options.php:71
|
38 |
#, php-format
|
39 |
msgid "Setting Key '%s' has been deleted."
|
40 |
msgstr ""
|
41 |
|
42 |
+
#: postviews-options.php:75
|
43 |
#, php-format
|
44 |
msgid "Error deleting Setting Key '%s'."
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: postviews-options.php:85
|
48 |
#, php-format
|
49 |
msgid "Post Meta Key '%s' has been deleted."
|
50 |
msgstr ""
|
51 |
|
52 |
+
#: postviews-options.php:89
|
53 |
#, php-format
|
54 |
msgid "Error deleting Post Meta Key '%s'."
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: postviews-options.php:111
|
58 |
+
#: postviews-options.php:261
|
59 |
msgid "Uninstall WP-PostViews"
|
60 |
msgstr ""
|
61 |
|
62 |
+
#: postviews-options.php:112
|
63 |
#, php-format
|
64 |
msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-PostViews Will Be Deactivated Automatically."
|
65 |
msgstr ""
|
66 |
|
67 |
+
#: postviews-options.php:125
|
68 |
+
#: wp-postviews.php:561
|
69 |
msgid "%VIEW_COUNT% views"
|
70 |
msgstr ""
|
71 |
|
72 |
+
#: postviews-options.php:128
|
73 |
+
#: wp-postviews.php:562
|
74 |
msgid "views"
|
75 |
msgstr ""
|
76 |
|
77 |
+
#: postviews-options.php:142
|
78 |
msgid "Count Views From:"
|
79 |
msgstr ""
|
80 |
|
81 |
+
#: postviews-options.php:145
|
82 |
msgid "Everyone"
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: postviews-options.php:146
|
86 |
msgid "Guests Only"
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: postviews-options.php:147
|
90 |
msgid "Registered Users Only"
|
91 |
msgstr ""
|
92 |
|
93 |
+
#: postviews-options.php:152
|
94 |
msgid "Exclude Bot Views:"
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: postviews-options.php:155
|
98 |
msgid "No"
|
99 |
msgstr ""
|
100 |
|
101 |
+
#: postviews-options.php:156
|
102 |
+
#: postviews-options.php:302
|
103 |
msgid "Yes"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: postviews-options.php:162
|
107 |
msgid "Views Template:"
|
108 |
msgstr ""
|
109 |
|
110 |
+
#: postviews-options.php:163
|
111 |
+
#: postviews-options.php:174
|
112 |
msgid "Allowed Variables:"
|
113 |
msgstr ""
|
114 |
|
115 |
+
#: postviews-options.php:165
|
116 |
+
#: postviews-options.php:180
|
117 |
msgid "Restore Default Template"
|
118 |
msgstr ""
|
119 |
|
120 |
+
#: postviews-options.php:173
|
121 |
msgid "Most Viewed Template:"
|
122 |
msgstr ""
|
123 |
|
124 |
+
#: postviews-options.php:187
|
125 |
+
msgid "Display Options"
|
126 |
+
msgstr ""
|
127 |
+
|
128 |
+
#: postviews-options.php:188
|
129 |
+
msgid "These options specify where the view counts should be displayed and to whom. \tBy default view counts will be displayed to all visitors. Note that the theme files must contain a call to <code>the_views()</code> in order for any view count to be displayed."
|
130 |
+
msgstr ""
|
131 |
+
|
132 |
+
#: postviews-options.php:191
|
133 |
+
msgid "Home Page:"
|
134 |
+
msgstr ""
|
135 |
+
|
136 |
+
#: postviews-options.php:194
|
137 |
+
#: postviews-options.php:204
|
138 |
+
#: postviews-options.php:214
|
139 |
+
#: postviews-options.php:224
|
140 |
+
#: postviews-options.php:234
|
141 |
+
#: postviews-options.php:244
|
142 |
+
msgid "Display to everyone"
|
143 |
+
msgstr ""
|
144 |
+
|
145 |
+
#: postviews-options.php:195
|
146 |
+
#: postviews-options.php:205
|
147 |
+
#: postviews-options.php:215
|
148 |
+
#: postviews-options.php:225
|
149 |
+
#: postviews-options.php:235
|
150 |
+
#: postviews-options.php:245
|
151 |
+
msgid "Display to registered users only"
|
152 |
+
msgstr ""
|
153 |
+
|
154 |
+
#: postviews-options.php:196
|
155 |
+
msgid "Don't display on home page"
|
156 |
+
msgstr ""
|
157 |
+
|
158 |
+
#: postviews-options.php:201
|
159 |
+
msgid "Singe Posts:"
|
160 |
+
msgstr ""
|
161 |
+
|
162 |
+
#: postviews-options.php:206
|
163 |
+
msgid "Don't display on single posts"
|
164 |
+
msgstr ""
|
165 |
+
|
166 |
+
#: postviews-options.php:211
|
167 |
+
msgid "Pages:"
|
168 |
+
msgstr ""
|
169 |
+
|
170 |
+
#: postviews-options.php:216
|
171 |
+
msgid "Don't display on pages"
|
172 |
+
msgstr ""
|
173 |
+
|
174 |
+
#: postviews-options.php:221
|
175 |
+
msgid "Archive Pages:"
|
176 |
+
msgstr ""
|
177 |
+
|
178 |
+
#: postviews-options.php:226
|
179 |
+
msgid "Don't display on archive pages"
|
180 |
+
msgstr ""
|
181 |
+
|
182 |
+
#: postviews-options.php:231
|
183 |
+
msgid "Search Pages:"
|
184 |
+
msgstr ""
|
185 |
+
|
186 |
+
#: postviews-options.php:236
|
187 |
+
msgid "Don't display on search pages"
|
188 |
+
msgstr ""
|
189 |
+
|
190 |
+
#: postviews-options.php:241
|
191 |
+
msgid "Other Pages:"
|
192 |
+
msgstr ""
|
193 |
+
|
194 |
+
#: postviews-options.php:246
|
195 |
+
msgid "Don't display on other pages"
|
196 |
+
msgstr ""
|
197 |
+
|
198 |
+
#: postviews-options.php:252
|
199 |
msgid "Save Changes"
|
200 |
msgstr ""
|
201 |
|
202 |
+
#: postviews-options.php:263
|
203 |
msgid "Deactivating WP-PostViews plugin does not remove any data that may have been created, such as the views data. To completely remove this plugin, you can uninstall it here."
|
204 |
msgstr ""
|
205 |
|
206 |
+
#: postviews-options.php:266
|
207 |
msgid "WARNING:"
|
208 |
msgstr ""
|
209 |
|
210 |
+
#: postviews-options.php:267
|
211 |
msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first."
|
212 |
msgstr ""
|
213 |
|
214 |
+
#: postviews-options.php:270
|
215 |
msgid "The following WordPress Options/PostMetas will be DELETED:"
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: postviews-options.php:275
|
219 |
msgid "WordPress Options"
|
220 |
msgstr ""
|
221 |
|
222 |
+
#: postviews-options.php:276
|
223 |
msgid "WordPress PostMetas"
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: postviews-options.php:303
|
227 |
msgid ""
|
228 |
"You Are About To Uninstall WP-PostViews From WordPress.\\n"
|
229 |
"This Action Is Not Reversible.\\n"
|
271 |
msgid "(<strong>0</strong> to disable)"
|
272 |
msgstr ""
|
273 |
|
274 |
+
#: wp-postviews.php:53
|
275 |
+
msgid "PostViews"
|
276 |
msgstr ""
|
277 |
|
278 |
+
#: wp-postviews.php:192
|
279 |
+
#: wp-postviews.php:236
|
280 |
+
#: wp-postviews.php:285
|
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:204
|
289 |
+
#: wp-postviews.php:248
|
290 |
+
#: wp-postviews.php:297
|
291 |
+
#: wp-postviews.php:346
|
292 |
msgid "N/A"
|
293 |
msgstr ""
|
294 |
|
295 |
+
#: wp-postviews.php:397
|
296 |
msgid "There is no excerpt because this is a protected post."
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: wp-postviews.php:484
|
300 |
+
#: wp-postviews.php:486
|
301 |
+
#: wp-postviews.php:509
|
302 |
msgid "WP-PostViews"
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: wp-postviews.php:497
|
306 |
+
#: wp-postviews.php:499
|
307 |
+
#: wp-postviews.php:523
|
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:511
|
315 |
#, php-format
|
316 |
+
msgid "<strong>%s</strong> view was generated."
|
317 |
msgid_plural "<strong>%s</strong> views were generated."
|
318 |
msgstr[0] ""
|
319 |
msgstr[1] ""
|