WP-PostViews - Version 1.10

Version Description

Download this release

Release Info

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

Version 1.10

Files changed (4) hide show
  1. postviews/postviews.php +233 -0
  2. postviews/wp-postviews.pot +31 -0
  3. readme.html +430 -0
  4. readme.txt +31 -0
postviews/postviews.php ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 had been viewed. It will not count registered member views, but that can be changed easily.
6
+ Version: 1.10
7
+ Author: GaMerZ
8
+ Author URI: http://www.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
+ ### 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($post_views > 0) {
44
+ update_post_meta($id, 'views', ($post_views+1));
45
+ } else {
46
+ add_post_meta($id, 'views', 1, true);
47
+ }
48
+ remove_action('loop_start', 'process_postviews');
49
+ }
50
+ }
51
+ }
52
+
53
+
54
+ ### Function: Display The Post Views
55
+ function the_views($text_views = '', $display = true) {
56
+ if(empty($text_views)) {
57
+ $text_views = __('Views', 'wp-postviews');
58
+ }
59
+ $post_views = intval(post_custom('views'));
60
+ if($display) {
61
+ echo number_format($post_views).' '.$text_views;
62
+ } else {
63
+ return $post_views;
64
+ }
65
+ }
66
+
67
+
68
+ ### Function: Display Most Viewed Page/Post
69
+ if(!function_exists('get_most_viewed')) {
70
+ function get_most_viewed($mode = '', $limit = 10, $chars = 0, $display = true) {
71
+ global $wpdb, $post;
72
+ $where = '';
73
+ $temp = '';
74
+ if(!empty($mode) && $mode != 'both') {
75
+ $where = "post_type = '$mode'";
76
+ } else {
77
+ $where = '1=1';
78
+ }
79
+ $most_viewed = $wpdb->get_results("SELECT $wpdb->posts.ID, post_title, post_name, post_status, post_date, (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");
80
+ if($most_viewed) {
81
+ if($chars > 0) {
82
+ foreach ($most_viewed as $post) {
83
+ $post_title = htmlspecialchars(stripslashes($post->post_title));
84
+ $post_views = intval($post->views);
85
+ $post_views = number_format($post_views);
86
+ $temp .= "<li><a href=\"".get_permalink()."\">".snippet_chars($post_title, $chars)."</a> - $post_views ".__('Views', 'wp-postviews')."</li>\n";
87
+ }
88
+ } else {
89
+ foreach ($most_viewed as $post) {
90
+ $post_title = htmlspecialchars(stripslashes($post->post_title));
91
+ $post_views = intval($post->views);
92
+ $post_views = number_format($post_views);
93
+ $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $post_views ".__('Views', 'wp-postviews')."</li>\n";
94
+ }
95
+ }
96
+ } else {
97
+ $temp = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
98
+ }
99
+ if($display) {
100
+ echo $temp;
101
+ } else {
102
+ return $temp;
103
+ }
104
+ }
105
+ }
106
+
107
+
108
+ ### Function: Display Most Viewed Page/Post By Category ID
109
+ if(!function_exists('get_most_viewed_category')) {
110
+ function get_most_viewed_category($category_id = 0, $mode = '', $limit = 10, $chars = 0, $display = true) {
111
+ global $wpdb, $post;
112
+ $where = '';
113
+ $temp = '';
114
+ if(!empty($mode) && $mode != 'both') {
115
+ $where = "post_type = '$mode'";
116
+ } else {
117
+ $where = '1=1';
118
+ }
119
+ $most_viewed = $wpdb->get_results("SELECT $wpdb->posts.ID, post_title, post_name, post_status, post_date, (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");
120
+ if($most_viewed) {
121
+ if($chars > 0) {
122
+ foreach ($most_viewed as $post) {
123
+ $post_title = htmlspecialchars(stripslashes($post->post_title));
124
+ $post_views = intval($post->views);
125
+ $post_views = number_format($post_views);
126
+ $temp .= "<li><a href=\"".get_permalink()."\">".snippet_chars($post_title, $chars)."</a> - $post_views ".__('Views', 'wp-postviews')."</li>\n";
127
+ }
128
+ } else {
129
+ foreach ($most_viewed as $post) {
130
+ $post_title = htmlspecialchars(stripslashes($post->post_title));
131
+ $post_views = intval($post->views);
132
+ $post_views = number_format($post_views);
133
+ $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $post_views ".__('Views', 'wp-postviews')."</li>\n";
134
+ }
135
+ }
136
+ } else {
137
+ $temp = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
138
+ }
139
+ if($display) {
140
+ echo $temp;
141
+ } else {
142
+ return $temp;
143
+ }
144
+ }
145
+ }
146
+
147
+
148
+ ### Added by Paolo Tagliaferri (http://www.vortexmind.net - webmaster@vortexmind.net)
149
+ function get_timespan_most_viewed($mode = '', $limit = 10, $days = 7, $display = true) {
150
+ global $wpdb, $post;
151
+ $limit_date = current_time('timestamp') - ($days*86400);
152
+ $limit_date = date("Y-m-d H:i:s",$limit_date);
153
+ $where = '';
154
+ $temp = '';
155
+ if(!empty($mode) && $mode != 'both') {
156
+ $where = "post_type = '$mode'";
157
+ } else {
158
+ $where = '1=1';
159
+ }
160
+ $most_viewed = $wpdb->get_results("SELECT $wpdb->posts.ID, post_title, post_name, post_status, post_date, (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");
161
+ if($most_viewed) {
162
+ foreach ($most_viewed as $post) {
163
+ $post_title = htmlspecialchars(stripslashes($post->post_title));
164
+ $post_views = intval($post->views);
165
+ $post_views = number_format($post_views);
166
+ $temp .= "<li><a href=\"".get_permalink()."\">$post_title</a> - $post_views ".__('Views', 'wp-postviews')."</li>";
167
+ }
168
+ } else {
169
+ $temp = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
170
+ }
171
+ if($display) {
172
+ echo $temp;
173
+ } else {
174
+ return $temp;
175
+ }
176
+ }
177
+
178
+
179
+ ### Function: Display Total Views
180
+ if(!function_exists('get_totalviews')) {
181
+ function get_totalviews($display = true) {
182
+ global $wpdb;
183
+ $total_views = $wpdb->get_var("SELECT SUM(meta_value+0) FROM $wpdb->postmeta WHERE meta_key = 'views'");
184
+ if($display) {
185
+ echo number_format($total_views);
186
+ } else {
187
+ return number_format($total_views);
188
+ }
189
+ }
190
+ }
191
+
192
+
193
+ ### Function: Snippet Text
194
+ if(!function_exists('snippet_chars')) {
195
+ function snippet_chars($text, $length = 0) {
196
+ $text = htmlspecialchars_decode($text);
197
+ if (strlen($text) > $length){
198
+ return htmlspecialchars(substr($text,0,$length)).'...';
199
+ } else {
200
+ return htmlspecialchars($text);
201
+ }
202
+ }
203
+ }
204
+
205
+
206
+ ### Function: HTML Special Chars Decode
207
+ if (!function_exists('htmlspecialchars_decode')) {
208
+ function htmlspecialchars_decode($text) {
209
+ return strtr($text, array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
210
+ }
211
+ }
212
+
213
+
214
+ ### Function: Modify Default WordPress Listing To Make It Sorted By Post Views
215
+ function views_join($content) {
216
+ global $wpdb;
217
+ $content .= " LEFT JOIN $wpdb->postmeta ON $wpdb->postmeta.post_id = $wpdb->posts.ID";
218
+ return $content;
219
+ }
220
+ function views_where($content) {
221
+ global $wpdb;
222
+ $content .= " AND $wpdb->postmeta.meta_key = 'views'";
223
+ return $content;
224
+ }
225
+ function views_orderby($content) {
226
+ global $wpdb;
227
+ $content = " $wpdb->postmeta.meta_value DESC";
228
+ return $content;
229
+ }
230
+ //add_filter('posts_join', 'views_join');
231
+ //add_filter('posts_where', 'views_where');
232
+ //add_filter('posts_orderby', 'views_orderby');
233
+ ?>
postviews/wp-postviews.pot ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP-PostViews 1.10\n"
4
+ "POT-Creation-Date: \n"
5
+ "PO-Revision-Date: 2007-01-30 20:31+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"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-Language: English\n"
12
+ "X-Poedit-Country: SINGAPORE\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SearchPath-0: .\n"
16
+
17
+ #: postviews.php:57
18
+ #: postviews.php:86
19
+ #: postviews.php:93
20
+ #: postviews.php:126
21
+ #: postviews.php:133
22
+ #: postviews.php:166
23
+ msgid "Views"
24
+ msgstr ""
25
+
26
+ #: postviews.php:97
27
+ #: postviews.php:137
28
+ #: postviews.php:169
29
+ msgid "N/A"
30
+ msgstr ""
31
+
readme.html ADDED
@@ -0,0 +1,430 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.10 Readme</title>
6
+ <style type="text/css" media="screen">
7
+ /* Default Style */
8
+ BODY {
9
+ font-family: Verdana, Arial;
10
+ font-size: 12px;
11
+ color: #000000;
12
+ background: #FFFFFF;
13
+ }
14
+ P {
15
+ padding-left: 10px;
16
+ }
17
+ BLOCKQUOTE {
18
+ margin: 10px 20px 0px 20px;
19
+ padding: 10px;
20
+ border: 1px solid #8d8d8d;
21
+ background-color: #f5f5f5;
22
+ }
23
+ LI {
24
+ margin-top: 20px;
25
+ }
26
+ UL LI UL LI {
27
+ margin-top: 10px;
28
+ }
29
+ A, A:active, A:link, A:visited {
30
+ color: #2d3a4c;
31
+ text-decoration: none;
32
+ }
33
+ A:hover {
34
+ color: #5577a5;
35
+ text-decoration: underline;
36
+ }
37
+ /* Place Holder Style */
38
+ #Container {
39
+ width: 780px;
40
+ margin-left: auto;
41
+ margin-right: auto;
42
+ }
43
+ #Content {
44
+ background-color: #fafafa;
45
+ border: 1px solid #a2b6cb;
46
+ padding: 10px;
47
+ margin-top: -13px;
48
+ }
49
+ /* Title Style */
50
+ #Title {
51
+ font-family: Verdana, Arial;
52
+ font-size: 22px;
53
+ font-weight: bold;
54
+ color: #389aff;
55
+ border-bottom: 1px solid #389aff;
56
+ margin-bottom: 10px;
57
+ }
58
+ .SubTitle {
59
+ font-family: Verdana, Arial;
60
+ font-size: 18px;
61
+ font-weight: bold;
62
+ color: #5b87b4;
63
+ }
64
+ .SubSubTitle {
65
+ font-family: Verdana, Arial;
66
+ font-size: 14px;
67
+ font-weight: bold;
68
+ color: #73a4d6;
69
+ }
70
+ /* Tabs */
71
+ UL#Tabs {
72
+ font-family: Verdana, Arial;
73
+ font-size: 12px;
74
+ font-weight: bold;
75
+ list-style-type: none;
76
+ padding-bottom: 28px;
77
+ border-bottom: 1px solid #a2b6cb;
78
+ margin-bottom: 12px;
79
+ z-index: 1;
80
+ }
81
+ #Tabs LI.Tab {
82
+ float: right;
83
+ height: 25px;
84
+ background-color: #deedfb;
85
+ margin: 2px 0px 0px 5px;
86
+ border: 1px solid #a2b6cb;
87
+ }
88
+ #Tabs LI.Tab A {
89
+ float: left;
90
+ display: block;
91
+ color: #666666;
92
+ text-decoration: none;
93
+ padding: 5px;
94
+ }
95
+ #Tabs LI.Tab A:hover {
96
+ background-color: #bfe0fe;
97
+ border-bottom: 1px solid #bfe0fe;
98
+ }
99
+ /* Selected Tab */
100
+ #Tabs LI.SelectedTab {
101
+ float: right;
102
+ height: 25px;
103
+ background-color: #fafafa;
104
+ margin: 2px 0px 0px 5px;
105
+ border-top: 1px solid #a2b6cb;
106
+ border-right: 1px solid #a2b6cb;
107
+ border-bottom: 1px solid #fafafa;
108
+ border-left: 1px solid #a2b6cb;
109
+ }
110
+ #Tabs LI.SelectedTab A {
111
+ float: left;
112
+ display: block;
113
+ color: #666666;
114
+ text-decoration: none;
115
+ padding: 5px;
116
+ cursor: default;
117
+ }
118
+ /* Copyright */
119
+ #Copyright {
120
+ text-align: center;
121
+ }
122
+ </style>
123
+ <script type="text/javascript">
124
+ /* <![CDATA[*/
125
+ // Index Page
126
+ function index() {
127
+ // Tab
128
+ document.getElementById('IndexTab').className = 'SelectedTab';
129
+ document.getElementById('ChangelogTab').className = 'Tab';
130
+ document.getElementById('InstallTab').className = 'Tab';
131
+ document.getElementById('UpgradeTab').className = 'Tab';
132
+ document.getElementById('UsageTab').className = 'Tab';
133
+ // Page
134
+ document.getElementById('Index').style.display= 'block';
135
+ document.getElementById('Changelog').style.display = 'none';
136
+ document.getElementById('Install').style.display = 'none';
137
+ document.getElementById('Upgrade').style.display = 'none';
138
+ document.getElementById('Usage').style.display = 'none';
139
+ }
140
+ // Changelog Page
141
+ function changelog() {
142
+ // Tab
143
+ document.getElementById('IndexTab').className = 'Tab';
144
+ document.getElementById('ChangelogTab').className = 'SelectedTab';
145
+ document.getElementById('InstallTab').className = 'Tab';
146
+ document.getElementById('UpgradeTab').className = 'Tab';
147
+ document.getElementById('UsageTab').className = 'Tab';
148
+ // Page
149
+ document.getElementById('Index').style.display = 'none';
150
+ document.getElementById('Changelog').style.display = 'block';
151
+ document.getElementById('Install').style.display = 'none';
152
+ document.getElementById('Upgrade').style.display = 'none';
153
+ document.getElementById('Usage').style.display = 'none';
154
+ }
155
+ // Installation Page
156
+ function install() {
157
+ // Tab
158
+ document.getElementById('IndexTab').className = 'Tab';
159
+ document.getElementById('ChangelogTab').className = 'Tab';
160
+ document.getElementById('InstallTab').className = 'SelectedTab';
161
+ document.getElementById('UpgradeTab').className = 'Tab';
162
+ document.getElementById('UsageTab').className = 'Tab';
163
+ // Page
164
+ document.getElementById('Index').style.display= 'none';
165
+ document.getElementById('Changelog').style.display = 'none';
166
+ document.getElementById('Install').style.display = 'block';
167
+ document.getElementById('Upgrade').style.display = 'none';
168
+ document.getElementById('Usage').style.display = 'none';
169
+ }
170
+ // Upgrade Page
171
+ function upgrade() {
172
+ // Tab
173
+ document.getElementById('IndexTab').className = 'Tab';
174
+ document.getElementById('ChangelogTab').className = 'Tab';
175
+ document.getElementById('InstallTab').className = 'Tab';
176
+ document.getElementById('UpgradeTab').className = 'SelectedTab';
177
+ document.getElementById('UsageTab').className = 'Tab';
178
+ // Page
179
+ document.getElementById('Index').style.display= 'none';
180
+ document.getElementById('Changelog').style.display = 'none';
181
+ document.getElementById('Install').style.display = 'none';
182
+ document.getElementById('Upgrade').style.display = 'block';
183
+ document.getElementById('Usage').style.display = 'none';
184
+ }
185
+ // Usage Page
186
+ function usage() {
187
+ // Tab
188
+ document.getElementById('IndexTab').className = 'Tab';
189
+ document.getElementById('ChangelogTab').className = 'Tab';
190
+ document.getElementById('InstallTab').className = 'Tab';
191
+ document.getElementById('UpgradeTab').className = 'Tab';
192
+ document.getElementById('UsageTab').className = 'SelectedTab';
193
+ // Page
194
+ document.getElementById('Index').style.display= 'none';
195
+ document.getElementById('Changelog').style.display = 'none';
196
+ document.getElementById('Install').style.display = 'none';
197
+ document.getElementById('Upgrade').style.display = 'none';
198
+ document.getElementById('Usage').style.display = 'block';
199
+ }
200
+ /* ]]> */
201
+ </script>
202
+ </head>
203
+ <body>
204
+ <div id="Container">
205
+ <!-- Title -->
206
+ <div id="Title">WP-PostViews 1.10&nbsp;&nbsp;&nbsp;<span style="color: #aaaaaa;">Readme</span></div>
207
+
208
+ <!-- Tabs -->
209
+ <ul id="Tabs">
210
+ <li id="UsageTab" class="Tab"><a href="#Usage" onclick="usage(); return false;" title="Usage Instructions">Usage</a></li>
211
+ <li id="UpgradeTab" class="Tab"><a href="#Upgrade" onclick="upgrade(); return false;" title="Upgrade Instructions">Upgrade</a></li>
212
+ <li id="InstallTab" class="Tab"><a href="#Installation" onclick="install(); return false;" title="Installation Instructions">Installation</a></li>
213
+ <li id="ChangelogTab" class="Tab"><a href="#Changelog" onclick="changelog(); return false;" title="Changelog">Changelog</a></li>
214
+ <li id="IndexTab" class="SelectedTab"><a href="#Index" onclick="index(); return false;" title="Index Instructions">Index</a></li>
215
+ </ul>
216
+
217
+ <!-- Content -->
218
+ <div id="Content">
219
+ <!-- Index -->
220
+ <div id="Index">
221
+ <div class="SubTitle">&raquo; Index</div>
222
+ <div class="SubSubTitle">Plugin Information</div>
223
+ <p>
224
+ <b>Author:</b><br />
225
+ <b>&raquo;</b> Lester 'GaMerZ' Chan
226
+ </p>
227
+ <p>
228
+ <b>EMail:</b><br />
229
+ <b>&raquo;</b>
230
+ <script type="text/javascript">
231
+ /* <![CDATA[*/
232
+ document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-PostViews%201.10%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>');
233
+ /* ]]> */
234
+ </script>
235
+ </p>
236
+ <p>
237
+ <b>Website:</b><br />
238
+ <b>&raquo;</b> <a href="http://www.lesterchan.net/" title="http://www.lesterchan.net/">http://www.lesterchan.net/</a>
239
+ </p>
240
+ <p>
241
+ <b>Features:</b><br />
242
+ <b>&raquo;</b> Enables you to display how many times a post had been viewed. It will not count registered member views, but that can be changed easily.
243
+ </p>
244
+ <p>
245
+ <b>Download:</b><br />
246
+ <b>&raquo;</b> <a href="http://www.lesterchan.net/others/downloads.php?id=19" title="http://www.lesterchan.net/others/downloads.php?id=19">WP-PostViews 1.10 For WordPress 2.1.x</a><br />
247
+ <b>&raquo;</b> <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
+ <b>Demo:</b><br /><b>&raquo;</b> <a href="http://www.lesterchan.net/wordpress/" title="http://www.lesterchan.net/wordpress/">http://www.lesterchan.net/wordpress/</a>
251
+ </p>
252
+ <p>
253
+ <b>Development:</b><br />
254
+ <b>&raquo;</b> <a href="http://dev.wp-plugins.org/browser/wp-postviews/" title="http://dev.wp-plugins.org/browser/wp-postviews/">http://dev.wp-plugins.org/browser/wp-postviews/</a>
255
+ </p>
256
+ <p>
257
+ <b>Translations:</b><br />
258
+ <b>&raquo;</b> <a href="http://dev.wp-plugins.org/browser/wp-postviews/i18n/" title="http://dev.wp-plugins.org/browser/wp-postviews/i18n/">http://dev.wp-plugins.org/browser/wp-postviews/i18n/</a>
259
+ </p>
260
+ <p>
261
+ <b>Support Forums:</b><br />
262
+ <b>&raquo;</b> <a href="http://forums.lesterchan.net/index.php?board=16.0" title="http://forums.lesterchan.net/index.php?board=16.0">http://forums.lesterchan.net/index.php?board=16.0</a>
263
+ </p>
264
+ <p>
265
+ <b>Updated:</b><br />
266
+ <b>&raquo;</b> 1st February 2007
267
+ </p>
268
+ <p>
269
+ <b>Note:</b><br />
270
+ <b>&raquo;</b> The <b>Changelog</b>, <b>Installation</b>, <b>Upgrade</b>, <b>Usage</b> Tab at the top of the page.
271
+ </p>
272
+ <p>
273
+ <b>Donations:</b><br />
274
+ <b>&raquo;</b> I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks as my school allowance, I will really appericiate it. If not feel free to use it without any obligations. Thank You. My Paypal account is
275
+ <script type="text/javascript">
276
+ /* <![CDATA[*/
277
+ document.write(' <b>gamerz84@hotmail.com</b>.');
278
+ /* ]]> */
279
+ </script>
280
+ </p>
281
+ </div>
282
+
283
+ <!-- Changelog -->
284
+ <div id="Changelog" style="display: none;">
285
+ <div class="SubTitle">&raquo; Changelog</div>
286
+ <ul>
287
+ <li>
288
+ <b>Version 1.10 (01-02-2007)</b>
289
+ <ul>
290
+ <li>NEW: Works For WordPress 2.1 Only</li>
291
+ <li>NEW: Localization WP-PostViews</li>
292
+ <li>NEW: Added Function To Get Most Viewed Post By Category ID</li>
293
+ <li>FIXED: Views Not Counting In Some Cases</li>
294
+ </ul>
295
+ </li>
296
+ <li>
297
+ <b>Version 1.02 (01-10-2006)</b>
298
+ <ul>
299
+ <li>NEW: Change In get_most_viewed() To Accommodate Latest Version Of WP-Stats</li>
300
+ </ul>
301
+ </li>
302
+ <li>
303
+ <b>Version 1.01 (01-07-2006)</b>
304
+ <ul>
305
+ <li>NEW: Added Get Total Views Function</li>
306
+ <li>FIXED: Modified Get Most Viewed Post Function</li>
307
+ </ul>
308
+ </li>
309
+ <li>
310
+ <b>Version 1.00 (01-03-2006)</b>
311
+ <ul>
312
+ <li>NEW: Initial Release</li>
313
+ </ul>
314
+ </li>
315
+ </ul>
316
+ </div>
317
+
318
+ <!-- Installation Instructions -->
319
+ <div id="Install" style="display: none;">
320
+ <div class="SubTitle">&raquo; Installation Instructions</div>
321
+ <ol>
322
+ <li>
323
+ Open <b>wp-content/plugins</b> Folder
324
+ </li>
325
+ <li>
326
+ Put:
327
+ <blockquote>Folder: postviews</blockquote>
328
+ </li>
329
+ <li>
330
+ <b>Activate</b> WP-PostViews Plugin
331
+ </li>
332
+ <li>
333
+ Refer To <b>Usage</b> For Further Instructions
334
+ </li>
335
+ </ol>
336
+ </div>
337
+
338
+ <!-- Upgrade Instructions -->
339
+ <div id="Upgrade" style="display: none;">
340
+ <div class="SubTitle">&raquo; Upgrade Instructions</div>
341
+ <div class="SubSubTitle">From v1.0x To v1.10</div>
342
+ <ol>
343
+ <li>
344
+ <b>Deactivate</b> WP-PostViews Plugin
345
+ </li>
346
+ <li>
347
+ Open <b>wp-content/plugins</b> Folder
348
+ </li>
349
+ <li>
350
+ Put/Overwrite:
351
+ <blockquote>Folder: postviews</blockquote>
352
+ </li>
353
+ <li>
354
+ Delete:
355
+ <blockquote>File: postviews.php</blockquote>
356
+ </li>
357
+ <li>
358
+ <b>Activate</b> WP-PostViews Plugin
359
+ </li>
360
+ <li>
361
+ Refer To <b>Usage</b> For Further Instructions
362
+ </li>
363
+ </ol>
364
+ </div>
365
+
366
+ <!-- Usage Instructions -->
367
+ <div id="Usage" style="display: none;">
368
+ <div class="SubTitle">&raquo; Usage Instructions</div>
369
+ <div class="SubSubTitle">General Usage</div>
370
+ <ol>
371
+ <li>
372
+ Open <b>wp-content/themes/&lt;YOUR THEME NAME&gt;/index.php</b>
373
+ <p>You may place it in <b>single.php</b>, <b>post.php</b> or <b>page.php</b> also.</p>
374
+ </li>
375
+ <li>
376
+ Find:
377
+ <blockquote>
378
+ &lt;?php while (have_posts()) : the_post(); ?&gt;
379
+ </blockquote>
380
+ </li>
381
+ <li>
382
+ Add Anywhere Below It:
383
+ <blockquote>
384
+ &lt;?php if(function_exists('the_views')) { the_views(); } ?&gt;
385
+ </blockquote>
386
+ <p>The <b>first value</b> you pass in is the text for views.</p>
387
+ <p>Default: the_views('Views');</p>
388
+ </li>
389
+ </ol>
390
+ <div class="SubSubTitle">View Stats (Outside WP Loop)</div>
391
+ <ul>
392
+ <li>
393
+ To Display <b>Most Viewed Post</b>
394
+ </li>
395
+ <li>
396
+ Use:
397
+ <blockquote>
398
+ &lt;?php if (function_exists('get_most_viewed')): ?&gt;<br />
399
+ &nbsp;&nbsp;&nbsp;&lt;?php get_most_viewed(); ?&gt;<br />
400
+ &lt;?php endif; ?&gt;
401
+ </blockquote>
402
+ <p>
403
+ The <b>first value</b> you pass in is what you want to get, 'post', 'page' or 'both'.<br />
404
+ The <b>second value</b> you pass in is the maximum number of post you want to get.
405
+ </p>
406
+ <p>Default: get_most_viewed('both', 10);</p>
407
+ </li>
408
+ <li>
409
+ To Display <b>Most Viewed Post For A Category</b>
410
+ </li>
411
+ <li>
412
+ Use:
413
+ <blockquote>
414
+ &lt;?php if (function_exists('get_most_viewed_category')): ?&gt;<br />
415
+ &nbsp;&nbsp;&nbsp;&lt;?php get_most_viewed_category(); ?&gt;<br />
416
+ &lt;?php endif; ?&gt;
417
+ </blockquote>
418
+ <p>
419
+ The <b>first value</b> you pass in is the category id.<br />
420
+ The <b>second value</b> you pass in is what you want to get, 'post', 'page' or 'both'.<br />
421
+ The <b>third value</b> you pass in is the maximum number of post you want to get.</p>
422
+ <p>Default: get_most_viewed_category(1, 'both', 10);</p>
423
+ </li>
424
+ </ul>
425
+ </div>
426
+ </div>
427
+ </div>
428
+ <p id="Copyright">WP-PostViews 1.10<br />Copyright &copy; 2007 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
429
+ </body>
430
+ </html>
readme.txt ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.10
7
+
8
+ Enables you to display how many times a post had been viewed.
9
+
10
+ == Description ==
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")