Version Description
N/A
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-PostViews |
Version | 1.66 |
Comparing to | |
See all releases |
Code changes from version 1.50 to 1.66
- postviews-cache.js +1 -0
- postviews-options.php +181 -309
- readme.html +0 -598
- readme.txt +252 -29
- screenshot-1.png +0 -0
- uninstall.php +35 -0
- wp-postviews.mo +0 -0
- wp-postviews.php +932 -789
- wp-postviews.pot +87 -94
postviews-cache.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.ajax({type:"GET",url:viewsCacheL10n.admin_ajax_url,data:"postviews_id="+viewsCacheL10n.post_id+"&action=postviews",cache:!1});
|
postviews-options.php
CHANGED
@@ -1,309 +1,181 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
$
|
22 |
-
$
|
23 |
-
$
|
24 |
-
$
|
25 |
-
$
|
26 |
-
$
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
}
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
<
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
</
|
135 |
-
|
136 |
-
<
|
137 |
-
<
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
<td valign="top">
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
<td valign="top">
|
183 |
-
<textarea cols="80" rows="15" id="views_template_most_viewed" name="views_template_most_viewed"><?php echo htmlspecialchars(stripslashes($views_options['most_viewed_template'])); ?></textarea>
|
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>
|
254 |
-
</div>
|
255 |
-
</form>
|
256 |
-
<p> </p>
|
257 |
-
|
258 |
-
<!-- Uninstall WP-PostViews -->
|
259 |
-
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
|
260 |
-
<div class="wrap">
|
261 |
-
<h3><?php _e('Uninstall WP-PostViews', 'wp-postviews'); ?></h3>
|
262 |
-
<p>
|
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">
|
273 |
-
<thead>
|
274 |
-
<tr>
|
275 |
-
<th><?php _e('WordPress Options', 'wp-postviews'); ?></th>
|
276 |
-
<th><?php _e('WordPress PostMetas', 'wp-postviews'); ?></th>
|
277 |
-
</tr>
|
278 |
-
</thead>
|
279 |
-
<tr>
|
280 |
-
<td valign="top">
|
281 |
-
<ol>
|
282 |
-
<?php
|
283 |
-
foreach($views_settings as $settings) {
|
284 |
-
echo '<li>'.$settings.'</li>'."\n";
|
285 |
-
}
|
286 |
-
?>
|
287 |
-
</ol>
|
288 |
-
</td>
|
289 |
-
<td valign="top" class="alternate">
|
290 |
-
<ol>
|
291 |
-
<?php
|
292 |
-
foreach($views_postmetas as $postmeta) {
|
293 |
-
echo '<li>'.$postmeta.'</li>'."\n";
|
294 |
-
}
|
295 |
-
?>
|
296 |
-
</ol>
|
297 |
-
</td>
|
298 |
-
</tr>
|
299 |
-
</table>
|
300 |
-
<p> </p>
|
301 |
-
<p style="text-align: center;">
|
302 |
-
<input type="checkbox" name="uninstall_views_yes" value="yes" /> <?php _e('Yes', 'wp-postviews'); ?><br /><br />
|
303 |
-
<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'); ?>')" />
|
304 |
-
</p>
|
305 |
-
</div>
|
306 |
-
</form>
|
307 |
-
<?php
|
308 |
-
} // End switch($mode)
|
309 |
-
?>
|
1 |
+
<?php
|
2 |
+
### Variables Variables Variables
|
3 |
+
$base_name = plugin_basename('wp-postviews/postviews-options.php');
|
4 |
+
$base_page = 'admin.php?page='.$base_name;
|
5 |
+
$id = (isset($_GET['id']) ? intval($_GET['id']) : 0);
|
6 |
+
$mode = (isset($_GET['mode']) ? trim($_GET['mode']) : '');
|
7 |
+
$text = '';
|
8 |
+
|
9 |
+
### Form Processing
|
10 |
+
if(!empty($_POST['Submit'])) {
|
11 |
+
check_admin_referer('wp-postviews_options');
|
12 |
+
$views_options = array();
|
13 |
+
$views_options['count'] = intval($_POST['views_count']);
|
14 |
+
$views_options['exclude_bots'] = intval($_POST['views_exclude_bots']);
|
15 |
+
$views_options['display_home'] = intval($_POST['views_display_home']);
|
16 |
+
$views_options['display_single'] = intval($_POST['views_display_single']);
|
17 |
+
$views_options['display_page'] = intval($_POST['views_display_page']);
|
18 |
+
$views_options['display_archive'] = intval($_POST['views_display_archive']);
|
19 |
+
$views_options['display_search'] = intval($_POST['views_display_search']);
|
20 |
+
$views_options['display_other'] = intval($_POST['views_display_other']);
|
21 |
+
$views_options['template'] = trim($_POST['views_template_template']);
|
22 |
+
$views_options['most_viewed_template'] = trim($_POST['views_template_most_viewed']);
|
23 |
+
$update_views_queries = array();
|
24 |
+
$update_views_text = array();
|
25 |
+
$update_views_queries[] = update_option('views_options', $views_options);
|
26 |
+
$update_views_text[] = __('Post Views Options', 'wp-postviews');
|
27 |
+
$i = 0;
|
28 |
+
|
29 |
+
foreach($update_views_queries as $update_views_query) {
|
30 |
+
if($update_views_query) {
|
31 |
+
$text .= '<font color="green">'.$update_views_text[$i].' '.__('Updated', 'wp-postviews').'</font><br />';
|
32 |
+
}
|
33 |
+
$i++;
|
34 |
+
}
|
35 |
+
if(empty($text)) {
|
36 |
+
$text = '<font color="red">'.__('No Post Views Option Updated', 'wp-postviews').'</font>';
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
$views_options = get_option('views_options');
|
41 |
+
?>
|
42 |
+
<script type="text/javascript">
|
43 |
+
/* <![CDATA[*/
|
44 |
+
function views_default_templates(template) {
|
45 |
+
var default_template;
|
46 |
+
switch(template) {
|
47 |
+
case 'template':
|
48 |
+
default_template = "<?php _e('%VIEW_COUNT% views', 'wp-postviews'); ?>";
|
49 |
+
break;
|
50 |
+
case 'most_viewed':
|
51 |
+
default_template = "<li><a href=\"%POST_URL%\" title=\"%POST_TITLE%\">%POST_TITLE%</a> - %VIEW_COUNT% <?php _e('views', 'wp-postviews'); ?></li>";
|
52 |
+
break;
|
53 |
+
}
|
54 |
+
jQuery("#views_template_" + template).val(default_template);
|
55 |
+
}
|
56 |
+
/* ]]> */
|
57 |
+
</script>
|
58 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
59 |
+
<form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
|
60 |
+
<?php wp_nonce_field('wp-postviews_options'); ?>
|
61 |
+
<div class="wrap">
|
62 |
+
<?php screen_icon(); ?>
|
63 |
+
<h2><?php _e('Post Views Options', 'wp-postviews'); ?></h2>
|
64 |
+
<table class="form-table">
|
65 |
+
<tr>
|
66 |
+
<td valign="top" width="30%"><strong><?php _e('Count Views From:', 'wp-postviews'); ?></strong></td>
|
67 |
+
<td valign="top">
|
68 |
+
<select name="views_count" size="1">
|
69 |
+
<option value="0"<?php selected('0', $views_options['count']); ?>><?php _e('Everyone', 'wp-postviews'); ?></option>
|
70 |
+
<option value="1"<?php selected('1', $views_options['count']); ?>><?php _e('Guests Only', 'wp-postviews'); ?></option>
|
71 |
+
<option value="2"<?php selected('2', $views_options['count']); ?>><?php _e('Registered Users Only', 'wp-postviews'); ?></option>
|
72 |
+
</select>
|
73 |
+
</td>
|
74 |
+
</tr>
|
75 |
+
<tr>
|
76 |
+
<td valign="top" width="30%"><strong><?php _e('Exclude Bot Views:', 'wp-postviews'); ?></strong></td>
|
77 |
+
<td valign="top">
|
78 |
+
<select name="views_exclude_bots" size="1">
|
79 |
+
<option value="0"<?php selected('0', $views_options['exclude_bots']); ?>><?php _e('No', 'wp-postviews'); ?></option>
|
80 |
+
<option value="1"<?php selected('1', $views_options['exclude_bots']); ?>><?php _e('Yes', 'wp-postviews'); ?></option>
|
81 |
+
</select>
|
82 |
+
</td>
|
83 |
+
</tr>
|
84 |
+
<tr>
|
85 |
+
<td valign="top">
|
86 |
+
<strong><?php _e('Views Template:', 'wp-postviews'); ?></strong><br /><br />
|
87 |
+
<?php _e('Allowed Variables:', 'wp-postviews'); ?><br />
|
88 |
+
- %VIEW_COUNT%<br /><br />
|
89 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-postviews'); ?>" onclick="views_default_templates('template');" class="button" />
|
90 |
+
</td>
|
91 |
+
<td valign="top">
|
92 |
+
<input type="text" id="views_template_template" name="views_template_template" size="70" value="<?php echo htmlspecialchars(stripslashes($views_options['template'])); ?>" />
|
93 |
+
</td>
|
94 |
+
</tr>
|
95 |
+
<tr>
|
96 |
+
<td valign="top">
|
97 |
+
<strong><?php _e('Most Viewed Template:', 'wp-postviews'); ?></strong><br /><br />
|
98 |
+
<?php _e('Allowed Variables:', 'wp-postviews'); ?><br />
|
99 |
+
- %VIEW_COUNT%<br />
|
100 |
+
- %POST_TITLE%<br />
|
101 |
+
- %POST_DATE%<br />
|
102 |
+
- %POST_TIME%<br />
|
103 |
+
- %POST_EXCERPT%<br />
|
104 |
+
- %POST_CONTENT%<br />
|
105 |
+
- %POST_URL%<br /><br />
|
106 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-postviews'); ?>" onclick="views_default_templates('most_viewed');" class="button" />
|
107 |
+
</td>
|
108 |
+
<td valign="top">
|
109 |
+
<textarea cols="80" rows="15" id="views_template_most_viewed" name="views_template_most_viewed"><?php echo htmlspecialchars(stripslashes($views_options['most_viewed_template'])); ?></textarea>
|
110 |
+
</td>
|
111 |
+
</tr>
|
112 |
+
</table>
|
113 |
+
<h3><?php _e('Display Options', 'wp-postviews'); ?></h3>
|
114 |
+
<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>
|
115 |
+
<table class="form-table">
|
116 |
+
<tr>
|
117 |
+
<td valign="top"><strong><?php _e('Home Page:', 'wp-postviews'); ?></strong></td>
|
118 |
+
<td>
|
119 |
+
<select name="views_display_home" size="1">
|
120 |
+
<option value="0"<?php selected('0', $views_options['display_home']); ?>><?php _e('Display to everyone', 'wp-postviews'); ?></option>
|
121 |
+
<option value="1"<?php selected('1', $views_options['display_home']); ?>><?php _e('Display to registered users only', 'wp-postviews'); ?></option>
|
122 |
+
<option value="2"<?php selected('2', $views_options['display_home']); ?>><?php _e('Don\'t display on home page', 'wp-postviews'); ?></option>
|
123 |
+
</select>
|
124 |
+
</td>
|
125 |
+
</tr>
|
126 |
+
<tr>
|
127 |
+
<td valign="top"><strong><?php _e('Singe Posts:', 'wp-postviews'); ?></strong></td>
|
128 |
+
<td>
|
129 |
+
<select name="views_display_single" size="1">
|
130 |
+
<option value="0"<?php selected('0', $views_options['display_single']); ?>><?php _e('Display to everyone', 'wp-postviews'); ?></option>
|
131 |
+
<option value="1"<?php selected('1', $views_options['display_single']); ?>><?php _e('Display to registered users only', 'wp-postviews'); ?></option>
|
132 |
+
<option value="2"<?php selected('2', $views_options['display_single']); ?>><?php _e('Don\'t display on single posts', 'wp-postviews'); ?></option>
|
133 |
+
</select>
|
134 |
+
</td>
|
135 |
+
</tr>
|
136 |
+
<tr>
|
137 |
+
<td valign="top"><strong><?php _e('Pages:', 'wp-postviews'); ?></strong></td>
|
138 |
+
<td>
|
139 |
+
<select name="views_display_page" size="1">
|
140 |
+
<option value="0"<?php selected('0', $views_options['display_page']); ?>><?php _e('Display to everyone', 'wp-postviews'); ?></option>
|
141 |
+
<option value="1"<?php selected('1', $views_options['display_page']); ?>><?php _e('Display to registered users only', 'wp-postviews'); ?></option>
|
142 |
+
<option value="2"<?php selected('2', $views_options['display_page']); ?>><?php _e('Don\'t display on pages', 'wp-postviews'); ?></option>
|
143 |
+
</select>
|
144 |
+
</td>
|
145 |
+
</tr>
|
146 |
+
<tr>
|
147 |
+
<td valign="top"><strong><?php _e('Archive Pages:', 'wp-postviews'); ?></strong></td>
|
148 |
+
<td>
|
149 |
+
<select name="views_display_archive" size="1">
|
150 |
+
<option value="0"<?php selected('0', $views_options['display_archive']); ?>><?php _e('Display to everyone', 'wp-postviews'); ?></option>
|
151 |
+
<option value="1"<?php selected('1', $views_options['display_archive']); ?>><?php _e('Display to registered users only', 'wp-postviews'); ?></option>
|
152 |
+
<option value="2"<?php selected('2', $views_options['display_archive']); ?>><?php _e('Don\'t display on archive pages', 'wp-postviews'); ?></option>
|
153 |
+
</select>
|
154 |
+
</td>
|
155 |
+
</tr>
|
156 |
+
<tr>
|
157 |
+
<td valign="top"><strong><?php _e('Search Pages:', 'wp-postviews'); ?></strong></td>
|
158 |
+
<td>
|
159 |
+
<select name="views_display_search" size="1">
|
160 |
+
<option value="0"<?php selected('0', $views_options['display_search']); ?>><?php _e('Display to everyone', 'wp-postviews'); ?></option>
|
161 |
+
<option value="1"<?php selected('1', $views_options['display_search']); ?>><?php _e('Display to registered users only', 'wp-postviews'); ?></option>
|
162 |
+
<option value="2"<?php selected('2', $views_options['display_search']); ?>><?php _e('Don\'t display on search pages', 'wp-postviews'); ?></option>
|
163 |
+
</select>
|
164 |
+
</td>
|
165 |
+
</tr>
|
166 |
+
<tr>
|
167 |
+
<td valign="top"><strong><?php _e('Other Pages:', 'wp-postviews'); ?></strong></td>
|
168 |
+
<td>
|
169 |
+
<select name="views_display_other" size="1">
|
170 |
+
<option value="0"<?php selected('0', $views_options['display_other']); ?>><?php _e('Display to everyone', 'wp-postviews'); ?></option>
|
171 |
+
<option value="1"<?php selected('1', $views_options['display_other']); ?>><?php _e('Display to registered users only', 'wp-postviews'); ?></option>
|
172 |
+
<option value="2"<?php selected('2', $views_options['display_other']); ?>><?php _e('Don\'t display on other pages', 'wp-postviews'); ?></option>
|
173 |
+
</select>
|
174 |
+
</td>
|
175 |
+
</tr>
|
176 |
+
</table>
|
177 |
+
<p class="submit">
|
178 |
+
<input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes', 'wp-postviews'); ?>" />
|
179 |
+
</p>
|
180 |
+
</div>
|
181 |
+
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.html
DELETED
@@ -1,598 +0,0 @@
|
|
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.50 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.50 <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">» Index</div>
|
222 |
-
<div class="SubSubTitle">Plugin Information</div>
|
223 |
-
<p>
|
224 |
-
<strong>Author:</strong><br />
|
225 |
-
<strong>»</strong> Lester 'GaMerZ' Chan
|
226 |
-
</p>
|
227 |
-
<p>
|
228 |
-
<strong>Website:</strong><br />
|
229 |
-
<strong>»</strong> <a href="http://lesterchan.net/" title="http://lesterchan.net/">http://lesterchan.net/</a>
|
230 |
-
</p>
|
231 |
-
<p>
|
232 |
-
<strong>Features:</strong><br />
|
233 |
-
<strong>»</strong> Enables you to display how many times a post/page had been viewed.
|
234 |
-
</p>
|
235 |
-
<p>
|
236 |
-
<strong>Download:</strong><br />
|
237 |
-
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-postviews.1.50.zip" title="http://downloads.wordpress.org/plugin/wp-postviews.1.50.zip">WP-PostViews 1.50 For WordPress 2.8.x</a><br />
|
238 |
-
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-postviews.1.40.zip" title="http://downloads.wordpress.org/plugin/wp-postviews.1.40.zip">WP-PostViews 1.40 For WordPress 2.7.x</a><br />
|
239 |
-
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-postviews.1.31.zip" title="http://downloads.wordpress.org/plugin/wp-postviews.1.31.zip">WP-PostViews 1.31 For WordPress 2.3.x, 2.5.x And 2.6.x</a><br />
|
240 |
-
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-postviews.1.11.zip" title="http://downloads.wordpress.org/plugin/wp-postviews.1.11.zip">WP-PostViews 1.11 For WordPress 2.1.x And 2.2.x</a><br />
|
241 |
-
<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 />
|
242 |
-
</p>
|
243 |
-
<p>
|
244 |
-
<strong>Screenshots:</strong><br />
|
245 |
-
<strong>»</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>
|
246 |
-
</p>
|
247 |
-
<p>
|
248 |
-
<strong>Demo:</strong><br /><strong>»</strong> <a href="http://lesterchan.net/wordpress/" title="http://lesterchan.net/wordpress/">http://lesterchan.net/wordpress/</a>
|
249 |
-
</p>
|
250 |
-
<p>
|
251 |
-
<strong>Development:</strong><br />
|
252 |
-
<strong>»</strong> <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>
|
253 |
-
</p>
|
254 |
-
<p>
|
255 |
-
<strong>Translations:</strong><br />
|
256 |
-
<strong>»</strong> <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>
|
257 |
-
</p>
|
258 |
-
<p>
|
259 |
-
<strong>Support Forums:</strong><br />
|
260 |
-
<strong>»</strong> <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>
|
261 |
-
</p>
|
262 |
-
<p>
|
263 |
-
<strong>Credits:</strong><br />
|
264 |
-
<strong>»</strong> WP-Cache/WP-SuperCache Compatibility By <a href="http://omninoggin.com/" title="Thaya Kareeson">Thaya Kareeson</a>.<br />
|
265 |
-
<strong>»</strong> __ngetext() by <a href="http://hweia.ru/" title="Anna Ozeritskaya">Anna Ozeritskaya</a>.<br />
|
266 |
-
<strong>»</strong> Right To Left Language Support by <a href="http://persian-programming.com/" title="Kambiz R. Khojasteh">Kambiz R. Khojasteh</a>.
|
267 |
-
<strong>»</strong> Options To Display Views On Certain Places by <a href="http://dpotter.net/Technical/" title="David Potter">David Potter</a>.
|
268 |
-
</p>
|
269 |
-
<p>
|
270 |
-
<strong>Note:</strong><br />
|
271 |
-
<strong>»</strong> The <strong>Changelog</strong>, <strong>Installation</strong>, <strong>Upgrade</strong>, <strong>Usage</strong> Tab at the top of the page.
|
272 |
-
</p>
|
273 |
-
<p>
|
274 |
-
<strong>Donations:</strong><br />
|
275 |
-
<strong>»</strong> 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
|
276 |
-
<script type="text/javascript">
|
277 |
-
/* <![CDATA[*/
|
278 |
-
document.write(' <strong>lesterchan@gmail.com</strong>.');
|
279 |
-
/* ]]> */
|
280 |
-
</script>
|
281 |
-
</p>
|
282 |
-
</div>
|
283 |
-
|
284 |
-
<!-- Changelog -->
|
285 |
-
<div id="Changelog" style="display: none;">
|
286 |
-
<div class="SubTitle">» Changelog</div>
|
287 |
-
<ul>
|
288 |
-
<li>
|
289 |
-
<strong>Version 1.50 (01-06-2009)</strong>
|
290 |
-
<ul>
|
291 |
-
<li>NEW: Works For WordPress 2.8 Only</li>
|
292 |
-
<li>NEW: Uses jQuery Framework</li>
|
293 |
-
<li>NEW: Added In Most Viewed Pages To WP-Stats</li>
|
294 |
-
<li>NEW: Use _n() Instead Of __ngettext() And _n_noop() Instead Of __ngettext_noop()</li>
|
295 |
-
<li>FIXED: Uses $_SERVER['PHP_SELF'] With plugin_basename(__FILE__) Instead Of Just $_SERVER['REQUEST_URI']</li>
|
296 |
-
<li>NEW: Uses New Widget Class From WordPress</li>
|
297 |
-
<li>NEW: Merge Widget Code To wp-postviews.php And Remove wp-postviews-widget.php</li>
|
298 |
-
<li>NEW: Added get_most_viewed_tag() And get_least_viewed_tag()</li>
|
299 |
-
<li>FIXED: Ensure That Post Is Not A Revision</li>
|
300 |
-
<li>FIXED: Multiple Loops Filtered Not Cleared</li>
|
301 |
-
</ul>
|
302 |
-
</li>
|
303 |
-
<li>
|
304 |
-
<strong>Version 1.40 (12-12-2008)</strong>
|
305 |
-
<ul>
|
306 |
-
<li>NEW: Works For WordPress 2.7 Only</li>
|
307 |
-
<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>
|
308 |
-
<li>NEW: Right To Left Language Support by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a></li>
|
309 |
-
<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>
|
310 |
-
<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>
|
311 |
-
<li>NEW: Uses plugins_url() And site_url()</li>
|
312 |
-
<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>
|
313 |
-
<li>FIXED: "views" Custom Field Gets Created Now When Post Is Published</li>
|
314 |
-
</ul>
|
315 |
-
</li>
|
316 |
-
<li>
|
317 |
-
<strong>Version 1.31 (16-07-2008)</strong>
|
318 |
-
<ul>
|
319 |
-
<li>NEW: Works For WordPress 2.6</li>
|
320 |
-
<li>NEW: Renamed GET Variables sortby To v_sortby And orderby To v_orderby</li>
|
321 |
-
<li>NEW: Better Translation Using __ngetext() by <a href="http://hweia.ru/" title="http://hweia.ru/">Anna Ozeritskaya</a></li>
|
322 |
-
<li>FIXED: Able To Use v_sortby And v_orderby in query_posts()</li>
|
323 |
-
</ul>
|
324 |
-
</li>
|
325 |
-
<li>
|
326 |
-
<strong>Version 1.30 (01-06-2008)</strong>
|
327 |
-
<ul>
|
328 |
-
<li>NEW: Uses /wp-postviews/ Folder Instead Of /postviews/</li>
|
329 |
-
<li>NEW: Uses wp-postviews.php Instead Of postviews.php</li>
|
330 |
-
<li>NEW: Uses wp-postviews-widget.php Instead Of postviews-widget.php</li>
|
331 |
-
<li>NEW: Uses number_format_i18n() Instead Of number_format()</li>
|
332 |
-
<li>NEW: Option To Exclude Bots Views In 'WP-Admin -> Settings -> Post Views'</li>
|
333 |
-
<li>NEW: Added Most Viewed Template</li>
|
334 |
-
<li>NEW: Change The Way WP-PostViews Count Views</li>
|
335 |
-
<li>NEW: Should Work With WP-Cache Or WP-SuperCache</li>
|
336 |
-
</ul>
|
337 |
-
</li>
|
338 |
-
<li>
|
339 |
-
<strong>Version 1.20 (01-10-2007)</strong>
|
340 |
-
<ul>
|
341 |
-
<li>NEW: Works For WordPress 2.3 Only</li>
|
342 |
-
<li>NEW: Most Viewed Widget Added</li>
|
343 |
-
<li>NEW: Ability To Uninstall WP-PostViews</li>
|
344 |
-
<li>NEW: Uses WP-Stats Filter To Add Stats Into WP-Stats Page</li>
|
345 |
-
</ul>
|
346 |
-
</li>
|
347 |
-
<li>
|
348 |
-
<strong>Version 1.11 (01-06-2007)</strong>
|
349 |
-
<ul>
|
350 |
-
<li>FIXED: Wrong URL For Page Under Most Viewed Posts Listing</li>
|
351 |
-
</ul>
|
352 |
-
</li>
|
353 |
-
<li>
|
354 |
-
<strong>Version 1.10 (01-02-2007)</strong>
|
355 |
-
<ul>
|
356 |
-
<li>NEW: Works For WordPress 2.1 Only</li>
|
357 |
-
<li>NEW: Localization WP-PostViews</li>
|
358 |
-
<li>NEW: Added Function To Get Most Viewed Post By Category ID</li>
|
359 |
-
<li>FIXED: Views Not Counting In Some Cases</li>
|
360 |
-
</ul>
|
361 |
-
</li>
|
362 |
-
<li>
|
363 |
-
<strong>Version 1.02 (01-10-2006)</strong>
|
364 |
-
<ul>
|
365 |
-
<li>NEW: Change In get_most_viewed() To Accommodate Latest Version Of WP-Stats</li>
|
366 |
-
</ul>
|
367 |
-
</li>
|
368 |
-
<li>
|
369 |
-
<strong>Version 1.01 (01-07-2006)</strong>
|
370 |
-
<ul>
|
371 |
-
<li>NEW: Added Get Total Views Function</li>
|
372 |
-
<li>FIXED: Modified Get Most Viewed Post Function</li>
|
373 |
-
</ul>
|
374 |
-
</li>
|
375 |
-
<li>
|
376 |
-
<strong>Version 1.00 (01-03-2006)</strong>
|
377 |
-
<ul>
|
378 |
-
<li>NEW: Initial Release</li>
|
379 |
-
</ul>
|
380 |
-
</li>
|
381 |
-
</ul>
|
382 |
-
</div>
|
383 |
-
|
384 |
-
<!-- Installation Instructions -->
|
385 |
-
<div id="Install" style="display: none;">
|
386 |
-
<div class="SubTitle">» Installation Instructions</div>
|
387 |
-
<ol>
|
388 |
-
<li>
|
389 |
-
Open <strong>wp-content/plugins</strong> Folder
|
390 |
-
</li>
|
391 |
-
<li>
|
392 |
-
Put:
|
393 |
-
<blockquote>Folder: wp-postviews</blockquote>
|
394 |
-
</li>
|
395 |
-
<li>
|
396 |
-
<strong>Activate</strong> WP-PostViews Plugin
|
397 |
-
</li>
|
398 |
-
<li>
|
399 |
-
Refer To <strong>Usage</strong> For Further Instructions
|
400 |
-
</li>
|
401 |
-
</ol>
|
402 |
-
</div>
|
403 |
-
|
404 |
-
<!-- Upgrade Instructions -->
|
405 |
-
<div id="Upgrade" style="display: none;">
|
406 |
-
<div class="SubTitle">» Upgrade Instructions</div>
|
407 |
-
<div class="SubSubTitle">From v1.0x To v1.50</div>
|
408 |
-
<ol>
|
409 |
-
<li>
|
410 |
-
<strong>Deactivate</strong> WP-PostViews Plugin
|
411 |
-
</li>
|
412 |
-
<li>
|
413 |
-
Open <strong>wp-content/plugins</strong> Folder
|
414 |
-
</li>
|
415 |
-
<li>
|
416 |
-
Put/Overwrite:
|
417 |
-
<blockquote>Folder: wp-postviews</blockquote>
|
418 |
-
</li>
|
419 |
-
<li>
|
420 |
-
Delete this folder if exists:
|
421 |
-
<blockquote>
|
422 |
-
Folder: postviews
|
423 |
-
</blockquote>
|
424 |
-
</li>
|
425 |
-
<li>
|
426 |
-
<strong>Activate</strong> WP-PostViews Plugin
|
427 |
-
</li>
|
428 |
-
<li>
|
429 |
-
Refer To <strong>Usage</strong> For Further Instructions
|
430 |
-
</li>
|
431 |
-
</ol>
|
432 |
-
</div>
|
433 |
-
|
434 |
-
<!-- Usage Instructions -->
|
435 |
-
<div id="Usage" style="display: none;">
|
436 |
-
<div class="SubTitle">» Usage Instructions</div>
|
437 |
-
<div class="SubSubTitle">General Usage</div>
|
438 |
-
<ol>
|
439 |
-
<li>
|
440 |
-
Open <strong>wp-content/themes/<YOUR THEME NAME>/index.php</strong>
|
441 |
-
<p>You may place it in <strong>archive.php</strong>, <strong>single.php</strong>, <strong>post.php</strong> or <strong>page.php</strong> also.</p>
|
442 |
-
</li>
|
443 |
-
<li>
|
444 |
-
Find:
|
445 |
-
<blockquote>
|
446 |
-
<?php while (have_posts()) : the_post(); ?>
|
447 |
-
</blockquote>
|
448 |
-
</li>
|
449 |
-
<li>
|
450 |
-
Add Anywhere Below It:
|
451 |
-
<blockquote>
|
452 |
-
<?php if(function_exists('the_views')) { the_views(); } ?>
|
453 |
-
</blockquote>
|
454 |
-
</li>
|
455 |
-
<li>
|
456 |
-
Go to <strong>'WP-Admin -> Settings -> PostViews'</strong> to configure the plugin.
|
457 |
-
</li>
|
458 |
-
</ol>
|
459 |
-
<div class="SubSubTitle">View Stats (With Widgets)</div>
|
460 |
-
<ol>
|
461 |
-
<li>
|
462 |
-
Go to '<strong>WP-Admin -> Appearance -> Widgets</strong>'
|
463 |
-
</li>
|
464 |
-
<li>
|
465 |
-
The widget name is <strong>Views</strong>.
|
466 |
-
</li>
|
467 |
-
</ol>
|
468 |
-
<div class="SubSubTitle">View Stats (Outside WP Loop)</div>
|
469 |
-
<ul>
|
470 |
-
<li>
|
471 |
-
To Display <strong>Least Viewed Posts</strong>
|
472 |
-
</li>
|
473 |
-
<li>
|
474 |
-
Use:
|
475 |
-
<blockquote>
|
476 |
-
<?php if (function_exists('get_least_viewed')): ?><br />
|
477 |
-
<ul><br />
|
478 |
-
<?php get_least_viewed(); ?><br />
|
479 |
-
</ul><br />
|
480 |
-
<?php endif; ?>
|
481 |
-
</blockquote>
|
482 |
-
<p>
|
483 |
-
The <strong>first value</strong> you pass in is what you want to get, 'post', 'page' or 'both'.<br />
|
484 |
-
The <strong>second value</strong> you pass in is the maximum number of post you want to get.
|
485 |
-
</p>
|
486 |
-
<p>Default: get_least_viewed('both', 10);</p>
|
487 |
-
</li>
|
488 |
-
<li>
|
489 |
-
To Display <strong>Most Viewed Posts</strong>
|
490 |
-
</li>
|
491 |
-
<li>
|
492 |
-
Use:
|
493 |
-
<blockquote>
|
494 |
-
<?php if (function_exists('get_most_viewed')): ?><br />
|
495 |
-
<ul><br />
|
496 |
-
<?php get_most_viewed(); ?><br />
|
497 |
-
</ul><br />
|
498 |
-
<?php endif; ?>
|
499 |
-
</blockquote>
|
500 |
-
<p>
|
501 |
-
The <strong>first value</strong> you pass in is what you want to get, 'post', 'page' or 'both'.<br />
|
502 |
-
The <strong>second value</strong> you pass in is the maximum number of post you want to get.
|
503 |
-
</p>
|
504 |
-
<p>Default: get_most_viewed('both', 10);</p>
|
505 |
-
</li>
|
506 |
-
<li>
|
507 |
-
To Display <strong>Least Viewed Posts By Tag</strong>
|
508 |
-
</li>
|
509 |
-
<li>
|
510 |
-
Use:
|
511 |
-
<blockquote>
|
512 |
-
<?php if (function_exists('get_least_viewed_tag')): ?><br />
|
513 |
-
<ul><br />
|
514 |
-
<?php get_least_viewed_tag(); ?><br />
|
515 |
-
</ul><br />
|
516 |
-
<?php endif; ?>
|
517 |
-
</blockquote>
|
518 |
-
<p>
|
519 |
-
The <strong>first value</strong> you pass in is the tag id.<br />
|
520 |
-
The <strong>second value</strong> you pass in is what you want to get, 'post', 'page' or 'both'.<br />
|
521 |
-
The <strong>third value</strong> you pass in is the maximum number of post you want to get.</p>
|
522 |
-
<p>Default: get_least_viewed_tag(1, 'both', 10);</p>
|
523 |
-
</li>
|
524 |
-
<li>
|
525 |
-
To Display <strong>Most Viewed Posts By Tag</strong>
|
526 |
-
</li>
|
527 |
-
<li>
|
528 |
-
Use:
|
529 |
-
<blockquote>
|
530 |
-
<?php if (function_exists('get_most_viewed_tag')): ?><br />
|
531 |
-
<ul><br />
|
532 |
-
<?php get_most_viewed_tag(); ?><br />
|
533 |
-
</ul><br />
|
534 |
-
<?php endif; ?>
|
535 |
-
</blockquote>
|
536 |
-
<p>
|
537 |
-
The <strong>first value</strong> you pass in is the tag id.<br />
|
538 |
-
The <strong>second value</strong> you pass in is what you want to get, 'post', 'page' or 'both'.<br />
|
539 |
-
The <strong>third value</strong> you pass in is the maximum number of post you want to get.</p>
|
540 |
-
<p>Default: get_most_viewed_tag(1, 'both', 10);</p>
|
541 |
-
</li>
|
542 |
-
<li>
|
543 |
-
To Display <strong>Least Viewed Posts For A Category</strong>
|
544 |
-
</li>
|
545 |
-
<li>
|
546 |
-
Use:
|
547 |
-
<blockquote>
|
548 |
-
<?php if (function_exists('get_least_viewed_category')): ?><br />
|
549 |
-
<ul><br />
|
550 |
-
<?php get_least_viewed_category(); ?><br />
|
551 |
-
</ul><br />
|
552 |
-
<?php endif; ?>
|
553 |
-
</blockquote>
|
554 |
-
<p>
|
555 |
-
The <strong>first value</strong> you pass in is the category id.<br />
|
556 |
-
The <strong>second value</strong> you pass in is what you want to get, 'post', 'page' or 'both'.<br />
|
557 |
-
The <strong>third value</strong> you pass in is the maximum number of post you want to get.</p>
|
558 |
-
<p>Default: get_least_viewed_category(1, 'both', 10);</p>
|
559 |
-
</li>
|
560 |
-
<li>
|
561 |
-
To Display <strong>Most Viewed Posts For A Category</strong>
|
562 |
-
</li>
|
563 |
-
<li>
|
564 |
-
Use:
|
565 |
-
<blockquote>
|
566 |
-
<?php if (function_exists('get_most_viewed_category')): ?><br />
|
567 |
-
<ul><br />
|
568 |
-
<?php get_most_viewed_category(); ?><br />
|
569 |
-
</ul><br />
|
570 |
-
<?php endif; ?>
|
571 |
-
</blockquote>
|
572 |
-
<p>
|
573 |
-
The <strong>first value</strong> you pass in is the category id.<br />
|
574 |
-
The <strong>second value</strong> you pass in is what you want to get, 'post', 'page' or 'both'.<br />
|
575 |
-
The <strong>third value</strong> you pass in is the maximum number of post you want to get.</p>
|
576 |
-
<p>Default: get_most_viewed_category(1, 'both', 10);</p>
|
577 |
-
</li>
|
578 |
-
<li>
|
579 |
-
To Sort <strong>Most/Least Viewed Posts</strong>
|
580 |
-
</li>
|
581 |
-
<li>
|
582 |
-
You can use:
|
583 |
-
<blockquote>
|
584 |
-
<?php query_posts('v_sortby=views&v_orderby=desc') ?>
|
585 |
-
</blockquote>
|
586 |
-
<p>Or pass in the variables to the URL:</p>
|
587 |
-
<blockquote>
|
588 |
-
http://yoursite.com/?v_sortby=views&v_orderby=desc
|
589 |
-
</blockquote>
|
590 |
-
<p>You can replace <strong>desc</strong> with <strong>asc</strong> if you want the least viewed posts.</p>
|
591 |
-
</li>
|
592 |
-
</ul>
|
593 |
-
</div>
|
594 |
-
</div>
|
595 |
-
</div>
|
596 |
-
<p id="Copyright">WP-PostViews 1.50<br />Copyright © 2009 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
|
597 |
-
</body>
|
598 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -1,29 +1,252 @@
|
|
1 |
-
=== WP-PostViews ===
|
2 |
-
Contributors: GamerZ
|
3 |
-
Donate link: http://lesterchan.net/
|
4 |
-
Tags: views, hits, counter, postviews
|
5 |
-
Requires at least: 2.8
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
[
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== WP-PostViews ===
|
2 |
+
Contributors: GamerZ
|
3 |
+
Donate link: http://lesterchan.net/site/donation/
|
4 |
+
Tags: views, hits, counter, postviews
|
5 |
+
Requires at least: 2.8
|
6 |
+
Tested up to: 3.8
|
7 |
+
Stable tag: 1.66
|
8 |
+
|
9 |
+
Enables you to display how many times a post/page had been viewed.
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
= Previous Versions =
|
14 |
+
* [WP-PostViews 1.40 For WordPress 2.7.x](http://downloads.wordpress.org/plugin/wp-postviews.1.40.zip "WP-PostViews 1.40 For WordPress 2.7.x")
|
15 |
+
* [WP-PostViews 1.31 For WordPress 2.3.x, 2.5.x And 2.6.x](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")
|
16 |
+
* [WP-PostViews 1.11 For WordPress 2.1.x And 2.2.x](http://downloads.wordpress.org/plugin/wp-postviews.1.11.zip "WP-PostViews 1.11 For WordPress 2.1.x And 2.2.x")
|
17 |
+
* [WP-PostViews 1.02 For WordPress 2.0.x](http://downloads.wordpress.org/plugin/wp-postviews.1.02.zip "WP-PostViews 1.02 For WordPress 2.0.x")
|
18 |
+
|
19 |
+
= Development =
|
20 |
+
* [http://dev.wp-plugins.org/browser/wp-postviews/](http://dev.wp-plugins.org/browser/wp-postviews/ "http://dev.wp-plugins.org/browser/wp-postviews/")
|
21 |
+
|
22 |
+
= Translations =
|
23 |
+
* [http://dev.wp-plugins.org/browser/wp-postviews/i18n/](http://dev.wp-plugins.org/browser/wp-postviews/i18n/ "http://dev.wp-plugins.org/browser/wp-postviews/i18n/")
|
24 |
+
|
25 |
+
= Support Forums =
|
26 |
+
* [http://forums.lesterchan.net/index.php?board=16.0](http://forums.lesterchan.net/index.php?board=16.0 "http://forums.lesterchan.net/index.php?board=16.0")
|
27 |
+
|
28 |
+
= Credits =
|
29 |
+
* WP-Cache/WP-SuperCache Compatibility By [Thaya Kareeson](http://omninoggin.com/ "Thaya Kareeson")
|
30 |
+
* __ngetext() by [Anna Ozeritskaya](http://hweia.ru/ "Anna Ozeritskaya")
|
31 |
+
* Right To Left Language Support by [Kambiz R. Khojasteh](http://persian-programming.com/ "Kambiz R. Khojasteh")
|
32 |
+
* Options To Display Views On Certain Places by [David Potter](http://dpotter.net/Technical/ "David Potter")
|
33 |
+
|
34 |
+
= Donations =
|
35 |
+
* 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, I will really appericiate it. If not feel free to use it without any obligations.
|
36 |
+
|
37 |
+
== Changelog ==
|
38 |
+
= Version 1.66 =
|
39 |
+
* NEW: Supports MultiSite Network Activation
|
40 |
+
* NEW: Add %POST_DATE% and %POST_TIME% to template variables
|
41 |
+
* NEW: Add China isearch engines bots
|
42 |
+
* NEW: Ability to pass in an array of post types for get_most/least_*() functions. Props Leo Plaw.
|
43 |
+
* FIXED: Moved uninstall to uninstall.php and hence fix missing nonce. Props Julio Potier.
|
44 |
+
* FIXED: Notices and better way to get views from meta. Props daankortenbach.
|
45 |
+
* FIXED: No longer needing add_post_meta() if update_post_meta() fails.
|
46 |
+
|
47 |
+
= Version 1.65 (02-06-2013) =
|
48 |
+
* FIXED: Views not showing in WP-Admin if "Display Options" is not set to "Display to everyone"
|
49 |
+
|
50 |
+
= Version 1.64 (31-05-2013) =
|
51 |
+
* NEW: Using Enqueue Script For WP_CACHE Enabled Sites. Props Crowd Favourite
|
52 |
+
* FIXED: Viewcounter always display eventhough "display to registered users only" is set
|
53 |
+
|
54 |
+
= Version 1.63 (07-05-2013) =
|
55 |
+
* NEW: Added nonce To PostViews Options Admin Page
|
56 |
+
|
57 |
+
= Version 1.62 (29-11-2012) =
|
58 |
+
* NEW: Add "Views" Column To Manage Pages In WP-Admin
|
59 |
+
* NEW: Add Sortable "Views" Column To Manage Posts/Pages In WP-Admin
|
60 |
+
|
61 |
+
= Version 1.61 (21-05-2012) =
|
62 |
+
* FIXED: Move AJAX Request to wp-admin/admin-ajax.php
|
63 |
+
|
64 |
+
= Version 1.60 (18-02-2011) =
|
65 |
+
* NEW: Added Views Count To Edit Posts Screen
|
66 |
+
* FIXED: Removed Global $post
|
67 |
+
|
68 |
+
= Version 1.50 (15-06-2009) =
|
69 |
+
* NEW: Works For WordPress 2.8 Only
|
70 |
+
* NEW: Uses jQuery Framework
|
71 |
+
* NEW: Added In Most Viewed Pages To WP-Stats
|
72 |
+
* NEW: Use _n() Instead Of __ngettext() And _n_noop() Instead Of __ngettext_noop()
|
73 |
+
* FIXED: Uses $_SERVER['PHP_SELF'] With plugin_basename(__FILE__) Instead Of Just $_SERVER['REQUEST_URI']
|
74 |
+
* NEW: Uses New Widget Class From WordPress
|
75 |
+
* NEW: Merge Widget Code To wp-postviews.php And Remove wp-postviews-widget.php
|
76 |
+
* NEW: Added get_most_viewed_tag() And get_least_viewed_tag()
|
77 |
+
* FIXED: Ensure That Post Is Not A Revision
|
78 |
+
* FIXED: Multiple Loops Filtered Not Cleared
|
79 |
+
|
80 |
+
= Version 1.40 (12-12-2008) =
|
81 |
+
* NEW: Works For WordPress 2.7 Only
|
82 |
+
* NEW: Options To Display Views On Certain Places by David Potter
|
83 |
+
* NEW: Right To Left Language Support by Kambiz R. Khojasteh
|
84 |
+
* NEW: Output Of the_views() Applied To "the_views" Filter by Kambiz R. Khojasteh
|
85 |
+
* NEW: Called postviews_textdomain() In views_init() by Kambiz R. Khojasteh
|
86 |
+
* NEW: Uses plugins_url() And site_url()
|
87 |
+
* NEW: Added get_least_viewed() And get_least_viewed_category() By JBrinx
|
88 |
+
* FIXED: "views" Custom Field Gets Created Now When Post Is Published
|
89 |
+
|
90 |
+
= Version 1.31 (16-07-2008) =
|
91 |
+
* NEW: Works For WordPress 2.6
|
92 |
+
* NEW: Renamed GET Variables sortby To v_sortby And orderby To v_orderby
|
93 |
+
* NEW: Better Translation Using __ngetext() by Anna Ozeritskaya
|
94 |
+
* FIXED: Able To Use v_sortby And v_orderby in query_posts()
|
95 |
+
|
96 |
+
= Version 1.30 (01-06-2008) =
|
97 |
+
* NEW: Uses /wp-postviews/ Folder Instead Of /postviews/
|
98 |
+
* NEW: Uses wp-postviews.php Instead Of postviews.php
|
99 |
+
* NEW: Uses wp-postviews-widget.php Instead Of postviews-widget.php
|
100 |
+
* NEW: Uses number_format_i18n() Instead Of number_format()
|
101 |
+
* NEW: Option To Exclude Bots Views In 'WP-Admin -> Settings -> Post Views'
|
102 |
+
* NEW: Added Most Viewed Template
|
103 |
+
* NEW: Change The Way WP-PostViews Count Views
|
104 |
+
* NEW: Should Work With WP-Cache Or WP-SuperCache
|
105 |
+
|
106 |
+
= Version 1.20 (01-10-2007) =
|
107 |
+
* NEW: Works For WordPress 2.3 Only
|
108 |
+
* NEW: Most Viewed Widget Added
|
109 |
+
* NEW: Ability To Uninstall WP-PostViews
|
110 |
+
* NEW: Uses WP-Stats Filter To Add Stats Into WP-Stats Page
|
111 |
+
|
112 |
+
= Version 1.11 (01-06-2007) =
|
113 |
+
* FIXED: Wrong URL For Page Under Most Viewed Posts Listing
|
114 |
+
|
115 |
+
= Version 1.10 (01-02-2007) =
|
116 |
+
* NEW: Works For WordPress 2.1 Only
|
117 |
+
* NEW: Localization WP-PostViews
|
118 |
+
* NEW: Added Function To Get Most Viewed Post By Category ID
|
119 |
+
* FIXED: Views Not Counting In Some Cases
|
120 |
+
|
121 |
+
= Version 1.02 (01-10-2006) =
|
122 |
+
* NEW: Change In get_most_viewed() To Accommodate Latest Version Of WP-Stats
|
123 |
+
|
124 |
+
= Version 1.01 (01-07-2006) =
|
125 |
+
* NEW: Added Get Total Views Function
|
126 |
+
* FIXED: Modified Get Most Viewed Post Function
|
127 |
+
|
128 |
+
= Version 1.00 (01-03-2006) =
|
129 |
+
* NEW: Initial Release
|
130 |
+
|
131 |
+
== Installation ==
|
132 |
+
|
133 |
+
1. Open `wp-content/plugins` Folder
|
134 |
+
2. Put: `Folder: wp-postviews`
|
135 |
+
3. Activate `WP-PostViews` Plugin
|
136 |
+
4. Go to `WP-Admin -> Settings -> PostViews` to configure the plugin.
|
137 |
+
|
138 |
+
= Usage =
|
139 |
+
1. Open `wp-content/themes/<YOUR THEME NAME>/index.php`
|
140 |
+
2. You may place it in archive.php, single.php, post.php or page.php also.
|
141 |
+
3. Find: `<?php while (have_posts()) : the_post(); ?>`
|
142 |
+
4. Add Anywhere Below It (The Place You Want The Views To Show): `<?php if(function_exists('the_views')) { the_views(); } ?>`
|
143 |
+
|
144 |
+
== Upgrading ==
|
145 |
+
|
146 |
+
1. Deactivate `wp-postviews` Plugin
|
147 |
+
2. Open `wp-content/plugins` Folder
|
148 |
+
3. Put/Overwrite: `Folder: wp-postviews`
|
149 |
+
4. Activate `WP-PostViews` Plugin
|
150 |
+
|
151 |
+
== Upgrade Notice ==
|
152 |
+
|
153 |
+
N/A
|
154 |
+
|
155 |
+
== Screenshots ==
|
156 |
+
|
157 |
+
1. PostViews
|
158 |
+
|
159 |
+
== Frequently Asked Questions ==
|
160 |
+
|
161 |
+
= How To View Stats With Widgets? =
|
162 |
+
* Go to `WP-Admin -> Appearance -> Widgets`
|
163 |
+
* The widget name is Views.
|
164 |
+
|
165 |
+
= How To View Stats (Outside WP Loop) =
|
166 |
+
|
167 |
+
= To Display Least Viewed Posts =
|
168 |
+
* Use:
|
169 |
+
<code>
|
170 |
+
<?php if (function_exists('get_least_viewed')): ?>
|
171 |
+
<ul>
|
172 |
+
<?php get_least_viewed(); ?>
|
173 |
+
</ul>
|
174 |
+
<?php endif; ?>
|
175 |
+
</code>
|
176 |
+
* The first value you pass in is the post type that you want. If you want to get every post types, just use 'both'. It also supports PHP array: example `array('post', 'page')`.
|
177 |
+
* The second value you pass in is the maximum number of post you want to get.
|
178 |
+
* Default: get_least_viewed('both', 10);
|
179 |
+
|
180 |
+
= To Display Most Viewed Posts =
|
181 |
+
* Use:
|
182 |
+
<code>
|
183 |
+
<?php if (function_exists('get_most_viewed')): ?>
|
184 |
+
<ul>
|
185 |
+
<?php get_most_viewed(); ?>
|
186 |
+
</ul>
|
187 |
+
<?php endif; ?>
|
188 |
+
</code>
|
189 |
+
* The first value you pass in is the post type that you want. If you want to get every post types, just use 'both'. It also supports PHP array: example `array('post', 'page')`.
|
190 |
+
* The second value you pass in is the maximum number of post you want to get.
|
191 |
+
* Default: get_most_viewed('both', 10);
|
192 |
+
|
193 |
+
= To Display Least Viewed Posts By Tag =
|
194 |
+
* Use:
|
195 |
+
<code>
|
196 |
+
<?php if (function_exists('get_least_viewed_tag')): ?>
|
197 |
+
<ul>
|
198 |
+
<?php get_least_viewed_tag(); ?>
|
199 |
+
</ul>
|
200 |
+
<?php endif; ?>
|
201 |
+
</code>
|
202 |
+
* The first value you pass in is the tag id.
|
203 |
+
* The second value you pass in is the post type that you want. If you want to get every post types, just use 'both'. It also supports PHP array: example `array('post', 'page')`.
|
204 |
+
* The third value you pass in is the maximum number of post you want to get.
|
205 |
+
* Default: get_least_viewed_tag(1, 'both', 10);
|
206 |
+
|
207 |
+
= To Display Most Viewed Posts By Tag =
|
208 |
+
* Use:
|
209 |
+
<code>
|
210 |
+
<?php if (function_exists('get_most_viewed_tag')): ?>
|
211 |
+
<ul>
|
212 |
+
<?php get_most_viewed_tag(); ?>
|
213 |
+
</ul>
|
214 |
+
<?php endif; ?>
|
215 |
+
</code>
|
216 |
+
* The first value you pass in is the tag id.
|
217 |
+
* The second value you pass in is the post type that you want. If you want to get every post types, just use 'both'. It also supports PHP array: example `array('post', 'page')`.
|
218 |
+
* The third value you pass in is the maximum number of post you want to get.
|
219 |
+
* Default: get_most_viewed_tag(1, 'both', 10);
|
220 |
+
|
221 |
+
= To Display Least Viewed Posts For A Category =
|
222 |
+
* Use:
|
223 |
+
<code>
|
224 |
+
<?php if (function_exists('get_least_viewed_category')): ?>
|
225 |
+
<ul>
|
226 |
+
<?php get_least_viewed_category(); ?>
|
227 |
+
</ul>
|
228 |
+
<?php endif; ?>
|
229 |
+
</code>
|
230 |
+
* The first value you pass in is the category id.
|
231 |
+
* The second value you pass in is the post type that you want. If you want to get every post types, just use 'both'. It also supports PHP array: example `array('post', 'page')`.
|
232 |
+
* The third value you pass in is the maximum number of post you want to get.
|
233 |
+
* Default: get_least_viewed_category(1, 'both', 10);
|
234 |
+
|
235 |
+
= To Display Most Viewed Posts For A Category =
|
236 |
+
* Use:
|
237 |
+
<code>
|
238 |
+
<?php if (function_exists('get_most_viewed_category')): ?>
|
239 |
+
<ul>
|
240 |
+
<?php get_most_viewed_category(); ?>
|
241 |
+
</ul>
|
242 |
+
<?php endif; ?>
|
243 |
+
</code>
|
244 |
+
* The first value you pass in is the category id.
|
245 |
+
* The second value you pass in is the post type that you want. If you want to get every post types, just use 'both'. It also supports PHP array: example `array('post', 'page')`.
|
246 |
+
* The third value you pass in is the maximum number of post you want to get.
|
247 |
+
* Default: get_most_viewed_category(1, 'both', 10);
|
248 |
+
|
249 |
+
= To Sort Most/Least Viewed Posts =
|
250 |
+
* You can use: `<?php query_posts( array( 'meta_key' => 'views', 'orderby' => 'meta_value_num', 'order' => 'DESC' ) ); ?>`
|
251 |
+
* Or pass in the variables to the URL: `http://yoursite.com/?v_sortby=views&v_orderby=desc`
|
252 |
+
* You can replace DESC with ASC if you want the least viewed posts.
|
screenshot-1.png
ADDED
Binary file
|
uninstall.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Uninstall plugin
|
4 |
+
*/
|
5 |
+
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
|
6 |
+
exit ();
|
7 |
+
|
8 |
+
if ( is_multisite() ) {
|
9 |
+
$ms_sites = wp_get_sites();
|
10 |
+
|
11 |
+
if( 0 < sizeof( $ms_sites ) ) {
|
12 |
+
foreach ( $ms_sites as $ms_site ) {
|
13 |
+
switch_to_blog( $ms_site['blog_id'] );
|
14 |
+
uninstall();
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
restore_current_blog();
|
19 |
+
} else {
|
20 |
+
uninstall();
|
21 |
+
}
|
22 |
+
|
23 |
+
function uninstall() {
|
24 |
+
global $wpdb;
|
25 |
+
|
26 |
+
$option_names = array( 'views_options', 'widget_views_most_viewed', 'widget_views' );
|
27 |
+
|
28 |
+
if( sizeof( $option_names ) > 0 ) {
|
29 |
+
foreach( $option_names as $option_name ) {
|
30 |
+
delete_option( $option_name );
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = 'views'" );
|
35 |
+
}
|
wp-postviews.mo
DELETED
Binary file
|
wp-postviews.php
CHANGED
@@ -1,790 +1,933 @@
|
|
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.
|
6 |
-
Version: 1.
|
7 |
-
Author: Lester 'GaMerZ' Chan
|
8 |
-
Author URI: http://lesterchan.net
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
if
|
53 |
-
|
54 |
-
}
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
}
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
}
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
if(
|
177 |
-
$
|
178 |
-
}
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
$
|
216 |
-
$
|
217 |
-
$
|
218 |
-
$
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
$
|
233 |
-
$
|
234 |
-
|
235 |
-
|
236 |
-
$
|
237 |
-
$temp =
|
238 |
-
$temp = str_replace("%
|
239 |
-
$temp = str_replace("%
|
240 |
-
$
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
} else {
|
248 |
-
|
249 |
-
}
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
if(!empty($mode) && $mode != 'both') {
|
268 |
-
$
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
$
|
281 |
-
$
|
282 |
-
$
|
283 |
-
|
284 |
-
|
285 |
-
$
|
286 |
-
$temp =
|
287 |
-
$temp = str_replace("%
|
288 |
-
$
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
if($
|
322 |
-
|
323 |
-
$
|
324 |
-
$
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
$
|
335 |
-
$
|
336 |
-
$
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
$
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
$
|
378 |
-
$
|
379 |
-
|
380 |
-
$
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
$
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
$
|
432 |
-
$
|
433 |
-
}
|
434 |
-
|
435 |
-
|
436 |
-
}
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
}
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
if(
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
}
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
}
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
function
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
}
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
}
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
$
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
}
|
620 |
-
|
621 |
-
|
622 |
-
### Function:
|
623 |
-
|
624 |
-
|
625 |
-
$
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
}
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
$
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
$
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
$
|
713 |
-
$
|
714 |
-
|
715 |
-
|
716 |
-
$
|
717 |
-
$
|
718 |
-
$
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
function
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
790 |
?>
|
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.
|
6 |
+
Version: 1.66
|
7 |
+
Author: Lester 'GaMerZ' Chan
|
8 |
+
Author URI: http://lesterchan.net
|
9 |
+
Text Domain: wp-postviews
|
10 |
+
*/
|
11 |
+
|
12 |
+
|
13 |
+
/*
|
14 |
+
Copyright 2014 Lester Chan (email : lesterchan@gmail.com)
|
15 |
+
|
16 |
+
This program is free software; you can redistribute it and/or modify
|
17 |
+
it under the terms of the GNU General Public License as published by
|
18 |
+
the Free Software Foundation; either version 2 of the License, or
|
19 |
+
(at your option) any later version.
|
20 |
+
|
21 |
+
This program is distributed in the hope that it will be useful,
|
22 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24 |
+
GNU General Public License for more details.
|
25 |
+
|
26 |
+
You should have received a copy of the GNU General Public License
|
27 |
+
along with this program; if not, write to the Free Software
|
28 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
29 |
+
*/
|
30 |
+
|
31 |
+
|
32 |
+
### Create Text Domain For Translations
|
33 |
+
add_action( 'plugins_loaded', 'postviews_textdomain' );
|
34 |
+
function postviews_textdomain() {
|
35 |
+
load_plugin_textdomain( 'wp-postviews', false, dirname( plugin_basename( __FILE__ ) ) );
|
36 |
+
}
|
37 |
+
|
38 |
+
|
39 |
+
### Function: Post Views Option Menu
|
40 |
+
add_action('admin_menu', 'postviews_menu');
|
41 |
+
function postviews_menu() {
|
42 |
+
if (function_exists('add_options_page')) {
|
43 |
+
add_options_page(__('PostViews', 'wp-postviews'), __('PostViews', 'wp-postviews'), 'manage_options', 'wp-postviews/postviews-options.php') ;
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
|
48 |
+
### Function: Calculate Post Views
|
49 |
+
add_action('wp_head', 'process_postviews');
|
50 |
+
function process_postviews() {
|
51 |
+
global $user_ID, $post;
|
52 |
+
if(is_int($post)) {
|
53 |
+
$post = get_post($post);
|
54 |
+
}
|
55 |
+
if(!wp_is_post_revision($post)) {
|
56 |
+
if(is_single() || is_page()) {
|
57 |
+
$id = intval($post->ID);
|
58 |
+
$views_options = get_option('views_options');
|
59 |
+
if ( ! $post_views = get_post_meta( $post->ID, 'views', true ) )
|
60 |
+
$post_views = 0;
|
61 |
+
$should_count = false;
|
62 |
+
switch(intval($views_options['count'])) {
|
63 |
+
case 0:
|
64 |
+
$should_count = true;
|
65 |
+
break;
|
66 |
+
case 1:
|
67 |
+
if(empty($_COOKIE[USER_COOKIE]) && intval($user_ID) == 0) {
|
68 |
+
$should_count = true;
|
69 |
+
}
|
70 |
+
break;
|
71 |
+
case 2:
|
72 |
+
if(intval($user_ID) > 0) {
|
73 |
+
$should_count = true;
|
74 |
+
}
|
75 |
+
break;
|
76 |
+
}
|
77 |
+
if(intval($views_options['exclude_bots']) == 1) {
|
78 |
+
$bots = array
|
79 |
+
(
|
80 |
+
'Google Bot' => 'googlebot'
|
81 |
+
, 'Google Bot' => 'google'
|
82 |
+
, 'MSN' => 'msnbot'
|
83 |
+
, 'Alex' => 'ia_archiver'
|
84 |
+
, 'Lycos' => 'lycos'
|
85 |
+
, 'Ask Jeeves' => 'jeeves'
|
86 |
+
, 'Altavista' => 'scooter'
|
87 |
+
, 'AllTheWeb' => 'fast-webcrawler'
|
88 |
+
, 'Inktomi' => 'slurp@inktomi'
|
89 |
+
, 'Turnitin.com' => 'turnitinbot'
|
90 |
+
, 'Technorati' => 'technorati'
|
91 |
+
, 'Yahoo' => 'yahoo'
|
92 |
+
, 'Findexa' => 'findexa'
|
93 |
+
, 'NextLinks' => 'findlinks'
|
94 |
+
, 'Gais' => 'gaisbo'
|
95 |
+
, 'WiseNut' => 'zyborg'
|
96 |
+
, 'WhoisSource' => 'surveybot'
|
97 |
+
, 'Bloglines' => 'bloglines'
|
98 |
+
, 'BlogSearch' => 'blogsearch'
|
99 |
+
, 'PubSub' => 'pubsub'
|
100 |
+
, 'Syndic8' => 'syndic8'
|
101 |
+
, 'RadioUserland' => 'userland'
|
102 |
+
, 'Gigabot' => 'gigabot'
|
103 |
+
, 'Become.com' => 'become.com'
|
104 |
+
, 'Baidu' => 'baiduspider'
|
105 |
+
, 'so.com' => '360spider'
|
106 |
+
, 'Sogou' => 'spider'
|
107 |
+
, 'soso.com' => 'sosospider'
|
108 |
+
, 'Yandex' => 'yandex'
|
109 |
+
);
|
110 |
+
$useragent = $_SERVER['HTTP_USER_AGENT'];
|
111 |
+
foreach ($bots as $name => $lookfor) {
|
112 |
+
if (stristr($useragent, $lookfor) !== false) {
|
113 |
+
$should_count = false;
|
114 |
+
break;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
}
|
118 |
+
if($should_count && (!defined('WP_CACHE') || !WP_CACHE)) {
|
119 |
+
update_post_meta($id, 'views', ($post_views + 1));
|
120 |
+
}
|
121 |
+
}
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
|
126 |
+
### Function: Calculate Post Views With WP_CACHE Enabled
|
127 |
+
add_action('wp_enqueue_scripts', 'wp_postview_cache_count_enqueue');
|
128 |
+
function wp_postview_cache_count_enqueue() {
|
129 |
+
global $user_ID, $post;
|
130 |
+
if (!wp_is_post_revision($post) && (is_single() || is_page())) {
|
131 |
+
$views_options = get_option('views_options');
|
132 |
+
$should_count = false;
|
133 |
+
switch(intval($views_options['count'])) {
|
134 |
+
case 0:
|
135 |
+
$should_count = true;
|
136 |
+
break;
|
137 |
+
case 1:
|
138 |
+
if (empty($_COOKIE[USER_COOKIE]) && intval($user_ID) == 0) {
|
139 |
+
$should_count = true;
|
140 |
+
}
|
141 |
+
break;
|
142 |
+
case 2:
|
143 |
+
if (intval($user_ID) > 0) {
|
144 |
+
$should_count = true;
|
145 |
+
}
|
146 |
+
break;
|
147 |
+
}
|
148 |
+
if ($should_count && defined('WP_CACHE') && WP_CACHE) {
|
149 |
+
// Enqueue and localize script here
|
150 |
+
wp_enqueue_script('wp-postviews-cache', plugins_url('postviews-cache.js', __FILE__), array('jquery'), '1.64', true);
|
151 |
+
wp_localize_script('wp-postviews-cache', 'viewsCacheL10n', array('admin_ajax_url' => admin_url('admin-ajax.php', (is_ssl() ? 'https' : 'http')), 'post_id' => intval($post->ID)));
|
152 |
+
}
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
|
157 |
+
### Function: Determine If Post Views Should Be Displayed (By: David Potter)
|
158 |
+
function should_views_be_displayed($views_options = null) {
|
159 |
+
if ($views_options == null) {
|
160 |
+
$views_options = get_option('views_options');
|
161 |
+
}
|
162 |
+
$display_option = 0;
|
163 |
+
if (is_home()) {
|
164 |
+
if (array_key_exists('display_home', $views_options)) {
|
165 |
+
$display_option = $views_options['display_home'];
|
166 |
+
}
|
167 |
+
} elseif (is_single()) {
|
168 |
+
if (array_key_exists('display_single', $views_options)) {
|
169 |
+
$display_option = $views_options['display_single'];
|
170 |
+
}
|
171 |
+
} elseif (is_page()) {
|
172 |
+
if (array_key_exists('display_page', $views_options)) {
|
173 |
+
$display_option = $views_options['display_page'];
|
174 |
+
}
|
175 |
+
} elseif (is_archive()) {
|
176 |
+
if (array_key_exists('display_archive', $views_options)) {
|
177 |
+
$display_option = $views_options['display_archive'];
|
178 |
+
}
|
179 |
+
} elseif (is_search()) {
|
180 |
+
if (array_key_exists('display_search', $views_options)) {
|
181 |
+
$display_option = $views_options['display_search'];
|
182 |
+
}
|
183 |
+
} else {
|
184 |
+
if (array_key_exists('display_other', $views_options)) {
|
185 |
+
$display_option = $views_options['display_other'];
|
186 |
+
}
|
187 |
+
}
|
188 |
+
return (($display_option == 0) || (($display_option == 1) && is_user_logged_in()));
|
189 |
+
}
|
190 |
+
|
191 |
+
|
192 |
+
### Function: Display The Post Views
|
193 |
+
function the_views($display = true, $prefix = '', $postfix = '', $always = false) {
|
194 |
+
$post_views = intval(post_custom('views'));
|
195 |
+
$views_options = get_option('views_options');
|
196 |
+
if ($always || should_views_be_displayed($views_options)) {
|
197 |
+
$output = $prefix.str_replace('%VIEW_COUNT%', number_format_i18n($post_views), $views_options['template']).$postfix;
|
198 |
+
if($display) {
|
199 |
+
echo apply_filters('the_views', $output);
|
200 |
+
} else {
|
201 |
+
return apply_filters('the_views', $output);
|
202 |
+
}
|
203 |
+
}
|
204 |
+
elseif (!$display) {
|
205 |
+
return '';
|
206 |
+
}
|
207 |
+
}
|
208 |
+
|
209 |
+
|
210 |
+
### Function: Display Least Viewed Page/Post
|
211 |
+
if(!function_exists('get_least_viewed')) {
|
212 |
+
function get_least_viewed($mode = '', $limit = 10, $chars = 0, $display = true) {
|
213 |
+
global $wpdb;
|
214 |
+
$views_options = get_option('views_options');
|
215 |
+
$where = '';
|
216 |
+
$temp = '';
|
217 |
+
$output = '';
|
218 |
+
if(!empty($mode) && $mode != 'both') {
|
219 |
+
if(is_array($mode)) {
|
220 |
+
$mode = implode("','",$mode);
|
221 |
+
$where = "post_type IN ('".$mode."')";
|
222 |
+
} else {
|
223 |
+
$where = "post_type = '$mode'";
|
224 |
+
}
|
225 |
+
} else {
|
226 |
+
$where = '1=1';
|
227 |
+
}
|
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 ASC LIMIT $limit");
|
229 |
+
if($most_viewed) {
|
230 |
+
foreach ($most_viewed as $post) {
|
231 |
+
$post_views = intval($post->views);
|
232 |
+
$post_title = get_the_title($post);
|
233 |
+
if($chars > 0) {
|
234 |
+
$post_title = snippet_text($post_title, $chars);
|
235 |
+
}
|
236 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password, $chars);
|
237 |
+
$temp = stripslashes($views_options['most_viewed_template']);
|
238 |
+
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
239 |
+
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
240 |
+
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
241 |
+
$temp = str_replace("%POST_CONTENT%", $post->post_content, $temp);
|
242 |
+
$temp = str_replace("%POST_URL%", get_permalink($post), $temp);
|
243 |
+
$temp = str_replace("%POST_DATE%", get_the_time(get_option('date_format'), $post), $temp);
|
244 |
+
$temp = str_replace("%POST_TIME%", get_the_time(get_option('time_format'), $post), $temp);
|
245 |
+
$output .= $temp;
|
246 |
+
}
|
247 |
+
} else {
|
248 |
+
$output = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
|
249 |
+
}
|
250 |
+
if($display) {
|
251 |
+
echo $output;
|
252 |
+
} else {
|
253 |
+
return $output;
|
254 |
+
}
|
255 |
+
}
|
256 |
+
}
|
257 |
+
|
258 |
+
|
259 |
+
### Function: Display Most Viewed Page/Post
|
260 |
+
if(!function_exists('get_most_viewed')) {
|
261 |
+
function get_most_viewed($mode = '', $limit = 10, $chars = 0, $display = true) {
|
262 |
+
global $wpdb;
|
263 |
+
$views_options = get_option('views_options');
|
264 |
+
$where = '';
|
265 |
+
$temp = '';
|
266 |
+
$output = '';
|
267 |
+
if(!empty($mode) && $mode != 'both') {
|
268 |
+
if(is_array($mode)) {
|
269 |
+
$mode = implode("','",$mode);
|
270 |
+
$where = "post_type IN ('".$mode."')";
|
271 |
+
} else {
|
272 |
+
$where = "post_type = '$mode'";
|
273 |
+
}
|
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 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");
|
278 |
+
if($most_viewed) {
|
279 |
+
foreach ($most_viewed as $post) {
|
280 |
+
$post_views = intval($post->views);
|
281 |
+
$post_title = get_the_title($post);
|
282 |
+
if($chars > 0) {
|
283 |
+
$post_title = snippet_text($post_title, $chars);
|
284 |
+
}
|
285 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password, $chars);
|
286 |
+
$temp = stripslashes($views_options['most_viewed_template']);
|
287 |
+
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
288 |
+
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
289 |
+
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
290 |
+
$temp = str_replace("%POST_CONTENT%", $post->post_content, $temp);
|
291 |
+
$temp = str_replace("%POST_URL%", get_permalink($post), $temp);
|
292 |
+
$temp = str_replace("%POST_DATE%", get_the_time(get_option('date_format'), $post), $temp);
|
293 |
+
$temp = str_replace("%POST_TIME%", get_the_time(get_option('time_format'), $post), $temp);
|
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 Leased Viewed Page/Post By Category ID
|
309 |
+
if(!function_exists('get_least_viewed_category')) {
|
310 |
+
function get_least_viewed_category($category_id = 0, $mode = '', $limit = 10, $chars = 0, $display = true) {
|
311 |
+
global $wpdb;
|
312 |
+
$views_options = get_option('views_options');
|
313 |
+
$where = '';
|
314 |
+
$temp = '';
|
315 |
+
$output = '';
|
316 |
+
if(is_array($category_id)) {
|
317 |
+
$category_sql = "$wpdb->term_taxonomy.term_id IN (".join(',', $category_id).')';
|
318 |
+
} else {
|
319 |
+
$category_sql = "$wpdb->term_taxonomy.term_id = $category_id";
|
320 |
+
}
|
321 |
+
if(!empty($mode) && $mode != 'both') {
|
322 |
+
if(is_array($mode)) {
|
323 |
+
$mode = implode("','",$mode);
|
324 |
+
$where = "post_type IN ('".$mode."')";
|
325 |
+
} else {
|
326 |
+
$where = "post_type = '$mode'";
|
327 |
+
}
|
328 |
+
} else {
|
329 |
+
$where = '1=1';
|
330 |
+
}
|
331 |
+
$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");
|
332 |
+
if($most_viewed) {
|
333 |
+
foreach ($most_viewed as $post) {
|
334 |
+
$post_views = intval($post->views);
|
335 |
+
$post_title = get_the_title($post);
|
336 |
+
if($chars > 0) {
|
337 |
+
$post_title = snippet_text($post_title, $chars);
|
338 |
+
}
|
339 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password, $chars);
|
340 |
+
$temp = stripslashes($views_options['most_viewed_template']);
|
341 |
+
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
342 |
+
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
343 |
+
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
344 |
+
$temp = str_replace("%POST_CONTENT%", $post->post_content, $temp);
|
345 |
+
$temp = str_replace("%POST_URL%", get_permalink($post), $temp);
|
346 |
+
$temp = str_replace("%POST_DATE%", get_the_time(get_option('date_format'), $post), $temp);
|
347 |
+
$temp = str_replace("%POST_TIME%", get_the_time(get_option('time_format'), $post), $temp);
|
348 |
+
$output .= $temp;
|
349 |
+
}
|
350 |
+
} else {
|
351 |
+
$output = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
|
352 |
+
}
|
353 |
+
if($display) {
|
354 |
+
echo $output;
|
355 |
+
} else {
|
356 |
+
return $output;
|
357 |
+
}
|
358 |
+
}
|
359 |
+
}
|
360 |
+
|
361 |
+
|
362 |
+
### Function: Display Most Viewed Page/Post By Category ID
|
363 |
+
if(!function_exists('get_most_viewed_category')) {
|
364 |
+
function get_most_viewed_category($category_id = 0, $mode = '', $limit = 10, $chars = 0, $display = true) {
|
365 |
+
global $wpdb;
|
366 |
+
$views_options = get_option('views_options');
|
367 |
+
$where = '';
|
368 |
+
$temp = '';
|
369 |
+
$output = '';
|
370 |
+
if(is_array($category_id)) {
|
371 |
+
$category_sql = "$wpdb->term_taxonomy.term_id IN (".join(',', $category_id).')';
|
372 |
+
} else {
|
373 |
+
$category_sql = "$wpdb->term_taxonomy.term_id = $category_id";
|
374 |
+
}
|
375 |
+
if(!empty($mode) && $mode != 'both') {
|
376 |
+
if(is_array($mode)) {
|
377 |
+
$mode = implode("','",$mode);
|
378 |
+
$where = "post_type IN ('".$mode."')";
|
379 |
+
} else {
|
380 |
+
$where = "post_type = '$mode'";
|
381 |
+
}
|
382 |
+
} else {
|
383 |
+
$where = '1=1';
|
384 |
+
}
|
385 |
+
$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");
|
386 |
+
if($most_viewed) {
|
387 |
+
foreach ($most_viewed as $post) {
|
388 |
+
$post_views = intval($post->views);
|
389 |
+
$post_title = get_the_title($post);
|
390 |
+
if($chars > 0) {
|
391 |
+
$post_title = snippet_text($post_title, $chars);
|
392 |
+
}
|
393 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password, $chars);
|
394 |
+
$temp = stripslashes($views_options['most_viewed_template']);
|
395 |
+
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
396 |
+
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
397 |
+
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
398 |
+
$temp = str_replace("%POST_CONTENT%", $post->post_content, $temp);
|
399 |
+
$temp = str_replace("%POST_URL%", get_permalink($post), $temp);
|
400 |
+
$temp = str_replace("%POST_DATE%", get_the_time(get_option('date_format'), $post), $temp);
|
401 |
+
$temp = str_replace("%POST_TIME%", get_the_time(get_option('time_format'), $post), $temp);
|
402 |
+
$output .= $temp;
|
403 |
+
}
|
404 |
+
} else {
|
405 |
+
$output = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
|
406 |
+
}
|
407 |
+
if($display) {
|
408 |
+
echo $output;
|
409 |
+
} else {
|
410 |
+
return $output;
|
411 |
+
}
|
412 |
+
}
|
413 |
+
}
|
414 |
+
|
415 |
+
|
416 |
+
### Function: Display Most Viewed Page/Post By Tag ID
|
417 |
+
if(!function_exists('get_most_viewed_tag')) {
|
418 |
+
function get_most_viewed_tag($tag_id = 0, $mode = '', $limit = 10, $chars = 0, $display = true) {
|
419 |
+
global $wpdb;
|
420 |
+
$views_options = get_option('views_options');
|
421 |
+
$where = '';
|
422 |
+
$temp = '';
|
423 |
+
$output = '';
|
424 |
+
if(is_array($tag_id)) {
|
425 |
+
$tag_sql = "$wpdb->term_taxonomy.term_id IN (".join(',', $tag_id).')';
|
426 |
+
} else {
|
427 |
+
$tag_sql = "$wpdb->term_taxonomy.term_id = $tag_id";
|
428 |
+
}
|
429 |
+
if(!empty($mode) && $mode != 'both') {
|
430 |
+
if(is_array($mode)) {
|
431 |
+
$mode = implode("','",$mode);
|
432 |
+
$where = "post_type IN ('".$mode."')";
|
433 |
+
} else {
|
434 |
+
$where = "post_type = '$mode'";
|
435 |
+
}
|
436 |
+
} else {
|
437 |
+
$where = '1=1';
|
438 |
+
}
|
439 |
+
$most_viewed = $wpdb->get_results("SELECT DISTINCT $wpdb->posts.*, (meta_value+0) AS views FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ON $wpdb->postmeta.post_id = $wpdb->posts.ID INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) WHERE post_date < '".current_time('mysql')."' AND $wpdb->term_taxonomy.taxonomy = 'post_tag' AND $tag_sql AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT $limit");
|
440 |
+
if($most_viewed) {
|
441 |
+
foreach ($most_viewed as $post) {
|
442 |
+
$post_views = intval($post->views);
|
443 |
+
$post_title = get_the_title($post);
|
444 |
+
if($chars > 0) {
|
445 |
+
$post_title = snippet_text($post_title, $chars);
|
446 |
+
}
|
447 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password, $chars);
|
448 |
+
$temp = stripslashes($views_options['most_viewed_template']);
|
449 |
+
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
450 |
+
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
451 |
+
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
452 |
+
$temp = str_replace("%POST_CONTENT%", $post->post_content, $temp);
|
453 |
+
$temp = str_replace("%POST_URL%", get_permalink($post), $temp);
|
454 |
+
$temp = str_replace("%POST_DATE%", get_the_time(get_option('date_format'), $post), $temp);
|
455 |
+
$temp = str_replace("%POST_TIME%", get_the_time(get_option('time_format'), $post), $temp);
|
456 |
+
$output .= $temp;
|
457 |
+
}
|
458 |
+
} else {
|
459 |
+
$output = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
|
460 |
+
}
|
461 |
+
if($display) {
|
462 |
+
echo $output;
|
463 |
+
} else {
|
464 |
+
return $output;
|
465 |
+
}
|
466 |
+
}
|
467 |
+
}
|
468 |
+
|
469 |
+
|
470 |
+
### Function: Display Least Viewed Page/Post By Tag ID
|
471 |
+
if(!function_exists('get_least_viewed_tag')) {
|
472 |
+
function get_least_viewed_tag($tag_id = 0, $mode = '', $limit = 10, $chars = 0, $display = true) {
|
473 |
+
global $wpdb;
|
474 |
+
$views_options = get_option('views_options');
|
475 |
+
$where = '';
|
476 |
+
$temp = '';
|
477 |
+
$output = '';
|
478 |
+
if(is_array($tag_id)) {
|
479 |
+
$tag_sql = "$wpdb->term_taxonomy.term_id IN (".join(',', $tag_id).')';
|
480 |
+
} else {
|
481 |
+
$tag_sql = "$wpdb->term_taxonomy.term_id = $tag_id";
|
482 |
+
}
|
483 |
+
if(!empty($mode) && $mode != 'both') {
|
484 |
+
if(is_array($mode)) {
|
485 |
+
$mode = implode("','",$mode);
|
486 |
+
$where = "post_type IN ('".$mode."')";
|
487 |
+
} else {
|
488 |
+
$where = "post_type = '$mode'";
|
489 |
+
}
|
490 |
+
} else {
|
491 |
+
$where = '1=1';
|
492 |
+
}
|
493 |
+
$most_viewed = $wpdb->get_results("SELECT DISTINCT $wpdb->posts.*, (meta_value+0) AS views FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ON $wpdb->postmeta.post_id = $wpdb->posts.ID INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) WHERE post_date < '".current_time('mysql')."' AND $wpdb->term_taxonomy.taxonomy = 'post_tag' AND $tag_sql AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views ASC LIMIT $limit");
|
494 |
+
if($most_viewed) {
|
495 |
+
foreach ($most_viewed as $post) {
|
496 |
+
$post_views = intval($post->views);
|
497 |
+
$post_title = get_the_title($post);
|
498 |
+
if($chars > 0) {
|
499 |
+
$post_title = snippet_text($post_title, $chars);
|
500 |
+
}
|
501 |
+
$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password, $chars);
|
502 |
+
$temp = stripslashes($views_options['most_viewed_template']);
|
503 |
+
$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
|
504 |
+
$temp = str_replace("%POST_TITLE%", $post_title, $temp);
|
505 |
+
$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
|
506 |
+
$temp = str_replace("%POST_CONTENT%", $post->post_content, $temp);
|
507 |
+
$temp = str_replace("%POST_URL%", get_permalink($post), $temp);
|
508 |
+
$temp = str_replace("%POST_DATE%", get_the_time(get_option('date_format'), $post), $temp);
|
509 |
+
$temp = str_replace("%POST_TIME%", get_the_time(get_option('time_format'), $post), $temp);
|
510 |
+
$output .= $temp;
|
511 |
+
}
|
512 |
+
} else {
|
513 |
+
$output = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
|
514 |
+
}
|
515 |
+
if($display) {
|
516 |
+
echo $output;
|
517 |
+
} else {
|
518 |
+
return $output;
|
519 |
+
}
|
520 |
+
}
|
521 |
+
}
|
522 |
+
|
523 |
+
|
524 |
+
### Function: Display Total Views
|
525 |
+
if(!function_exists('get_totalviews')) {
|
526 |
+
function get_totalviews($display = true) {
|
527 |
+
global $wpdb;
|
528 |
+
$total_views = intval($wpdb->get_var("SELECT SUM(meta_value+0) FROM $wpdb->postmeta WHERE meta_key = 'views'"));
|
529 |
+
if($display) {
|
530 |
+
echo number_format_i18n($total_views);
|
531 |
+
} else {
|
532 |
+
return $total_views;
|
533 |
+
}
|
534 |
+
}
|
535 |
+
}
|
536 |
+
|
537 |
+
|
538 |
+
### Function: Snippet Text
|
539 |
+
if(!function_exists('snippet_text')) {
|
540 |
+
function snippet_text($text, $length = 0) {
|
541 |
+
if (defined('MB_OVERLOAD_STRING')) {
|
542 |
+
$text = @html_entity_decode($text, ENT_QUOTES, get_option('blog_charset'));
|
543 |
+
if (mb_strlen($text) > $length) {
|
544 |
+
return htmlentities(mb_substr($text,0,$length), ENT_COMPAT, get_option('blog_charset')).'...';
|
545 |
+
} else {
|
546 |
+
return htmlentities($text, ENT_COMPAT, get_option('blog_charset'));
|
547 |
+
}
|
548 |
+
} else {
|
549 |
+
$text = @html_entity_decode($text, ENT_QUOTES, get_option('blog_charset'));
|
550 |
+
if (strlen($text) > $length) {
|
551 |
+
return htmlentities(substr($text,0,$length), ENT_COMPAT, get_option('blog_charset')).'...';
|
552 |
+
} else {
|
553 |
+
return htmlentities($text, ENT_COMPAT, get_option('blog_charset'));
|
554 |
+
}
|
555 |
+
}
|
556 |
+
}
|
557 |
+
}
|
558 |
+
|
559 |
+
|
560 |
+
### Function: Process Post Excerpt, For Some Reasons, The Default get_post_excerpt() Does Not Work As Expected
|
561 |
+
function views_post_excerpt($post_excerpt, $post_content, $post_password, $chars = 200) {
|
562 |
+
if(!empty($post_password)) {
|
563 |
+
if(!isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || $_COOKIE['wp-postpass_'.COOKIEHASH] != $post_password) {
|
564 |
+
return __('There is no excerpt because this is a protected post.', 'wp-postviews');
|
565 |
+
}
|
566 |
+
}
|
567 |
+
if(empty($post_excerpt)) {
|
568 |
+
return snippet_text(strip_tags($post_content), $chars);
|
569 |
+
} else {
|
570 |
+
return $post_excerpt;
|
571 |
+
}
|
572 |
+
}
|
573 |
+
|
574 |
+
|
575 |
+
### Function: Modify Default WordPress Listing To Make It Sorted By Post Views
|
576 |
+
function views_fields($content) {
|
577 |
+
global $wpdb;
|
578 |
+
$content .= ", ($wpdb->postmeta.meta_value+0) AS views";
|
579 |
+
return $content;
|
580 |
+
}
|
581 |
+
function views_join($content) {
|
582 |
+
global $wpdb;
|
583 |
+
$content .= " LEFT JOIN $wpdb->postmeta ON $wpdb->postmeta.post_id = $wpdb->posts.ID";
|
584 |
+
return $content;
|
585 |
+
}
|
586 |
+
function views_where($content) {
|
587 |
+
global $wpdb;
|
588 |
+
$content .= " AND $wpdb->postmeta.meta_key = 'views'";
|
589 |
+
return $content;
|
590 |
+
}
|
591 |
+
function views_orderby($content) {
|
592 |
+
$orderby = trim(addslashes(get_query_var('v_orderby')));
|
593 |
+
if(empty($orderby) || ($orderby != 'asc' && $orderby != 'desc')) {
|
594 |
+
$orderby = 'desc';
|
595 |
+
}
|
596 |
+
$content = " views $orderby";
|
597 |
+
return $content;
|
598 |
+
}
|
599 |
+
|
600 |
+
|
601 |
+
### Function: Add Views Custom Fields
|
602 |
+
add_action('publish_post', 'add_views_fields');
|
603 |
+
add_action('publish_page', 'add_views_fields');
|
604 |
+
function add_views_fields($post_ID) {
|
605 |
+
global $wpdb;
|
606 |
+
if(!wp_is_post_revision($post_ID)) {
|
607 |
+
add_post_meta($post_ID, 'views', 0, true);
|
608 |
+
}
|
609 |
+
}
|
610 |
+
|
611 |
+
|
612 |
+
### Function: Delete Views Custom Fields
|
613 |
+
add_action('delete_post', 'delete_views_fields');
|
614 |
+
function delete_views_fields($post_ID) {
|
615 |
+
global $wpdb;
|
616 |
+
if(!wp_is_post_revision($post_ID)) {
|
617 |
+
delete_post_meta($post_ID, 'views');
|
618 |
+
}
|
619 |
+
}
|
620 |
+
|
621 |
+
|
622 |
+
### Function: Views Public Variables
|
623 |
+
add_filter('query_vars', 'views_variables');
|
624 |
+
function views_variables($public_query_vars) {
|
625 |
+
$public_query_vars[] = 'v_sortby';
|
626 |
+
$public_query_vars[] = 'v_orderby';
|
627 |
+
return $public_query_vars;
|
628 |
+
}
|
629 |
+
|
630 |
+
|
631 |
+
### Function: Sort Views Posts
|
632 |
+
add_action('pre_get_posts', 'views_sorting');
|
633 |
+
function views_sorting($local_wp_query) {
|
634 |
+
if($local_wp_query->get('v_sortby') == 'views') {
|
635 |
+
add_filter('posts_fields', 'views_fields');
|
636 |
+
add_filter('posts_join', 'views_join');
|
637 |
+
add_filter('posts_where', 'views_where');
|
638 |
+
add_filter('posts_orderby', 'views_orderby');
|
639 |
+
} else {
|
640 |
+
remove_filter('posts_fields', 'views_fields');
|
641 |
+
remove_filter('posts_join', 'views_join');
|
642 |
+
remove_filter('posts_where', 'views_where');
|
643 |
+
remove_filter('posts_orderby', 'views_orderby');
|
644 |
+
}
|
645 |
+
}
|
646 |
+
|
647 |
+
|
648 |
+
### Function: Plug Into WP-Stats
|
649 |
+
add_action('wp','postviews_wp_stats');
|
650 |
+
function postviews_wp_stats() {
|
651 |
+
if(function_exists('stats_page')) {
|
652 |
+
if(strpos(get_option('stats_url'), $_SERVER['REQUEST_URI']) || strpos($_SERVER['REQUEST_URI'], 'stats-options.php') || strpos($_SERVER['REQUEST_URI'], 'wp-stats/wp-stats.php')) {
|
653 |
+
add_filter('wp_stats_page_admin_plugins', 'postviews_page_admin_general_stats');
|
654 |
+
add_filter('wp_stats_page_admin_most', 'postviews_page_admin_most_stats');
|
655 |
+
add_filter('wp_stats_page_plugins', 'postviews_page_general_stats');
|
656 |
+
add_filter('wp_stats_page_most', 'postviews_page_most_stats');
|
657 |
+
}
|
658 |
+
}
|
659 |
+
}
|
660 |
+
|
661 |
+
|
662 |
+
### Function: Add WP-PostViews General Stats To WP-Stats Page Options
|
663 |
+
function postviews_page_admin_general_stats($content) {
|
664 |
+
$stats_display = get_option('stats_display');
|
665 |
+
if($stats_display['views'] == 1) {
|
666 |
+
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_views" value="views" checked="checked" /> <label for="wpstats_views">'.__('WP-PostViews', 'wp-postviews').'</label><br />'."\n";
|
667 |
+
} else {
|
668 |
+
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_views" value="views" /> <label for="wpstats_views">'.__('WP-PostViews', 'wp-postviews').'</label><br />'."\n";
|
669 |
+
}
|
670 |
+
return $content;
|
671 |
+
}
|
672 |
+
|
673 |
+
|
674 |
+
### Function: Add WP-PostViews Top Most/Highest Stats To WP-Stats Page Options
|
675 |
+
function postviews_page_admin_most_stats($content) {
|
676 |
+
$stats_display = get_option('stats_display');
|
677 |
+
$stats_mostlimit = intval(get_option('stats_mostlimit'));
|
678 |
+
if($stats_display['viewed_most_post'] == 1) {
|
679 |
+
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most_post" value="viewed_most_post" checked="checked" /> <label for="wpstats_viewed_most_post">'.sprintf(_n('%s Most Viewed Post', '%s Most Viewed Posts', $stats_mostlimit, 'wp-postviews'), number_format_i18n($stats_mostlimit)).'</label><br />'."\n";
|
680 |
+
} else {
|
681 |
+
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most_post" value="viewed_most_post" /> <label for="wpstats_viewed_most_post">'.sprintf(_n('%s Most Viewed Post', '%s Most Viewed Posts', $stats_mostlimit, 'wp-postviews'), number_format_i18n($stats_mostlimit)).'</label><br />'."\n";
|
682 |
+
}
|
683 |
+
if($stats_display['viewed_most_page'] == 1) {
|
684 |
+
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most_page" value="viewed_most_page" checked="checked" /> <label for="wpstats_viewed_most_page">'.sprintf(_n('%s Most Viewed Page', '%s Most Viewed Pages', $stats_mostlimit, 'wp-postviews'), number_format_i18n($stats_mostlimit)).'</label><br />'."\n";
|
685 |
+
} else {
|
686 |
+
$content .= '<input type="checkbox" name="stats_display[]" id="wpstats_viewed_most_page" value="viewed_most_page" /> <label for="wpstats_viewed_most_page">'.sprintf(_n('%s Most Viewed Page', '%s Most Viewed Pages', $stats_mostlimit, 'wp-postviews'), number_format_i18n($stats_mostlimit)).'</label><br />'."\n";
|
687 |
+
}
|
688 |
+
return $content;
|
689 |
+
}
|
690 |
+
|
691 |
+
|
692 |
+
### Function: Add WP-PostViews General Stats To WP-Stats Page
|
693 |
+
function postviews_page_general_stats($content) {
|
694 |
+
$stats_display = get_option('stats_display');
|
695 |
+
if($stats_display['views'] == 1) {
|
696 |
+
$content .= '<p><strong>'.__('WP-PostViews', 'wp-postviews').'</strong></p>'."\n";
|
697 |
+
$content .= '<ul>'."\n";
|
698 |
+
$content .= '<li>'.sprintf(_n('<strong>%s</strong> view was generated.', '<strong>%s</strong> views were generated.', get_totalviews(false), 'wp-postviews'), number_format_i18n(get_totalviews(false))).'</li>'."\n";
|
699 |
+
$content .= '</ul>'."\n";
|
700 |
+
}
|
701 |
+
return $content;
|
702 |
+
}
|
703 |
+
|
704 |
+
|
705 |
+
### Function: Add WP-PostViews Top Most/Highest Stats To WP-Stats Page
|
706 |
+
function postviews_page_most_stats($content) {
|
707 |
+
$stats_display = get_option('stats_display');
|
708 |
+
$stats_mostlimit = intval(get_option('stats_mostlimit'));
|
709 |
+
if($stats_display['viewed_most_post'] == 1) {
|
710 |
+
$content .= '<p><strong>'.sprintf(_n('%s Most Viewed Post', '%s Most Viewed Posts', $stats_mostlimit, 'wp-postviews'), number_format_i18n($stats_mostlimit)).'</strong></p>'."\n";
|
711 |
+
$content .= '<ul>'."\n";
|
712 |
+
$content .= get_most_viewed('post', $stats_mostlimit, 0, false);
|
713 |
+
$content .= '</ul>'."\n";
|
714 |
+
}
|
715 |
+
if($stats_display['viewed_most_page'] == 1) {
|
716 |
+
$content .= '<p><strong>'.sprintf(_n('%s Most Viewed Page', '%s Most Viewed Pages', $stats_mostlimit, 'wp-postviews'), number_format_i18n($stats_mostlimit)).'</strong></p>'."\n";
|
717 |
+
$content .= '<ul>'."\n";
|
718 |
+
$content .= get_most_viewed('page', $stats_mostlimit, 0, false);
|
719 |
+
$content .= '</ul>'."\n";
|
720 |
+
}
|
721 |
+
return $content;
|
722 |
+
}
|
723 |
+
|
724 |
+
|
725 |
+
### Function: Increment Post Views
|
726 |
+
add_action('wp_ajax_postviews', 'increment_views');
|
727 |
+
add_action('wp_ajax_nopriv_postviews', 'increment_views');
|
728 |
+
function increment_views() {
|
729 |
+
global $wpdb;
|
730 |
+
if(!empty($_GET['postviews_id']))
|
731 |
+
{
|
732 |
+
$post_id = intval($_GET['postviews_id']);
|
733 |
+
if($post_id > 0 && defined('WP_CACHE') && WP_CACHE) {
|
734 |
+
$post_views = get_post_custom($post_id);
|
735 |
+
$post_views = intval($post_views['views'][0]);
|
736 |
+
update_post_meta($post_id, 'views', ($post_views + 1));
|
737 |
+
echo ($post_views + 1);
|
738 |
+
}
|
739 |
+
}
|
740 |
+
exit();
|
741 |
+
}
|
742 |
+
|
743 |
+
### Function Show Post Views Column in WP-Admin
|
744 |
+
add_action('manage_posts_custom_column', 'add_postviews_column_content');
|
745 |
+
add_filter('manage_posts_columns', 'add_postviews_column');
|
746 |
+
add_action('manage_pages_custom_column', 'add_postviews_column_content');
|
747 |
+
add_filter('manage_pages_columns', 'add_postviews_column');
|
748 |
+
function add_postviews_column($defaults) {
|
749 |
+
$defaults['views'] = __( 'Views', 'wp-postviews' );
|
750 |
+
return $defaults;
|
751 |
+
}
|
752 |
+
|
753 |
+
|
754 |
+
### Functions Fill In The Views Count
|
755 |
+
function add_postviews_column_content($column_name) {
|
756 |
+
if($column_name == 'views') {
|
757 |
+
if(function_exists('the_views')) { the_views(true, '', '', true); }
|
758 |
+
}
|
759 |
+
}
|
760 |
+
|
761 |
+
|
762 |
+
### Function Sort Columns
|
763 |
+
add_filter('manage_edit-post_sortable_columns', 'sort_postviews_column');
|
764 |
+
add_filter('manage_edit-page_sortable_columns', 'sort_postviews_column');
|
765 |
+
function sort_postviews_column($defaults)
|
766 |
+
{
|
767 |
+
$defaults['views'] = 'views';
|
768 |
+
return $defaults;
|
769 |
+
}
|
770 |
+
add_action('pre_get_posts', 'sort_postviews');
|
771 |
+
function sort_postviews($query) {
|
772 |
+
if(!is_admin())
|
773 |
+
return;
|
774 |
+
$orderby = $query->get('orderby');
|
775 |
+
if('views' == $orderby) {
|
776 |
+
$query->set('meta_key', 'views');
|
777 |
+
$query->set('orderby', 'meta_value_num');
|
778 |
+
}
|
779 |
+
}
|
780 |
+
|
781 |
+
|
782 |
+
### Class: WP-PostViews Widget
|
783 |
+
class WP_Widget_PostViews extends WP_Widget {
|
784 |
+
// Constructor
|
785 |
+
function WP_Widget_PostViews() {
|
786 |
+
$widget_ops = array('description' => __('WP-PostViews views statistics', 'wp-postviews'));
|
787 |
+
$this->WP_Widget('views', __('Views', 'wp-postviews'), $widget_ops);
|
788 |
+
}
|
789 |
+
|
790 |
+
// Display Widget
|
791 |
+
function widget($args, $instance) {
|
792 |
+
extract($args);
|
793 |
+
$title = apply_filters('widget_title', esc_attr($instance['title']));
|
794 |
+
$type = esc_attr($instance['type']);
|
795 |
+
$mode = esc_attr($instance['mode']);
|
796 |
+
$limit = intval($instance['limit']);
|
797 |
+
$chars = intval($instance['chars']);
|
798 |
+
$cat_ids = explode(',', esc_attr($instance['cat_ids']));
|
799 |
+
echo $before_widget.$before_title.$title.$after_title;
|
800 |
+
echo '<ul>'."\n";
|
801 |
+
switch($type) {
|
802 |
+
case 'least_viewed':
|
803 |
+
get_least_viewed($mode, $limit, $chars);
|
804 |
+
break;
|
805 |
+
case 'most_viewed':
|
806 |
+
get_most_viewed($mode, $limit, $chars);
|
807 |
+
break;
|
808 |
+
case 'most_viewed_category':
|
809 |
+
get_most_viewed_category($cat_ids, $mode, $limit, $chars);
|
810 |
+
break;
|
811 |
+
case 'least_viewed_category':
|
812 |
+
get_least_viewed_category($cat_ids, $mode, $limit, $chars);
|
813 |
+
break;
|
814 |
+
}
|
815 |
+
echo '</ul>'."\n";
|
816 |
+
echo $after_widget;
|
817 |
+
}
|
818 |
+
|
819 |
+
// When Widget Control Form Is Posted
|
820 |
+
function update($new_instance, $old_instance) {
|
821 |
+
if (!isset($new_instance['submit'])) {
|
822 |
+
return false;
|
823 |
+
}
|
824 |
+
$instance = $old_instance;
|
825 |
+
$instance['title'] = strip_tags($new_instance['title']);
|
826 |
+
$instance['type'] = strip_tags($new_instance['type']);
|
827 |
+
$instance['mode'] = strip_tags($new_instance['mode']);
|
828 |
+
$instance['limit'] = intval($new_instance['limit']);
|
829 |
+
$instance['chars'] = intval($new_instance['chars']);
|
830 |
+
$instance['cat_ids'] = strip_tags($new_instance['cat_ids']);
|
831 |
+
return $instance;
|
832 |
+
}
|
833 |
+
|
834 |
+
// DIsplay Widget Control Form
|
835 |
+
function form($instance) {
|
836 |
+
global $wpdb;
|
837 |
+
$instance = wp_parse_args((array) $instance, array('title' => __('Views', 'wp-postviews'), 'type' => 'most_viewed', 'mode' => 'both', 'limit' => 10, 'chars' => 200, 'cat_ids' => '0'));
|
838 |
+
$title = esc_attr($instance['title']);
|
839 |
+
$type = esc_attr($instance['type']);
|
840 |
+
$mode = esc_attr($instance['mode']);
|
841 |
+
$limit = intval($instance['limit']);
|
842 |
+
$chars = intval($instance['chars']);
|
843 |
+
$cat_ids = esc_attr($instance['cat_ids']);
|
844 |
+
?>
|
845 |
+
<p>
|
846 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'wp-postviews'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label>
|
847 |
+
</p>
|
848 |
+
<p>
|
849 |
+
<label for="<?php echo $this->get_field_id('type'); ?>"><?php _e('Statistics Type:', 'wp-postviews'); ?>
|
850 |
+
<select name="<?php echo $this->get_field_name('type'); ?>" id="<?php echo $this->get_field_id('type'); ?>" class="widefat">
|
851 |
+
<option value="least_viewed"<?php selected('least_viewed', $type); ?>><?php _e('Least Viewed', 'wp-postviews'); ?></option>
|
852 |
+
<option value="least_viewed_category"<?php selected('least_viewed_category', $type); ?>><?php _e('Least Viewed By Category', 'wp-postviews'); ?></option>
|
853 |
+
<optgroup> </optgroup>
|
854 |
+
<option value="most_viewed"<?php selected('most_viewed', $type); ?>><?php _e('Most Viewed', 'wp-postviews'); ?></option>
|
855 |
+
<option value="most_viewed_category"<?php selected('most_viewed_category', $type); ?>><?php _e('Most Viewed By Category', 'wp-postviews'); ?></option>
|
856 |
+
</select>
|
857 |
+
</label>
|
858 |
+
</p>
|
859 |
+
<p>
|
860 |
+
<label for="<?php echo $this->get_field_id('mode'); ?>"><?php _e('Include Views From:', 'wp-postviews'); ?>
|
861 |
+
<select name="<?php echo $this->get_field_name('mode'); ?>" id="<?php echo $this->get_field_id('mode'); ?>" class="widefat">
|
862 |
+
<option value="both"<?php selected('both', $mode); ?>><?php _e('Posts & Pages', 'wp-postviews'); ?></option>
|
863 |
+
<option value="post"<?php selected('post', $mode); ?>><?php _e('Posts Only', 'wp-postviews'); ?></option>
|
864 |
+
<option value="page"<?php selected('page', $mode); ?>><?php _e('Pages Only', 'wp-postviews'); ?></option>
|
865 |
+
</select>
|
866 |
+
</label>
|
867 |
+
</p>
|
868 |
+
<p>
|
869 |
+
<label for="<?php echo $this->get_field_id('limit'); ?>"><?php _e('No. Of Records To Show:', 'wp-postviews'); ?> <input class="widefat" id="<?php echo $this->get_field_id('limit'); ?>" name="<?php echo $this->get_field_name('limit'); ?>" type="text" value="<?php echo $limit; ?>" /></label>
|
870 |
+
</p>
|
871 |
+
<p>
|
872 |
+
<label for="<?php echo $this->get_field_id('chars'); ?>"><?php _e('Maximum Post Title Length (Characters):', 'wp-postviews'); ?> <input class="widefat" id="<?php echo $this->get_field_id('chars'); ?>" name="<?php echo $this->get_field_name('chars'); ?>" type="text" value="<?php echo $chars; ?>" /></label><br />
|
873 |
+
<small><?php _e('<strong>0</strong> to disable.', 'wp-postviews'); ?></small>
|
874 |
+
</p>
|
875 |
+
<p>
|
876 |
+
<label for="<?php echo $this->get_field_id('cat_ids'); ?>"><?php _e('Category IDs:', 'wp-postviews'); ?> <span style="color: red;">*</span> <input class="widefat" id="<?php echo $this->get_field_id('cat_ids'); ?>" name="<?php echo $this->get_field_name('cat_ids'); ?>" type="text" value="<?php echo $cat_ids; ?>" /></label><br />
|
877 |
+
<small><?php _e('Seperate mutiple categories with commas.', 'wp-postviews'); ?></small>
|
878 |
+
</p>
|
879 |
+
<p style="color: red;">
|
880 |
+
<small><?php _e('* If you are not using any category statistics, you can ignore it.', 'wp-postviews'); ?></small>
|
881 |
+
<p>
|
882 |
+
<input type="hidden" id="<?php echo $this->get_field_id('submit'); ?>" name="<?php echo $this->get_field_name('submit'); ?>" value="1" />
|
883 |
+
<?php
|
884 |
+
}
|
885 |
+
}
|
886 |
+
|
887 |
+
|
888 |
+
### Function: Init WP-PostViews Widget
|
889 |
+
add_action( 'widgets_init', 'widget_views_init' );
|
890 |
+
function widget_views_init() {
|
891 |
+
register_widget( 'WP_Widget_PostViews' );
|
892 |
+
}
|
893 |
+
|
894 |
+
|
895 |
+
### Function: Post Views Options
|
896 |
+
register_activation_hook( __FILE__, 'views_activation' );
|
897 |
+
function views_activation( $network_wide ) {
|
898 |
+
// Add Options
|
899 |
+
$option_name = 'views_options';
|
900 |
+
$option = array(
|
901 |
+
'count' => 1
|
902 |
+
, 'exclude_bots' => 0
|
903 |
+
, 'display_home' => 0
|
904 |
+
, 'display_single' => 0
|
905 |
+
, 'display_page' => 0
|
906 |
+
, 'display_archive' => 0
|
907 |
+
, 'display_search' => 0
|
908 |
+
, 'display_other' => 0
|
909 |
+
, 'template' => __('%VIEW_COUNT% views', 'wp-postviews')
|
910 |
+
, 'most_viewed_template' => '<li><a href="%POST_URL%" title="%POST_TITLE%">%POST_TITLE%</a> - %VIEW_COUNT% '.__('views', 'wp-postviews').'</li>'
|
911 |
+
);
|
912 |
+
|
913 |
+
if ( is_multisite() && $network_wide )
|
914 |
+
{
|
915 |
+
$ms_sites = wp_get_sites();
|
916 |
+
|
917 |
+
if( 0 < sizeof( $ms_sites ) )
|
918 |
+
{
|
919 |
+
foreach ( $ms_sites as $ms_site )
|
920 |
+
{
|
921 |
+
switch_to_blog( $ms_site['blog_id'] );
|
922 |
+
add_option( $option_name, $option );
|
923 |
+
}
|
924 |
+
}
|
925 |
+
|
926 |
+
restore_current_blog();
|
927 |
+
}
|
928 |
+
else
|
929 |
+
{
|
930 |
+
add_option( $option_name, $option );
|
931 |
+
}
|
932 |
+
}
|
933 |
?>
|
wp-postviews.pot
CHANGED
@@ -1,23 +1,18 @@
|
|
|
|
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: WP-PostViews 1.
|
4 |
-
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date:
|
6 |
-
"PO-Revision-Date: 2009-06-12 19:08+0800\n"
|
7 |
-
"Last-Translator: Lester Chan <lesterchan@gmail.com>\n"
|
8 |
-
"Language-Team: Lester Chan <lesterchan@gmail.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"
|
13 |
-
"
|
14 |
-
"
|
15 |
-
|
16 |
-
|
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 |
|
@@ -29,48 +24,41 @@ msgstr ""
|
|
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 |
-
|
64 |
-
|
|
|
65 |
msgstr ""
|
66 |
|
67 |
-
#: postviews-options.php:125
|
68 |
-
#: wp-postviews.php:784
|
69 |
msgid "%VIEW_COUNT% views"
|
70 |
msgstr ""
|
71 |
|
72 |
-
#: postviews-options.php:128
|
73 |
-
#: wp-postviews.php:785
|
74 |
msgid "views"
|
75 |
msgstr ""
|
76 |
|
@@ -98,8 +86,7 @@ msgstr ""
|
|
98 |
msgid "No"
|
99 |
msgstr ""
|
100 |
|
101 |
-
#: postviews-options.php:156
|
102 |
-
#: postviews-options.php:302
|
103 |
msgid "Yes"
|
104 |
msgstr ""
|
105 |
|
@@ -107,13 +94,11 @@ msgstr ""
|
|
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 |
|
@@ -126,28 +111,26 @@ msgid "Display Options"
|
|
126 |
msgstr ""
|
127 |
|
128 |
#: postviews-options.php:188
|
129 |
-
msgid "
|
|
|
|
|
|
|
|
|
130 |
msgstr ""
|
131 |
|
132 |
#: postviews-options.php:191
|
133 |
msgid "Home Page:"
|
134 |
msgstr ""
|
135 |
|
136 |
-
#: postviews-options.php:194
|
137 |
-
#: postviews-options.php:
|
138 |
-
#: postviews-options.php:
|
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:
|
147 |
-
#: postviews-options.php:
|
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 |
|
@@ -200,7 +183,10 @@ msgid "Save Changes"
|
|
200 |
msgstr ""
|
201 |
|
202 |
#: postviews-options.php:263
|
203 |
-
msgid "
|
|
|
|
|
|
|
204 |
msgstr ""
|
205 |
|
206 |
#: postviews-options.php:266
|
@@ -208,7 +194,9 @@ msgid "WARNING:"
|
|
208 |
msgstr ""
|
209 |
|
210 |
#: postviews-options.php:267
|
211 |
-
msgid "
|
|
|
|
|
212 |
msgstr ""
|
213 |
|
214 |
#: postviews-options.php:270
|
@@ -225,130 +213,135 @@ msgstr ""
|
|
225 |
|
226 |
#: postviews-options.php:303
|
227 |
msgid ""
|
228 |
-
"You Are About To Uninstall WP-PostViews From WordPress.\\
|
229 |
-
"
|
230 |
-
"\\n"
|
231 |
-
" Choose [Cancel] To Stop, [OK] To Uninstall."
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: wp-postviews.php:
|
235 |
msgid "PostViews"
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: wp-postviews.php:
|
239 |
-
#: wp-postviews.php:
|
240 |
-
#: wp-postviews.php:291
|
241 |
-
#: wp-postviews.php:339
|
242 |
-
#: wp-postviews.php:387
|
243 |
-
#: wp-postviews.php:435
|
244 |
msgid "N/A"
|
245 |
msgstr ""
|
246 |
|
247 |
-
#: wp-postviews.php:
|
248 |
msgid "There is no excerpt because this is a protected post."
|
249 |
msgstr ""
|
250 |
|
251 |
-
|
252 |
-
|
253 |
-
#: wp-postviews.php:
|
254 |
msgid "WP-PostViews"
|
255 |
msgstr ""
|
256 |
|
257 |
-
#: wp-postviews.php:
|
258 |
-
#: wp-postviews.php:598
|
259 |
-
#: wp-postviews.php:627
|
260 |
-
#, php-format
|
261 |
msgid "%s Most Viewed Post"
|
262 |
msgid_plural "%s Most Viewed Posts"
|
263 |
msgstr[0] ""
|
264 |
msgstr[1] ""
|
265 |
|
266 |
-
#: wp-postviews.php:
|
267 |
-
#: wp-postviews.php:603
|
268 |
-
#: wp-postviews.php:633
|
269 |
-
#, php-format
|
270 |
msgid "%s Most Viewed Page"
|
271 |
msgid_plural "%s Most Viewed Pages"
|
272 |
msgstr[0] ""
|
273 |
msgstr[1] ""
|
274 |
|
275 |
-
#: wp-postviews.php:
|
276 |
-
#, php-format
|
277 |
msgid "<strong>%s</strong> view was generated."
|
278 |
msgid_plural "<strong>%s</strong> views were generated."
|
279 |
msgstr[0] ""
|
280 |
msgstr[1] ""
|
281 |
|
282 |
-
#: wp-postviews.php:
|
283 |
msgid "WP-PostViews views statistics"
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: wp-postviews.php:
|
287 |
-
#: wp-postviews.php:712
|
288 |
msgid "Views"
|
289 |
msgstr ""
|
290 |
|
291 |
-
#: wp-postviews.php:
|
292 |
msgid "Title:"
|
293 |
msgstr ""
|
294 |
|
295 |
-
#: wp-postviews.php:
|
296 |
msgid "Statistics Type:"
|
297 |
msgstr ""
|
298 |
|
299 |
-
#: wp-postviews.php:
|
300 |
msgid "Least Viewed"
|
301 |
msgstr ""
|
302 |
|
303 |
-
#: wp-postviews.php:
|
304 |
msgid "Least Viewed By Category"
|
305 |
msgstr ""
|
306 |
|
307 |
-
#: wp-postviews.php:
|
308 |
msgid "Most Viewed"
|
309 |
msgstr ""
|
310 |
|
311 |
-
#: wp-postviews.php:
|
312 |
msgid "Most Viewed By Category"
|
313 |
msgstr ""
|
314 |
|
315 |
-
#: wp-postviews.php:
|
316 |
msgid "Include Views From:"
|
317 |
msgstr ""
|
318 |
|
319 |
-
#: wp-postviews.php:
|
320 |
msgid "Posts & Pages"
|
321 |
msgstr ""
|
322 |
|
323 |
-
#: wp-postviews.php:
|
324 |
msgid "Posts Only"
|
325 |
msgstr ""
|
326 |
|
327 |
-
#: wp-postviews.php:
|
328 |
msgid "Pages Only"
|
329 |
msgstr ""
|
330 |
|
331 |
-
#: wp-postviews.php:
|
332 |
msgid "No. Of Records To Show:"
|
333 |
msgstr ""
|
334 |
|
335 |
-
#: wp-postviews.php:
|
336 |
msgid "Maximum Post Title Length (Characters):"
|
337 |
msgstr ""
|
338 |
|
339 |
-
#: wp-postviews.php:
|
340 |
msgid "<strong>0</strong> to disable."
|
341 |
msgstr ""
|
342 |
|
343 |
-
#: wp-postviews.php:
|
344 |
msgid "Category IDs:"
|
345 |
msgstr ""
|
346 |
|
347 |
-
#: wp-postviews.php:
|
348 |
msgid "Seperate mutiple categories with commas."
|
349 |
msgstr ""
|
350 |
|
351 |
-
#: wp-postviews.php:
|
352 |
msgid "* If you are not using any category statistics, you can ignore it."
|
353 |
msgstr ""
|
354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (C) 2012 WP-PostViews
|
2 |
+
# This file is distributed under the same license as the WP-PostViews package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: WP-PostViews 1.61\n"
|
6 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-postviews\n"
|
7 |
+
"POT-Creation-Date: 2012-05-22 00:48:11+00:00\n"
|
|
|
|
|
|
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2012-MO-DA HO:MI+ZONE\n"
|
12 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
+
|
15 |
+
#: postviews-options.php:46 postviews-options.php:139
|
|
|
|
|
|
|
|
|
16 |
msgid "Post Views Options"
|
17 |
msgstr ""
|
18 |
|
24 |
msgid "No Post Views Option Updated"
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: postviews-options.php:63 postviews-options.php:303
|
|
|
28 |
msgid "UNINSTALL WP-PostViews"
|
29 |
msgstr ""
|
30 |
|
31 |
#: postviews-options.php:71
|
|
|
32 |
msgid "Setting Key '%s' has been deleted."
|
33 |
msgstr ""
|
34 |
|
35 |
#: postviews-options.php:75
|
|
|
36 |
msgid "Error deleting Setting Key '%s'."
|
37 |
msgstr ""
|
38 |
|
39 |
#: postviews-options.php:85
|
|
|
40 |
msgid "Post Meta Key '%s' has been deleted."
|
41 |
msgstr ""
|
42 |
|
43 |
#: postviews-options.php:89
|
|
|
44 |
msgid "Error deleting Post Meta Key '%s'."
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: postviews-options.php:111 postviews-options.php:261
|
|
|
48 |
msgid "Uninstall WP-PostViews"
|
49 |
msgstr ""
|
50 |
|
51 |
#: postviews-options.php:112
|
52 |
+
msgid ""
|
53 |
+
"<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-PostViews "
|
54 |
+
"Will Be Deactivated Automatically."
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: postviews-options.php:125 wp-postviews.php:797
|
|
|
58 |
msgid "%VIEW_COUNT% views"
|
59 |
msgstr ""
|
60 |
|
61 |
+
#: postviews-options.php:128 wp-postviews.php:798
|
|
|
62 |
msgid "views"
|
63 |
msgstr ""
|
64 |
|
86 |
msgid "No"
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: postviews-options.php:156 postviews-options.php:302
|
|
|
90 |
msgid "Yes"
|
91 |
msgstr ""
|
92 |
|
94 |
msgid "Views Template:"
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: postviews-options.php:163 postviews-options.php:174
|
|
|
98 |
msgid "Allowed Variables:"
|
99 |
msgstr ""
|
100 |
|
101 |
+
#: postviews-options.php:165 postviews-options.php:180
|
|
|
102 |
msgid "Restore Default Template"
|
103 |
msgstr ""
|
104 |
|
111 |
msgstr ""
|
112 |
|
113 |
#: postviews-options.php:188
|
114 |
+
msgid ""
|
115 |
+
"These options specify where the view counts should be displayed and to whom. "
|
116 |
+
"\tBy default view counts will be displayed to all visitors. Note that the "
|
117 |
+
"theme files must contain a call to <code>the_views()</code> in order for any "
|
118 |
+
"view count to be displayed."
|
119 |
msgstr ""
|
120 |
|
121 |
#: postviews-options.php:191
|
122 |
msgid "Home Page:"
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: postviews-options.php:194 postviews-options.php:204
|
126 |
+
#: postviews-options.php:214 postviews-options.php:224
|
127 |
+
#: postviews-options.php:234 postviews-options.php:244
|
|
|
|
|
|
|
128 |
msgid "Display to everyone"
|
129 |
msgstr ""
|
130 |
|
131 |
+
#: postviews-options.php:195 postviews-options.php:205
|
132 |
+
#: postviews-options.php:215 postviews-options.php:225
|
133 |
+
#: postviews-options.php:235 postviews-options.php:245
|
|
|
|
|
|
|
134 |
msgid "Display to registered users only"
|
135 |
msgstr ""
|
136 |
|
183 |
msgstr ""
|
184 |
|
185 |
#: postviews-options.php:263
|
186 |
+
msgid ""
|
187 |
+
"Deactivating WP-PostViews plugin does not remove any data that may have been "
|
188 |
+
"created, such as the views data. To completely remove this plugin, you can "
|
189 |
+
"uninstall it here."
|
190 |
msgstr ""
|
191 |
|
192 |
#: postviews-options.php:266
|
194 |
msgstr ""
|
195 |
|
196 |
#: postviews-options.php:267
|
197 |
+
msgid ""
|
198 |
+
"Once uninstalled, this cannot be undone. You should use a Database Backup "
|
199 |
+
"plugin of WordPress to back up all the data first."
|
200 |
msgstr ""
|
201 |
|
202 |
#: postviews-options.php:270
|
213 |
|
214 |
#: postviews-options.php:303
|
215 |
msgid ""
|
216 |
+
"You Are About To Uninstall WP-PostViews From WordPress.\\nThis Action Is Not "
|
217 |
+
"Reversible.\\n\\n Choose [Cancel] To Stop, [OK] To Uninstall."
|
|
|
|
|
218 |
msgstr ""
|
219 |
|
220 |
+
#: wp-postviews.php:42
|
221 |
msgid "PostViews"
|
222 |
msgstr ""
|
223 |
|
224 |
+
#: wp-postviews.php:191 wp-postviews.php:233 wp-postviews.php:280
|
225 |
+
#: wp-postviews.php:327 wp-postviews.php:374 wp-postviews.php:421
|
|
|
|
|
|
|
|
|
226 |
msgid "N/A"
|
227 |
msgstr ""
|
228 |
|
229 |
+
#: wp-postviews.php:472
|
230 |
msgid "There is no excerpt because this is a protected post."
|
231 |
msgstr ""
|
232 |
|
233 |
+
#. #-#-#-#-# plugin.pot (WP-PostViews 1.61) #-#-#-#-#
|
234 |
+
#. Plugin Name of the plugin/theme
|
235 |
+
#: wp-postviews.php:574 wp-postviews.php:576 wp-postviews.php:604
|
236 |
msgid "WP-PostViews"
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: wp-postviews.php:587 wp-postviews.php:589 wp-postviews.php:618
|
|
|
|
|
|
|
240 |
msgid "%s Most Viewed Post"
|
241 |
msgid_plural "%s Most Viewed Posts"
|
242 |
msgstr[0] ""
|
243 |
msgstr[1] ""
|
244 |
|
245 |
+
#: wp-postviews.php:592 wp-postviews.php:594 wp-postviews.php:624
|
|
|
|
|
|
|
246 |
msgid "%s Most Viewed Page"
|
247 |
msgid_plural "%s Most Viewed Pages"
|
248 |
msgstr[0] ""
|
249 |
msgstr[1] ""
|
250 |
|
251 |
+
#: wp-postviews.php:606
|
|
|
252 |
msgid "<strong>%s</strong> view was generated."
|
253 |
msgid_plural "<strong>%s</strong> views were generated."
|
254 |
msgstr[0] ""
|
255 |
msgstr[1] ""
|
256 |
|
257 |
+
#: wp-postviews.php:674
|
258 |
msgid "WP-PostViews views statistics"
|
259 |
msgstr ""
|
260 |
|
261 |
+
#: wp-postviews.php:675 wp-postviews.php:725
|
|
|
262 |
msgid "Views"
|
263 |
msgstr ""
|
264 |
|
265 |
+
#: wp-postviews.php:734
|
266 |
msgid "Title:"
|
267 |
msgstr ""
|
268 |
|
269 |
+
#: wp-postviews.php:737
|
270 |
msgid "Statistics Type:"
|
271 |
msgstr ""
|
272 |
|
273 |
+
#: wp-postviews.php:739
|
274 |
msgid "Least Viewed"
|
275 |
msgstr ""
|
276 |
|
277 |
+
#: wp-postviews.php:740
|
278 |
msgid "Least Viewed By Category"
|
279 |
msgstr ""
|
280 |
|
281 |
+
#: wp-postviews.php:742
|
282 |
msgid "Most Viewed"
|
283 |
msgstr ""
|
284 |
|
285 |
+
#: wp-postviews.php:743
|
286 |
msgid "Most Viewed By Category"
|
287 |
msgstr ""
|
288 |
|
289 |
+
#: wp-postviews.php:748
|
290 |
msgid "Include Views From:"
|
291 |
msgstr ""
|
292 |
|
293 |
+
#: wp-postviews.php:750
|
294 |
msgid "Posts & Pages"
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: wp-postviews.php:751
|
298 |
msgid "Posts Only"
|
299 |
msgstr ""
|
300 |
|
301 |
+
#: wp-postviews.php:752
|
302 |
msgid "Pages Only"
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: wp-postviews.php:757
|
306 |
msgid "No. Of Records To Show:"
|
307 |
msgstr ""
|
308 |
|
309 |
+
#: wp-postviews.php:760
|
310 |
msgid "Maximum Post Title Length (Characters):"
|
311 |
msgstr ""
|
312 |
|
313 |
+
#: wp-postviews.php:761
|
314 |
msgid "<strong>0</strong> to disable."
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: wp-postviews.php:764
|
318 |
msgid "Category IDs:"
|
319 |
msgstr ""
|
320 |
|
321 |
+
#: wp-postviews.php:765
|
322 |
msgid "Seperate mutiple categories with commas."
|
323 |
msgstr ""
|
324 |
|
325 |
+
#: wp-postviews.php:768
|
326 |
msgid "* If you are not using any category statistics, you can ignore it."
|
327 |
msgstr ""
|
328 |
|
329 |
+
#. Plugin URI of the plugin/theme
|
330 |
+
msgid "http://lesterchan.net/portfolio/programming/php/"
|
331 |
+
msgstr ""
|
332 |
+
|
333 |
+
#. Description of the plugin/theme
|
334 |
+
msgid ""
|
335 |
+
"Enables you to display how many times a post/page had been viewed. Modified "
|
336 |
+
"by <a href=\"http://DPotter.net/Technical/\" title=\"David's Technical "
|
337 |
+
"Musings\">David Potter</a> to include options for when and where to display "
|
338 |
+
"view counts."
|
339 |
+
msgstr ""
|
340 |
+
|
341 |
+
#. Author of the plugin/theme
|
342 |
+
msgid "Lester 'GaMerZ' Chan"
|
343 |
+
msgstr ""
|
344 |
+
|
345 |
+
#. Author URI of the plugin/theme
|
346 |
+
msgid "http://lesterchan.net"
|
347 |
+
msgstr ""
|