WP-PostViews - Version 1.20

Version Description

Download this release

Release Info

Developer GamerZ
Plugin Icon WP-PostViews
Version 1.20
Comparing to
See all releases

Code changes from version 1.11 to 1.20

postviews/postviews-options.php ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress 2.1 Plugin: WP-PostViews 1.20 |
6
+ | Copyright (c) 2007 Lester "GaMerZ" Chan |
7
+ | |
8
+ | File Written By: |
9
+ | - Lester "GaMerZ" Chan |
10
+ | - http://lesterchan.net |
11
+ | |
12
+ | File Information: |
13
+ | - Post Views Options Page |
14
+ | - wp-content/plugins/postviews/postviews-options.php |
15
+ | |
16
+ +----------------------------------------------------------------+
17
+ */
18
+
19
+
20
+ ### Variables Variables Variables
21
+ $base_name = plugin_basename('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
+
29
+ ### Form Processing
30
+ if(!empty($_POST['do'])) {
31
+ // Decide What To Do
32
+ switch($_POST['do']) {
33
+ case __('Update Options', 'wp-postviews'):
34
+ $views_options = array();
35
+ $views_options['count'] = intval($_POST['views_count']);
36
+ $views_options['template'] = addslashes(trim($_POST['views_template_template']));
37
+ $update_views_queries = array();
38
+ $update_views_text = array();
39
+ $update_views_queries[] = update_option('views_options', $views_options);
40
+ $update_views_text[] = __('Post Views Options', 'wp-postviews');
41
+ $i=0;
42
+ $text = '';
43
+ foreach($update_views_queries as $update_views_query) {
44
+ if($update_views_query) {
45
+ $text .= '<font color="green">'.$update_views_text[$i].' '.__('Updated', 'wp-postviews').'</font><br />';
46
+ }
47
+ $i++;
48
+ }
49
+ if(empty($text)) {
50
+ $text = '<font color="red">'.__('No Post Views Option Updated', 'wp-postviews').'</font>';
51
+ }
52
+ break;
53
+ // Uninstall WP-PostViews
54
+ case __('UNINSTALL WP-PostViews', 'wp-postviews') :
55
+ if(trim($_POST['uninstall_views_yes']) == 'yes') {
56
+ echo '<div id="message" class="updated fade">';
57
+ echo '<p>';
58
+ foreach($views_settings as $setting) {
59
+ $delete_setting = delete_option($setting);
60
+ if($delete_setting) {
61
+ echo '<font color="green">';
62
+ printf(__('Setting Key \'%s\' has been deleted.', 'wp-postviews'), "<strong><em>{$setting}</em></strong>");
63
+ echo '</font><br />';
64
+ } else {
65
+ echo '<font color="red">';
66
+ printf(__('Error deleting Setting Key \'%s\'.', 'wp-postviews'), "<strong><em>{$setting}</em></strong>");
67
+ echo '</font><br />';
68
+ }
69
+ }
70
+ echo '</p>';
71
+ echo '<p>';
72
+ foreach($views_postmetas as $postmeta) {
73
+ $remove_postmeta = $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = '$postmeta'");
74
+ if($remove_postmeta) {
75
+ echo '<font color="green">';
76
+ printf(__('Post Meta Key \'%s\' has been deleted.', 'wp-postviews'), "<strong><em>{$postmeta}</em></strong>");
77
+ echo '</font><br />';
78
+ } else {
79
+ echo '<font color="red">';
80
+ printf(__('Error deleting Post Meta Key \'%s\'.', 'wp-postviews'), "<strong><em>{$postmeta}</em></strong>");
81
+ echo '</font><br />';
82
+ }
83
+ }
84
+ echo '</p>';
85
+ echo '</div>';
86
+ $mode = 'end-UNINSTALL';
87
+ }
88
+ break;
89
+ }
90
+ }
91
+
92
+
93
+ ### Determines Which Mode It Is
94
+ switch($mode) {
95
+ // Deactivating WP-PostViews
96
+ case 'end-UNINSTALL':
97
+ $deactivate_url = 'plugins.php?action=deactivate&amp;plugin=postviews/postviews.php';
98
+ if(function_exists('wp_nonce_url')) {
99
+ $deactivate_url = wp_nonce_url($deactivate_url, 'deactivate-plugin_postviews/postviews.php');
100
+ }
101
+ echo '<div class="wrap">';
102
+ echo '<h2>'.__('Uninstall WP-PostViews', 'wp-postviews').'</h2>';
103
+ echo '<p><strong>'.sprintf(__('<a href="%s">Click Here</a> To Finish The Uninstallation And WP-PostViews Will Be Deactivated Automatically.', 'wp-postviews'), $deactivate_url).'</strong></p>';
104
+ echo '</div>';
105
+ break;
106
+ // Main Page
107
+ default:
108
+ $views_options = get_option('views_options');
109
+ ?>
110
+ <script type="text/javascript">
111
+ /* <![CDATA[*/
112
+ function views_default_templates(template) {
113
+ var default_template;
114
+ switch(template) {
115
+ case 'template':
116
+ default_template = "<?php _e('%VIEW_COUNT% views', 'wp-postviews'); ?>";
117
+ break;
118
+ }
119
+ document.getElementById("views_template_" + template).value = default_template;
120
+ }
121
+ /* ]]> */
122
+ </script>
123
+ <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
124
+ <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
125
+ <div class="wrap">
126
+ <h2><?php _e('Post Views Options', 'wp-postviews'); ?></h2>
127
+ <fieldset class="options">
128
+ <legend><?php _e('Post Views Options', 'wp-postviews'); ?></legend>
129
+ <table width="100%" border="0" cellspacing="3" cellpadding="3">
130
+ <tr valign="top">
131
+ <th align="left" width="30%"><?php _e('Count Views From:', 'wp-postviews'); ?></th>
132
+ <td align="left">
133
+ <select name="views_count" size="1">
134
+ <option value="0"<?php selected('0', $views_options['count']); ?>><?php _e('Everyone', 'wp-postviews'); ?></option>
135
+ <option value="1"<?php selected('1', $views_options['count']); ?>><?php _e('Guests Only', 'wp-postviews'); ?></option>
136
+ <option value="2"<?php selected('2', $views_options['count']); ?>><?php _e('Registered Users Only', 'wp-postviews'); ?></option>
137
+ </select>
138
+ </td>
139
+ </tr>
140
+ <tr valign="top">
141
+ <th align="left" width="30%"><?php _e('Views Template:', 'wp-postviews'); ?></th>
142
+ <td align="left">
143
+ <input type="text" id="views_template_template" name="views_template_template" size="70" value="<?php echo htmlspecialchars(stripslashes($views_options['template'])); ?>" /><br />
144
+ <?php _e('HTML is allowed.', 'wp-postviews'); ?><br />
145
+ %VIEW_COUNT% - <?php _e('The number of views.', 'wp-postviews'); ?><br />
146
+ <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-postviews'); ?>" onclick="views_default_templates('template');" class="button" />
147
+ </td>
148
+ </tr>
149
+ </table>
150
+ </fieldset>
151
+ <div align="center">
152
+ <input type="submit" name="do" class="button" value="<?php _e('Update Options', 'wp-postviews'); ?>" />&nbsp;&nbsp;<input type="button" name="cancel" value="<?php _e('Cancel', 'wp-postviews'); ?>" class="button" onclick="javascript:history.go(-1)" />
153
+ </div>
154
+ </div>
155
+ </form>
156
+
157
+ <!-- Uninstall WP-PostViews -->
158
+ <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
159
+ <div class="wrap">
160
+ <h2><?php _e('Uninstall WP-PostViews', 'wp-postviews'); ?></h2>
161
+ <p style="text-align: left;">
162
+ <?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'); ?>
163
+ </p>
164
+ <p style="text-align: left; color: red">
165
+ <strong><?php _e('WARNING:', 'wp-postviews'); ?></strong><br />
166
+ <?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'); ?>
167
+ </p>
168
+ <p style="text-align: left; color: red">
169
+ <strong><?php _e('The following WordPress Options/PostMetas will be DELETED:', 'wp-postviews'); ?></strong><br />
170
+ </p>
171
+ <table width="70%" border="0" cellspacing="3" cellpadding="3">
172
+ <tr class="thead">
173
+ <td align="center"><strong><?php _e('WordPress Options', 'wp-postviews'); ?></strong></td>
174
+ <td align="center"><strong><?php _e('WordPress PostMetas', 'wp-postviews'); ?></strong></td>
175
+ </tr>
176
+ <tr>
177
+ <td valign="top" style="background-color: #eee;">
178
+ <ol>
179
+ <?php
180
+ foreach($views_settings as $settings) {
181
+ echo '<li>'.$settings.'</li>'."\n";
182
+ }
183
+ ?>
184
+ </ol>
185
+ </td>
186
+ <td valign="top" style="background-color: #eee;">
187
+ <ol>
188
+ <?php
189
+ foreach($views_postmetas as $postmeta) {
190
+ echo '<li>'.$postmeta.'</li>'."\n";
191
+ }
192
+ ?>
193
+ </ol>
194
+ </td>
195
+ </tr>
196
+ </table>
197
+ <p>&nbsp;</p>
198
+ <p style="text-align: center;">
199
+ <input type="checkbox" name="uninstall_views_yes" value="yes" />&nbsp;<?php _e('Yes', 'wp-postviews'); ?><br /><br />
200
+ <input type="submit" name="do" value="<?php _e('UNINSTALL WP-PostViews', 'wp-postviews'); ?>" class="button" onclick="return confirm('<?php _e('You Are About To Uninstall WP-PostViews From WordPress.\nThis Action Is Not Reversible.\n\n Choose [Cancel] To Stop, [OK] To Uninstall.', 'wp-postviews'); ?>')" />
201
+ </p>
202
+ </div>
203
+ </form>
204
+ <?php
205
+ } // End switch($mode)
206
+ ?>
postviews/postviews-widget.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.20
7
+ Author: Lester 'GaMerZ' Chan
8
+ Author URI: http://lesterchan.net
9
+ */
10
+
11
+
12
+ /*
13
+ Copyright 2007 Lester Chan (email : gamerz84@hotmail.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($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' => 200);
56
+ }
57
+ if ($_POST['most_viewed-submit']) {
58
+ $options['title'] = strip_tags(addslashes($_POST['most_viewed-title']));
59
+ $options['mode'] = strip_tags(addslashes($_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 style="text-align: left;"><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 style="text-align: left;"><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('Post &amp Page', 'wp-postviews');
75
+ echo '</option>'."\n";
76
+ echo '<option value="post"';
77
+ selected('post', $options['mode']);
78
+ echo '>';
79
+ _e('Post', 'wp-postviews');
80
+ echo '</option>'."\n";
81
+ echo '<option value="page"';
82
+ selected('page', $options['mode']);
83
+ echo '>';
84
+ _e('Page', 'wp-postviews');
85
+ echo '</option>'."\n";
86
+ echo '</select>&nbsp;&nbsp;';
87
+ _e('Only', 'wp-postviews');
88
+ echo '</p>'."\n";
89
+ echo '<p style="text-align: left;"><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 style="text-align: left;"><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" />&nbsp;&nbsp;'."\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
+ ?>
postviews/postviews.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /*
3
  Plugin Name: WP-PostViews
4
- Plugin URI: http://www.lesterchan.net/portfolio/programming.php
5
  Description: Enables you to display how many times a post/page had been viewed. It will not count registered member views, but that can be changed easily.
6
- Version: 1.11
7
  Author: Lester 'GaMerZ' Chan
8
- Author URI: http://www.lesterchan.net
9
  */
10
 
11
 
@@ -28,37 +28,65 @@ Author URI: http://www.lesterchan.net
28
  */
29
 
30
 
31
- ### Create Text Domain For Translation
32
- load_plugin_textdomain('wp-postviews', 'wp-content/plugins/postviews');
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
 
35
  ### Function: Calculate Post Views
36
  add_action('loop_start', 'process_postviews');
37
  function process_postviews() {
38
- global $id;
 
39
  $post_views = get_post_custom($post_id);
40
  $post_views = intval($post_views['views'][0]);
41
- if(empty($_COOKIE[USER_COOKIE])) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  if(is_single() || is_page()) {
43
  if(!update_post_meta($id, 'views', ($post_views+1))) {
44
  add_post_meta($id, 'views', 1, true);
45
  }
46
  remove_action('loop_start', 'process_postviews');
47
- }
48
  }
49
  }
50
 
51
 
52
  ### Function: Display The Post Views
53
- function the_views($text_views = '', $display = true) {
54
- if(empty($text_views)) {
55
- $text_views = __('Views', 'wp-postviews');
56
- }
57
  $post_views = intval(post_custom('views'));
 
 
58
  if($display) {
59
- echo number_format($post_views).' '.$text_views;
60
  } else {
61
- return $post_views;
62
  }
63
  }
64
 
@@ -74,21 +102,21 @@ if(!function_exists('get_most_viewed')) {
74
  } else {
75
  $where = '1=1';
76
  }
77
- $most_viewed = $wpdb->get_results("SELECT $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");
78
  if($most_viewed) {
79
  if($chars > 0) {
80
  foreach ($most_viewed as $post) {
81
  $post_title = get_the_title();
82
  $post_views = intval($post->views);
83
  $post_views = number_format($post_views);
84
- $temp .= "<li><a href=\"".get_permalink()."\">".snippet_chars($post_title, $chars)."</a> - $post_views ".__('Views', 'wp-postviews')."</li>\n";
85
  }
86
  } else {
87
  foreach ($most_viewed as $post) {
88
  $post_title = get_the_title();
89
  $post_views = intval($post->views);
90
  $post_views = number_format($post_views);
91
- $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $post_views ".__('Views', 'wp-postviews')."</li>\n";
92
  }
93
  }
94
  } else {
@@ -109,26 +137,31 @@ if(!function_exists('get_most_viewed_category')) {
109
  global $wpdb, $post;
110
  $where = '';
111
  $temp = '';
 
 
 
 
 
112
  if(!empty($mode) && $mode != 'both') {
113
  $where = "post_type = '$mode'";
114
  } else {
115
  $where = '1=1';
116
  }
117
- $most_viewed = $wpdb->get_results("SELECT $wpdb->posts.*, (meta_value+0) AS views FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ON $wpdb->postmeta.post_id = $wpdb->posts.ID LEFT JOIN $wpdb->post2cat ON $wpdb->post2cat.post_id = $wpdb->posts.ID WHERE post_date < '".current_time('mysql')."' AND $wpdb->post2cat.category_id = $category_id AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT $limit");
118
  if($most_viewed) {
119
  if($chars > 0) {
120
  foreach ($most_viewed as $post) {
121
  $post_title = htmlspecialchars(stripslashes($post->post_title));
122
  $post_views = intval($post->views);
123
  $post_views = number_format($post_views);
124
- $temp .= "<li><a href=\"".get_permalink()."\">".snippet_chars($post_title, $chars)."</a> - $post_views ".__('Views', 'wp-postviews')."</li>\n";
125
  }
126
  } else {
127
  foreach ($most_viewed as $post) {
128
  $post_title = htmlspecialchars(stripslashes($post->post_title));
129
  $post_views = intval($post->views);
130
  $post_views = number_format($post_views);
131
- $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $post_views ".__('Views', 'wp-postviews')."</li>\n";
132
  }
133
  }
134
  } else {
@@ -155,13 +188,13 @@ function get_timespan_most_viewed($mode = '', $limit = 10, $days = 7, $display =
155
  } else {
156
  $where = '1=1';
157
  }
158
- $most_viewed = $wpdb->get_results("SELECT $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 post_date > '".$limit_date."' AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT $limit");
159
  if($most_viewed) {
160
  foreach ($most_viewed as $post) {
161
  $post_title = get_the_title();
162
  $post_views = intval($post->views);
163
  $post_views = number_format($post_views);
164
- $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $post_views ".__('Views', 'wp-postviews')."</li>";
165
  }
166
  } else {
167
  $temp = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
@@ -181,18 +214,23 @@ function get_timespan_most_viewed_cat($category_id = 0, $mode = '', $limit = 10,
181
  $limit_date = date("Y-m-d H:i:s",$limit_date);
182
  $where = '';
183
  $temp = '';
 
 
 
 
 
184
  if(!empty($mode) && $mode != 'both') {
185
  $where = "post_type = '$mode'";
186
  } else {
187
  $where = '1=1';
188
  }
189
- $most_viewed = $wpdb->get_results("SELECT $wpdb->posts.*, (meta_value+0) AS views FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ON $wpdb->postmeta.post_id = $wpdb->posts.ID LEFT JOIN $wpdb->post2cat ON $wpdb->post2cat.post_id = $wpdb->posts.ID WHERE post_date < '".current_time('mysql')."' AND $wpdb->post2cat.category_id = $category_id AND post_date > '".$limit_date."' AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT $limit");
190
  if($most_viewed) {
191
  foreach ($most_viewed as $post) {
192
  $post_title = get_the_title();
193
  $post_views = intval($post->views);
194
  $post_views = number_format($post_views);
195
- $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $post_views ".__('Views', 'wp-postviews')."</li>";
196
  }
197
  } else {
198
  $temp = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
@@ -258,7 +296,7 @@ function views_where($content) {
258
  }
259
  function views_orderby($content) {
260
  $orderby = trim(addslashes($_GET['orderby']));
261
- if(empty($orderby) && ($orderby != 'asc' || $orderby != 'desc')) {
262
  $orderby = 'desc';
263
  }
264
  $content = " views $orderby";
@@ -275,4 +313,76 @@ if($_GET['sortby'] == 'views') {
275
  add_filter('posts_orderby', 'views_orderby');
276
  }
277
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  ?>
1
  <?php
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. It will not count registered member views, but that can be changed easily.
6
+ Version: 1.20
7
  Author: Lester 'GaMerZ' Chan
8
+ Author URI: http://lesterchan.net
9
  */
10
 
11
 
28
  */
29
 
30
 
31
+ ### Create Text Domain For Translations
32
+ add_action('init', 'postviews_textdomain');
33
+ function postviews_textdomain() {
34
+ load_plugin_textdomain('wp-postviews', 'wp-content/plugins/postviews');
35
+ }
36
+
37
+
38
+ ### Function: Post Views Option Menu
39
+ add_action('admin_menu', 'postviews_menu');
40
+ function postviews_menu() {
41
+ if (function_exists('add_options_page')) {
42
+ add_options_page(__('Post Views', 'wp-postviews'), __('Post Views', 'wp-postviews'), 'manage_options', 'postviews/postviews-options.php') ;
43
+ }
44
+ }
45
 
46
 
47
  ### Function: Calculate Post Views
48
  add_action('loop_start', 'process_postviews');
49
  function process_postviews() {
50
+ global $id, $user_ID;
51
+ $views_options = get_option('views_options');
52
  $post_views = get_post_custom($post_id);
53
  $post_views = intval($post_views['views'][0]);
54
+ $should_count = false;
55
+ switch(intval($views_options['count'])) {
56
+ case 0:
57
+ $should_count = true;
58
+ break;
59
+ case 1:
60
+ if(empty($_COOKIE[USER_COOKIE])) {
61
+ $should_count = true;
62
+ }
63
+ break;
64
+ case 2:
65
+ if(intval($user_ID) > 0) {
66
+ $should_count = true;
67
+ }
68
+ break;
69
+ }
70
+ if($should_count) {
71
  if(is_single() || is_page()) {
72
  if(!update_post_meta($id, 'views', ($post_views+1))) {
73
  add_post_meta($id, 'views', 1, true);
74
  }
75
  remove_action('loop_start', 'process_postviews');
76
+ }
77
  }
78
  }
79
 
80
 
81
  ### Function: Display The Post Views
82
+ function the_views($display = true) {
 
 
 
83
  $post_views = intval(post_custom('views'));
84
+ $views_options = get_option('views_options');
85
+ $output = str_replace('%VIEW_COUNT%', number_format($post_views), $views_options['template']);
86
  if($display) {
87
+ echo $output;
88
  } else {
89
+ return $output;
90
  }
91
  }
92
 
102
  } else {
103
  $where = '1=1';
104
  }
105
+ $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");
106
  if($most_viewed) {
107
  if($chars > 0) {
108
  foreach ($most_viewed as $post) {
109
  $post_title = get_the_title();
110
  $post_views = intval($post->views);
111
  $post_views = number_format($post_views);
112
+ $temp .= "<li><a href=\"".get_permalink()."\">".snippet_chars($post_title, $chars)."</a> - $post_views ".__('views', 'wp-postviews')."</li>\n";
113
  }
114
  } else {
115
  foreach ($most_viewed as $post) {
116
  $post_title = get_the_title();
117
  $post_views = intval($post->views);
118
  $post_views = number_format($post_views);
119
+ $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $post_views ".__('views', 'wp-postviews')."</li>\n";
120
  }
121
  }
122
  } else {
137
  global $wpdb, $post;
138
  $where = '';
139
  $temp = '';
140
+ if(is_array($category_id)) {
141
+ $category_sql = "$wpdb->term_relationships.term_taxonomy_id IN (".join(',', $category_id).')';
142
+ } else {
143
+ $category_sql = "$wpdb->term_relationships.term_taxonomy_id = $category_id";
144
+ }
145
  if(!empty($mode) && $mode != 'both') {
146
  $where = "post_type = '$mode'";
147
  } else {
148
  $where = '1=1';
149
  }
150
+ $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 LEFT JOIN $wpdb->term_relationships ON $wpdb->term_relationships.object_id = $wpdb->posts.ID WHERE post_date < '".current_time('mysql')."' AND $category_sql AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT $limit");
151
  if($most_viewed) {
152
  if($chars > 0) {
153
  foreach ($most_viewed as $post) {
154
  $post_title = htmlspecialchars(stripslashes($post->post_title));
155
  $post_views = intval($post->views);
156
  $post_views = number_format($post_views);
157
+ $temp .= "<li><a href=\"".get_permalink()."\">".snippet_chars($post_title, $chars)."</a> - $post_views ".__('views', 'wp-postviews')."</li>\n";
158
  }
159
  } else {
160
  foreach ($most_viewed as $post) {
161
  $post_title = htmlspecialchars(stripslashes($post->post_title));
162
  $post_views = intval($post->views);
163
  $post_views = number_format($post_views);
164
+ $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $post_views ".__('views', 'wp-postviews')."</li>\n";
165
  }
166
  }
167
  } else {
188
  } else {
189
  $where = '1=1';
190
  }
191
+ $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 post_date > '".$limit_date."' AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT $limit");
192
  if($most_viewed) {
193
  foreach ($most_viewed as $post) {
194
  $post_title = get_the_title();
195
  $post_views = intval($post->views);
196
  $post_views = number_format($post_views);
197
+ $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $post_views ".__('views', 'wp-postviews')."</li>";
198
  }
199
  } else {
200
  $temp = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
214
  $limit_date = date("Y-m-d H:i:s",$limit_date);
215
  $where = '';
216
  $temp = '';
217
+ if(is_array($category_id)) {
218
+ $category_sql = "$wpdb->term_relationships.term_taxonomy_id IN (".join(',', $category_id).')';
219
+ } else {
220
+ $category_sql = "$wpdb->term_relationships.term_taxonomy_id = $category_id";
221
+ }
222
  if(!empty($mode) && $mode != 'both') {
223
  $where = "post_type = '$mode'";
224
  } else {
225
  $where = '1=1';
226
  }
227
+ $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 LEFT JOIN $wpdb->term_relationships ON $wpdb->term_relationships.object_id = $wpdb->posts.ID WHERE post_date < '".current_time('mysql')."' AND $category_sql AND post_date > '".$limit_date."' AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT $limit");
228
  if($most_viewed) {
229
  foreach ($most_viewed as $post) {
230
  $post_title = get_the_title();
231
  $post_views = intval($post->views);
232
  $post_views = number_format($post_views);
233
+ $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $post_views ".__('views', 'wp-postviews')."</li>";
234
  }
235
  } else {
236
  $temp = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
296
  }
297
  function views_orderby($content) {
298
  $orderby = trim(addslashes($_GET['orderby']));
299
+ if(empty($orderby) || ($orderby != 'asc' && $orderby != 'desc')) {
300
  $orderby = 'desc';
301
  }
302
  $content = " views $orderby";
313
  add_filter('posts_orderby', 'views_orderby');
314
  }
315
  */
316
+
317
+
318
+ ### Function: Plug Into WP-Stats
319
+ if(strpos(get_option('stats_url'), $_SERVER['REQUEST_URI']) || strpos($_SERVER['REQUEST_URI'], 'stats-options.php') || strpos($_SERVER['REQUEST_URI'], 'stats/stats.php')) {
320
+ add_filter('wp_stats_page_admin_plugins', 'postviews_page_admin_general_stats');
321
+ add_filter('wp_stats_page_admin_most', 'postviews_page_admin_most_stats');
322
+ add_filter('wp_stats_page_plugins', 'postviews_page_general_stats');
323
+ add_filter('wp_stats_page_most', 'postviews_page_most_stats');
324
+ }
325
+
326
+
327
+ ### Function: Add WP-PostViews General Stats To WP-Stats Page Options
328
+ function postviews_page_admin_general_stats($content) {
329
+ $stats_display = get_option('stats_display');
330
+ if($stats_display['views'] == 1) {
331
+ $content .= '<input type="checkbox" name="stats_display[]" id="wpstats_views" value="views" checked="checked" />&nbsp;&nbsp;<label for="wpstats_views">'.__('WP-PostViews', 'wp-postviews').'</label><br />'."\n";
332
+ } else {
333
+ $content .= '<input type="checkbox" name="stats_display[]" id="wpstats_views" value="views" />&nbsp;&nbsp;<label for="wpstats_views">'.__('WP-PostViews', 'wp-postviews').'</label><br />'."\n";
334
+ }
335
+ return $content;
336
+ }
337
+
338
+
339
+ ### Function: Add WP-PostViews Top Most/Highest Stats To WP-Stats Page Options
340
+ function postviews_page_admin_most_stats($content) {
341
+ $stats_display = get_option('stats_display');
342
+ $stats_mostlimit = intval(get_option('stats_mostlimit'));
343
+ if($stats_display['viewed_most'] == 1) {
344
+ $content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most" value="viewed_most" checked="checked" />&nbsp;&nbsp;<label for="wpstats_viewed_most">'.$stats_mostlimit.' '.__('Most Viewed Posts', 'wp-postviews').'</label><br />'."\n";
345
+ } else {
346
+ $content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most" value="viewed_most" />&nbsp;&nbsp;<label for="wpstats_viewed_most">'.$stats_mostlimit.' '.__('Most Viewed Posts', 'wp-postviews').'</label><br />'."\n";
347
+ }
348
+ return $content;
349
+ }
350
+
351
+
352
+ ### Function: Add WP-PostViews General Stats To WP-Stats Page
353
+ function postviews_page_general_stats($content) {
354
+ $stats_display = get_option('stats_display');
355
+ if($stats_display['views'] == 1) {
356
+ $content .= '<p><strong>'.__('WP-PostViews', 'wp-postviews').'</strong></p>'."\n";
357
+ $content .= '<ul>'."\n";
358
+ $content .= '<li><strong>'.get_totalviews(false).'</strong> '.__('views were generated.', 'wp-postviews').'</li>'."\n";
359
+ $content .= '</ul>'."\n";
360
+ }
361
+ return $content;
362
+ }
363
+
364
+
365
+ ### Function: Add WP-PostViews Top Most/Highest Stats To WP-Stats Page
366
+ function postviews_page_most_stats($content) {
367
+ $stats_display = get_option('stats_display');
368
+ $stats_mostlimit = intval(get_option('stats_mostlimit'));
369
+ if($stats_display['viewed_most'] == 1) {
370
+ $content .= '<p><strong>'.$stats_mostlimit.' '.__('Most Viewed Post', 'wp-postviews').'</strong></p>'."\n";
371
+ $content .= '<ul>'."\n";
372
+ $content .= get_most_viewed('post', $stats_mostlimit, 0, false);
373
+ $content .= '</ul>'."\n";
374
+ }
375
+ return $content;
376
+ }
377
+
378
+
379
+ ### Function: Post Views Options
380
+ add_action('activate_postviews/postviews.php', 'views_init');
381
+ function views_init() {
382
+ // Add Options
383
+ $views_options = array();
384
+ $views_options['count'] = 1;
385
+ $views_options['template'] = __('%VIEW_COUNT% views', 'wp-postviews');
386
+ add_option('views_options', $views_options, 'Post Views Options');
387
+ }
388
  ?>
postviews/wp-postviews.mo CHANGED
Binary file
postviews/wp-postviews.pot CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP-PostViews 1.11\n"
4
  "POT-Creation-Date: \n"
5
- "PO-Revision-Date: 2007-06-07 15:23+0800\n"
6
  "Last-Translator: Lester 'GaMerZ' Chan <gamerz84@hotmail.com>\n"
7
  "Language-Team: Lester Chan <gamerz84@hotmail.com>\n"
8
  "MIME-Version: 1.0\n"
@@ -14,20 +14,213 @@ msgstr ""
14
  "X-Poedit-Basepath: .\n"
15
  "X-Poedit-SearchPath-0: .\n"
16
 
17
- #: postviews.php:55
18
- #: postviews.php:84
19
- #: postviews.php:91
20
- #: postviews.php:124
21
- #: postviews.php:131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  #: postviews.php:164
23
- #: postviews.php:195
24
- msgid "Views"
 
25
  msgstr ""
26
 
27
- #: postviews.php:95
28
- #: postviews.php:135
29
- #: postviews.php:167
30
- #: postviews.php:198
31
  msgid "N/A"
32
  msgstr ""
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  msgstr ""
3
  "Project-Id-Version: WP-PostViews 1.11\n"
4
  "POT-Creation-Date: \n"
5
+ "PO-Revision-Date: 2007-09-30 16:06+0800\n"
6
  "Last-Translator: Lester 'GaMerZ' Chan <gamerz84@hotmail.com>\n"
7
  "Language-Team: Lester Chan <gamerz84@hotmail.com>\n"
8
  "MIME-Version: 1.0\n"
14
  "X-Poedit-Basepath: .\n"
15
  "X-Poedit-SearchPath-0: .\n"
16
 
17
+ #: postviews-options.php:33
18
+ #: postviews-options.php:152
19
+ msgid "Update Options"
20
+ msgstr ""
21
+
22
+ #: postviews-options.php:40
23
+ #: postviews-options.php:126
24
+ #: postviews-options.php:128
25
+ msgid "Post Views Options"
26
+ msgstr ""
27
+
28
+ #: postviews-options.php:45
29
+ msgid "Updated"
30
+ msgstr ""
31
+
32
+ #: postviews-options.php:50
33
+ msgid "No Post Views Option Updated"
34
+ msgstr ""
35
+
36
+ #: postviews-options.php:54
37
+ #: postviews-options.php:200
38
+ msgid "UNINSTALL WP-PostViews"
39
+ msgstr ""
40
+
41
+ #: postviews-options.php:62
42
+ #, php-format
43
+ msgid "Setting Key '%s' has been deleted."
44
+ msgstr ""
45
+
46
+ #: postviews-options.php:66
47
+ #, php-format
48
+ msgid "Error deleting Setting Key '%s'."
49
+ msgstr ""
50
+
51
+ #: postviews-options.php:76
52
+ #, php-format
53
+ msgid "Post Meta Key '%s' has been deleted."
54
+ msgstr ""
55
+
56
+ #: postviews-options.php:80
57
+ #, php-format
58
+ msgid "Error deleting Post Meta Key '%s'."
59
+ msgstr ""
60
+
61
+ #: postviews-options.php:102
62
+ #: postviews-options.php:160
63
+ msgid "Uninstall WP-PostViews"
64
+ msgstr ""
65
+
66
+ #: postviews-options.php:103
67
+ #, php-format
68
+ msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-PostViews Will Be Deactivated Automatically."
69
+ msgstr ""
70
+
71
+ #: postviews-options.php:116
72
+ #: postviews.php:385
73
+ msgid "%VIEW_COUNT% views"
74
+ msgstr ""
75
+
76
+ #: postviews-options.php:131
77
+ msgid "Count Views From:"
78
+ msgstr ""
79
+
80
+ #: postviews-options.php:134
81
+ msgid "Everyone"
82
+ msgstr ""
83
+
84
+ #: postviews-options.php:135
85
+ msgid "Guests Only"
86
+ msgstr ""
87
+
88
+ #: postviews-options.php:136
89
+ msgid "Registered Users Only"
90
+ msgstr ""
91
+
92
+ #: postviews-options.php:141
93
+ msgid "Views Template:"
94
+ msgstr ""
95
+
96
+ #: postviews-options.php:144
97
+ msgid "HTML is allowed."
98
+ msgstr ""
99
+
100
+ #: postviews-options.php:145
101
+ msgid "The number of views."
102
+ msgstr ""
103
+
104
+ #: postviews-options.php:146
105
+ msgid "Restore Default Template"
106
+ msgstr ""
107
+
108
+ #: postviews-options.php:152
109
+ msgid "Cancel"
110
+ msgstr ""
111
+
112
+ #: postviews-options.php:162
113
+ 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."
114
+ msgstr ""
115
+
116
+ #: postviews-options.php:165
117
+ msgid "WARNING:"
118
+ msgstr ""
119
+
120
+ #: postviews-options.php:166
121
+ msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first."
122
+ msgstr ""
123
+
124
+ #: postviews-options.php:169
125
+ msgid "The following WordPress Options/PostMetas will be DELETED:"
126
+ msgstr ""
127
+
128
+ #: postviews-options.php:173
129
+ msgid "WordPress Options"
130
+ msgstr ""
131
+
132
+ #: postviews-options.php:174
133
+ msgid "WordPress PostMetas"
134
+ msgstr ""
135
+
136
+ #: postviews-options.php:199
137
+ msgid "Yes"
138
+ msgstr ""
139
+
140
+ #: postviews-options.php:200
141
+ msgid ""
142
+ "You Are About To Uninstall WP-PostViews From WordPress.\\n"
143
+ "This Action Is Not Reversible.\\n"
144
+ "\\n"
145
+ " Choose [Cancel] To Stop, [OK] To Uninstall."
146
+ msgstr ""
147
+
148
+ #: postviews-widget.php:55
149
+ msgid "Most Viewed"
150
+ msgstr ""
151
+
152
+ #: postviews-widget.php:65
153
+ msgid "Title"
154
+ msgstr ""
155
+
156
+ #: postviews-widget.php:68
157
+ msgid "Show Views For: "
158
+ msgstr ""
159
+
160
+ #: postviews-widget.php:74
161
+ msgid "Post &amp Page"
162
+ msgstr ""
163
+
164
+ #: postviews-widget.php:79
165
+ msgid "Post"
166
+ msgstr ""
167
+
168
+ #: postviews-widget.php:84
169
+ msgid "Page"
170
+ msgstr ""
171
+
172
+ #: postviews-widget.php:87
173
+ msgid "Only"
174
+ msgstr ""
175
+
176
+ #: postviews-widget.php:90
177
+ msgid "Limit"
178
+ msgstr ""
179
+
180
+ #: postviews-widget.php:93
181
+ msgid "Post Title Length (Characters)"
182
+ msgstr ""
183
+
184
+ #: postviews-widget.php:95
185
+ msgid "(<strong>0</strong> to disable)"
186
+ msgstr ""
187
+
188
+ #: postviews.php:42
189
+ msgid "Post Views"
190
+ msgstr ""
191
+
192
+ #: postviews.php:112
193
+ #: postviews.php:119
194
+ #: postviews.php:157
195
  #: postviews.php:164
196
+ #: postviews.php:197
197
+ #: postviews.php:233
198
+ msgid "views"
199
  msgstr ""
200
 
201
+ #: postviews.php:123
202
+ #: postviews.php:168
203
+ #: postviews.php:200
204
+ #: postviews.php:236
205
  msgid "N/A"
206
  msgstr ""
207
 
208
+ #: postviews.php:331
209
+ #: postviews.php:333
210
+ #: postviews.php:356
211
+ msgid "WP-PostViews"
212
+ msgstr ""
213
+
214
+ #: postviews.php:344
215
+ #: postviews.php:346
216
+ msgid "Most Viewed Posts"
217
+ msgstr ""
218
+
219
+ #: postviews.php:358
220
+ msgid "views were generated."
221
+ msgstr ""
222
+
223
+ #: postviews.php:370
224
+ msgid "Most Viewed Post"
225
+ msgstr ""
226
+
readme.html CHANGED
@@ -2,7 +2,7 @@
2
  <html>
3
  <head>
4
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5
- <title>WP-PostViews 1.11 Readme</title>
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.11&nbsp;&nbsp;&nbsp;<span style="color: #aaaaaa;">Readme</span></div>
207
 
208
  <!-- Tabs -->
209
  <ul id="Tabs">
@@ -229,13 +229,13 @@
229
  <strong>&raquo;</strong>
230
  <script type="text/javascript">
231
  /* <![CDATA[*/
232
- document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-PostViews%201.11%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>');
233
  /* ]]> */
234
  </script>
235
  </p>
236
  <p>
237
  <strong>Website:</strong><br />
238
- <strong>&raquo;</strong> <a href="http://www.lesterchan.net/" title="http://www.lesterchan.net/">http://www.lesterchan.net/</a>
239
  </p>
240
  <p>
241
  <strong>Features:</strong><br />
@@ -243,11 +243,16 @@
243
  </p>
244
  <p>
245
  <strong>Download:</strong><br />
246
- <strong>&raquo;</strong> <a href="http://www.lesterchan.net/others/downloads.php?id=19" title="http://www.lesterchan.net/others/downloads.php?id=19">WP-PostViews 1.11 For WordPress 2.1.x And Above</a><br />
247
- <strong>&raquo;</strong> <a href="http://www.lesterchan.net/others/downloads/wp-postviews102.zip" title="http://www.lesterchan.net/others/downloads/wp-postviews102.zip">WP-PostViews 1.02 For WordPress 2.0.x</a><br />
 
248
  </p>
249
  <p>
250
- <strong>Demo:</strong><br /><strong>&raquo;</strong> <a href="http://www.lesterchan.net/wordpress/" title="http://www.lesterchan.net/wordpress/">http://www.lesterchan.net/wordpress/</a>
 
 
 
 
251
  </p>
252
  <p>
253
  <strong>Development:</strong><br />
@@ -263,7 +268,7 @@
263
  </p>
264
  <p>
265
  <strong>Updated:</strong><br />
266
- <strong>&raquo;</strong> 1st June 2007
267
  </p>
268
  <p>
269
  <strong>Note:</strong><br />
@@ -284,6 +289,15 @@
284
  <div id="Changelog" style="display: none;">
285
  <div class="SubTitle">&raquo; Changelog</div>
286
  <ul>
 
 
 
 
 
 
 
 
 
287
  <li>
288
  <strong>Version 1.11 (01-06-2007)</strong>
289
  <ul>
@@ -344,7 +358,7 @@
344
  <!-- Upgrade Instructions -->
345
  <div id="Upgrade" style="display: none;">
346
  <div class="SubTitle">&raquo; Upgrade Instructions</div>
347
- <div class="SubSubTitle">From v1.0x To v1.11</div>
348
  <ol>
349
  <li>
350
  <strong>Deactivate</strong> WP-PostViews Plugin
@@ -389,8 +403,30 @@
389
  <blockquote>
390
  &lt;?php if(function_exists('the_views')) { the_views(); } ?&gt;
391
  </blockquote>
392
- <p>The <strong>first value</strong> you pass in is the text for views.</p>
393
- <p>Default: the_views('Views');</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
394
  </li>
395
  </ol>
396
  <div class="SubSubTitle">View Stats (Outside WP Loop)</div>
@@ -431,6 +467,6 @@
431
  </div>
432
  </div>
433
  </div>
434
- <p id="Copyright">WP-PostViews 1.11<br />Copyright &copy; 2007 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
435
  </body>
436
  </html>
2
  <html>
3
  <head>
4
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5
+ <title>WP-PostViews 1.20 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.20&nbsp;&nbsp;&nbsp;<span style="color: #aaaaaa;">Readme</span></div>
207
 
208
  <!-- Tabs -->
209
  <ul id="Tabs">
229
  <strong>&raquo;</strong>
230
  <script type="text/javascript">
231
  /* <![CDATA[*/
232
+ document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-PostViews%201.20%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>');
233
  /* ]]> */
234
  </script>
235
  </p>
236
  <p>
237
  <strong>Website:</strong><br />
238
+ <strong>&raquo;</strong> <a href="http://lesterchan.net/" title="http://lesterchan.net/">http://lesterchan.net/</a>
239
  </p>
240
  <p>
241
  <strong>Features:</strong><br />
243
  </p>
244
  <p>
245
  <strong>Download:</strong><br />
246
+ <strong>&raquo;</strong> <a href="http://lesterchan.net/others/downloads.php?id=19" title="http://lesterchan.net/others/downloads.php?id=19">WP-PostViews 1.20 For WordPress 2.3.x</a><br />
247
+ <strong>&raquo;</strong> <a href="http://lesterchan.net/others/downloads/wp-postviews111.zip" title="http://lesterchan.net/others/downloads/wp-postviews111.zip">WP-PostViews 1.11 For WordPress 2.1.x And 2.2.x</a><br />
248
+ <strong>&raquo;</strong> <a href="http://lesterchan.net/others/downloads/wp-postviews102.zip" title="http://lesterchan.net/others/downloads/wp-postviews102.zip">WP-PostViews 1.02 For WordPress 2.0.x</a><br />
249
  </p>
250
  <p>
251
+ <strong>Screenshots:</strong><br />
252
+ <strong>&raquo;</strong> <a href="http://lesterchan.net/wordpress/screenshots/browse/wp-postviews/" title="http://lesterchan.net/wordpress/screenshots/browse/wp-postviews/">http://lesterchan.net/wordpress/screenshots/browse/wp-postviews/</a>
253
+ </p>
254
+ <p>
255
+ <strong>Demo:</strong><br /><strong>&raquo;</strong> <a href="http://lesterchan.net/wordpress/" title="http://lesterchan.net/wordpress/">http://lesterchan.net/wordpress/</a>
256
  </p>
257
  <p>
258
  <strong>Development:</strong><br />
268
  </p>
269
  <p>
270
  <strong>Updated:</strong><br />
271
+ <strong>&raquo;</strong> 1st October 2007
272
  </p>
273
  <p>
274
  <strong>Note:</strong><br />
289
  <div id="Changelog" style="display: none;">
290
  <div class="SubTitle">&raquo; Changelog</div>
291
  <ul>
292
+ <li>
293
+ <strong>Version 1.20 (01-10-2007)</strong>
294
+ <ul>
295
+ <li>NEW: Works For WordPress 2.3 Only</li>
296
+ <li>NEW: Most Viewed Widget Added</li>
297
+ <li>NEW: Ability To Uninstall WP-PostViews</li>
298
+ <li>NEW: Uses WP-Stats Filter To Add Stats Into WP-Stats Page</li>
299
+ </ul>
300
+ </li>
301
  <li>
302
  <strong>Version 1.11 (01-06-2007)</strong>
303
  <ul>
358
  <!-- Upgrade Instructions -->
359
  <div id="Upgrade" style="display: none;">
360
  <div class="SubTitle">&raquo; Upgrade Instructions</div>
361
+ <div class="SubSubTitle">From v1.0x To v1.20</div>
362
  <ol>
363
  <li>
364
  <strong>Deactivate</strong> WP-PostViews Plugin
403
  <blockquote>
404
  &lt;?php if(function_exists('the_views')) { the_views(); } ?&gt;
405
  </blockquote>
406
+ </li>
407
+ <li>
408
+ Go to <strong>'WP-Admin -> Options -> Post Views'</strong> to configure the plugin.
409
+ </li>
410
+ </ol>
411
+ <div class="SubSubTitle">View Stats (With Widgets)</div>
412
+ <ol>
413
+ <li>
414
+ <strong>Activate</strong> WP-PostViews Widget Plugin
415
+ </li>
416
+ <li>
417
+ Go to '<strong>WP-Admin -> Presentation -> Widgets</strong>'
418
+ </li>
419
+ <li>
420
+ To Display <strong>Most Viewed Post</strong>
421
+ </li>
422
+ <li>
423
+ <strong>Drag</strong> the Most Viewed Widget to your sidebar
424
+ </li>
425
+ <li>
426
+ You can <strong>configure</strong> the Most Viewed Widget by clicking on the configure icon
427
+ </li>
428
+ <li>
429
+ Click 'Save changes'
430
  </li>
431
  </ol>
432
  <div class="SubSubTitle">View Stats (Outside WP Loop)</div>
467
  </div>
468
  </div>
469
  </div>
470
+ <p id="Copyright">WP-PostViews 1.20<br />Copyright &copy; 2007 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
471
  </body>
472
  </html>
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === WP-PostViews ===
2
  Contributors: GamerZ
3
- Donate link: http://www.lesterchan.net/wordpress
4
  Tags: views, hits, counter, postviews
5
- Requires at least: 2.1.0
6
- Stable tag: 1.11
7
 
8
  Enables you to display how many times a post/page had been viewed.
9
 
@@ -11,21 +11,21 @@ Enables you to display how many times a post/page had been viewed.
11
 
12
  It will not count registered member views, but that can be changed easily.
13
 
14
- All the information (general, changelog, installation, upgrade, usage) you need about this plugin can be found here: [WP-PostViews Readme](http://www.lesterchan.net/wordpress/readme/wp-postviews.html "WP-PostViews Readme").
15
  It is the exact same readme.html is included in the zip package.
16
 
17
  == Development Blog ==
18
 
19
- [GaMerZ WordPress Plugins Development Blog](http://www.lesterchan.net/wordpress/ "GaMerZ WordPress Plugins Development Blog")
20
 
21
  == Installation ==
22
 
23
- [WP-PostViews Readme](http://www.lesterchan.net/wordpress/readme/wp-postviews.html "WP-PostViews Readme") (Installation Tab)
24
 
25
  == Screenshots ==
26
 
27
- [GaMerZ WordPress Plugins Screenshots](http://www.lesterchan.net/wordpress/screenshots/ "GaMerZ WordPress Plugins Screenshots")
28
 
29
  == Frequently Asked Questions ==
30
 
31
- You will need [GaMerZ WordPress Plugins Support Forums](http://forums.lesterchan.net/ "GaMerZ WordPress Plugins Support Forums")
1
  === WP-PostViews ===
2
  Contributors: GamerZ
3
+ Donate link: http://lesterchan.net/wordpress
4
  Tags: views, hits, counter, postviews
5
+ Requires at least: 2.3.0
6
+ Stable tag: 1.20
7
 
8
  Enables you to display how many times a post/page had been viewed.
9
 
11
 
12
  It will not count registered member views, but that can be changed easily.
13
 
14
+ All the information (general, changelog, installation, upgrade, usage) you need about this plugin can be found here: [WP-PostViews Readme](http://lesterchan.net/wordpress/readme/wp-postviews.html "WP-PostViews Readme").
15
  It is the exact same readme.html is included in the zip package.
16
 
17
  == Development Blog ==
18
 
19
+ [GaMerZ WordPress Plugins Development Blog](http://lesterchan.net/wordpress/ "GaMerZ WordPress Plugins Development Blog")
20
 
21
  == Installation ==
22
 
23
+ [WP-PostViews Readme](http://lesterchan.net/wordpress/readme/wp-postviews.html "WP-PostViews Readme") (Installation Tab)
24
 
25
  == Screenshots ==
26
 
27
+ [WP-PostViews Screenshots](http://lesterchan.net/wordpress/screenshots/browse/wp-postviews/ "WP-PostViews Screenshots")
28
 
29
  == Frequently Asked Questions ==
30
 
31
+ [WP-PostViews Support Forums](http://forums.lesterchan.net/index.php?board=16.0 "WP-PostViews Support Forums")