PluginProbe ʕ •ᴥ•ʔ
WP Popular Posts / 2.3.7
WP Popular Posts v2.3.7
4.0.8 4.0.9 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 5.0.0 5.0.1 5.0.2 5.1.0 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.3.0 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.4.0 5.4.1 5.4.2 5.5.0 5.5.1 6.0.0 6.0.1 6.0.2 6.0.3 6.0.4 6.0.5 6.1.0 6.1.1 6.1.2 6.1.3 6.1.4 6.2.0 6.2.1 6.3.0 6.3.1 6.3.2 6.3.3 6.3.4 6.4.0 6.4.1 6.4.2 7.0.0 7.0.1 7.1.0 7.2.0 7.3.0 7.3.1 7.3.2 7.3.3 7.3.4 7.3.5 7.3.6 7.3.7 7.3.8 7.4.0 trunk 2.3.7 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.2 4.0.3 4.0.5 4.0.6
wordpress-popular-posts / admin.php
wordpress-popular-posts Last commit date
js 13 years ago lang 12 years ago style 13 years ago admin.php 12 years ago btn_donateCC_LG_global.gif 16 years ago index.php 16 years ago no_thumb.jpg 15 years ago readme.md 12 years ago readme.txt 12 years ago wordpress-popular-posts.php 12 years ago
admin.php
993 lines
1 <?php
2 if (basename($_SERVER['SCRIPT_NAME']) == basename(__FILE__)) exit('Please do not load this page directly');
3
4 /**
5 * Merges two associative arrays recursively
6 * array_merge_recursive_distinct(array('key' => 'org value'), array('key' => 'new value'));
7 * => array('key' => array('new value'));
8 * Source: http://www.php.net/manual/en/function.array-merge-recursive.php#92195
9 * Since 2.3.4
10 */
11 function array_merge_recursive_distinct( array &$array1, array &$array2 ) {
12 $merged = $array1;
13
14 foreach ( $array2 as $key => &$value ) {
15 if ( is_array( $value ) && isset ( $merged[$key] ) && is_array( $merged[$key] ) ) {
16 $merged[$key] = array_merge_recursive_distinct ( $merged[$key], $value );
17 } else {
18 $merged[$key] = $value;
19 }
20 }
21
22 return $merged;
23 }
24
25 $wpp_settings_def = array(
26 'stats' => array(
27 'order_by' => 'views',
28 'limit' => 10,
29 'post_type' => 'post,page'
30 ),
31 'tools' => array(
32 'ajax' => false,
33 'css' => true,
34 'stylesheet' => true,
35 'link' => array(
36 'target' => '_self'
37 ),
38 'thumbnail' => array(
39 'source' => 'featured',
40 'field' => '_wpp_thumbnail',
41 'resize' => false,
42 'default' => ''
43 ),
44 'log_loggedin' => false,
45 'cache' => array(
46 'active' => false,
47 'interval' => array(
48 'time' => 'hour',
49 'value' => 1
50 )
51 )
52 )
53 );
54
55 $ops = get_option('wpp_settings_config');
56 if ( !$ops ) {
57 add_option('wpp_settings_config', $wpp_settings_def);
58 $ops = $wpp_settings_def;
59 } else {
60 $ops = array_merge_recursive_distinct( $wpp_settings_def, $ops );
61 }
62
63 if ( isset($_POST['section']) ) {
64 if ($_POST['section'] == "stats") {
65 $ops['stats']['order_by'] = $_POST['stats_order'];
66 $ops['stats']['limit'] = (is_numeric($_POST['stats_limit']) && $_POST['stats_limit'] > 0) ? $_POST['stats_limit'] : 10;
67 $ops['stats']['post_type'] = empty($_POST['stats_type']) ? "post,page" : $_POST['stats_type'];
68
69 update_option('wpp_settings_config', $ops);
70 echo "<div class=\"updated\"><p><strong>" . __('Settings saved.', 'wordpress-popular-posts' ) . "</strong></p></div>";
71
72 } else if ($_POST['section'] == "linking") {
73
74 $ops['tools']['link']['target'] = $_POST['link_target'];
75 update_option('wpp_settings_config', $ops);
76 echo "<div class=\"updated\"><p><strong>" . __('Settings saved.', 'wordpress-popular-posts' ) . "</strong></p></div>";
77
78 }else if ($_POST['section'] == "logging") {
79
80 $ops['tools']['log_loggedin'] = $_POST['log_option'];
81 update_option('wpp_settings_config', $ops);
82 echo "<div class=\"updated\"><p><strong>" . __('Settings saved.', 'wordpress-popular-posts' ) . "</strong></p></div>";
83
84 } else if ($_POST['section'] == "tools") {
85
86 if ($_POST['thumb_source'] == "custom_field" && (!isset($_POST['thumb_field']) || empty($_POST['thumb_field']))) {
87 echo '<div id="wpp-message" class="error fade"><p>'.__('Please provide the name of your custom field.', 'wordpress-popular-posts').'</p></div>';
88 } else {
89 $ops['tools']['thumbnail']['source'] = $_POST['thumb_source'];
90 $ops['tools']['thumbnail']['field'] = ( !empty( $_POST['thumb_field']) ) ? $_POST['thumb_field'] : "_wpp_thumbnail";
91 $ops['tools']['thumbnail']['default'] = ( !empty( $_POST['upload_thumb_src']) ) ? $_POST['upload_thumb_src'] : "";
92 $ops['tools']['thumbnail']['resize'] = $_POST['thumb_field_resize'];
93
94 update_option('wpp_settings_config', $ops);
95 echo "<div class=\"updated\"><p><strong>" . __('Settings saved.', 'wordpress-popular-posts' ) . "</strong></p></div>";
96 }
97 } else if ($_POST['section'] == "ajax") {
98
99 $ops['tools']['ajax'] = $_POST['ajax'];
100
101 $ops['tools']['cache']['active'] = $_POST['cache'];
102 $ops['tools']['cache']['interval']['time'] = $_POST['cache_interval_time'];
103 $ops['tools']['cache']['interval']['value'] = $_POST['cache_interval_value'];
104
105 update_option('wpp_settings_config', $ops);
106 echo "<div class=\"updated\"><p><strong>" . __('Settings saved.', 'wordpress-popular-posts' ) . "</strong></p></div>";
107
108 } else if ($_POST['section'] == "css") {
109 $ops['tools']['css'] = $_POST['css'];
110
111 //print_r($ops);
112
113 update_option('wpp_settings_config', $ops);
114 echo "<div class=\"updated\"><p><strong>" . __('Settings saved.', 'wordpress-popular-posts' ) . "</strong></p></div>";
115 }
116 }
117
118 $rand = md5(uniqid(rand(), true));
119 $wpp_rand = get_option("wpp_rand");
120 if (empty($wpp_rand)) {
121 add_option("wpp_rand", $rand);
122 } else {
123 update_option("wpp_rand", $rand);
124 }
125
126 ?>
127
128
129 <style>
130 #wmpp-title {
131 color:#666;
132 font-family:Georgia, "Times New Roman", Times, serif;
133 font-weight:100;
134 font-size:24px;
135 font-style:italic;
136 }
137
138 .wmpp-subtitle {
139 margin:8px 0 15px 0;
140 color:#666;
141 font-family:Georgia, "Times New Roman", Times, serif;
142 font-size:16px;
143 font-weight:100;
144 }
145
146 .wpp_boxes {
147 display:none;
148 overflow:hidden;
149 width:100%;
150 }
151
152 #wpp-options {
153 width:100%;
154 }
155
156 #wpp-options fieldset {
157 margin:0 0 15px 0;
158 width:99%;
159 }
160
161 #wpp-options fieldset legend { font-weight:bold; }
162
163 #wpp-options fieldset .lbl_wpp_stats {
164 display:block;
165 margin:0 0 8px 0;
166 }
167
168 #wpp-stats-tabs {
169 padding:2px 0;
170 }
171
172 #wpp-stats-canvas {
173 overflow:hidden;
174 padding:2px 0;
175 width:100%;
176 }
177
178 .wpp-stats {
179 display:none;
180 width:96%px;
181 padding:1% 0;
182 font-size:8px;
183 background:#fff;
184 border:#999 3px solid;
185 }
186
187 .wpp-stats-active {
188 display:block;
189 }
190
191 .wpp-stats ol {
192 margin:0;
193 padding:0;
194 }
195
196 .wpp-stats ol li {
197 overflow:hidden;
198 margin:0 8px 10px 8px!important;
199 padding:0 0 2px 0!important;
200 font-size:12px;
201 line-height:12px;
202 color:#999;
203 border-bottom:#eee 1px solid;
204 }
205
206 .wpp-post-title {
207 /*display:block;*/
208 display:inline;
209 float:left;
210 font-weight:bold;
211 }
212
213 .post-stats {
214 display:inline;
215 float:right;
216 font-size:0.9em!important;
217 text-align:right;
218 color:#999;
219 }
220
221 .wpp-stats-unique-item, .wpp-stats-last-item {
222 margin:0!important;
223 padding:0!important;
224 border:none!important;
225 }
226 /**/
227 .wpp-stats p {
228 margin:0;
229 padding:0 8px;
230 font-size:12px;
231 }
232
233 .wp-list-table h4 {
234 margin:0 0 0 0;
235 }
236
237 .wpp-ans {
238 display:none;
239 width:100%;
240 }
241
242 .wpp-ans p {
243 margin:0 0 0 0;
244 padding:0;
245 }
246
247 </style>
248
249 <script type="text/javascript">
250 jQuery(document).ready(function(){
251
252 // TABS
253 jQuery(".subsubsub li a").click(function(e){
254 var tab = jQuery(this);
255 tab.addClass("current").parent().siblings().children("a").removeClass("current");
256
257 jQuery(".wpp_boxes:visible").hide();
258 jQuery("#" + tab.attr("rel")).fadeIn();
259
260 e.preventDefault();
261 });
262
263 // STATISTICS TABS
264 jQuery("#wpp-stats-tabs a").click(function(e){
265 var activeTab = jQuery(this).attr("rel");
266 jQuery(this).removeClass("button-secondary").addClass("button-primary").siblings().removeClass("button-primary").addClass("button-secondary");
267 jQuery(".wpp-stats:visible").fadeOut("fast", function(){
268 jQuery("#"+activeTab).slideDown("fast");
269 });
270
271 e.preventDefault();
272 });
273
274 jQuery(".wpp-stats").each(function(){
275 if (jQuery("li", this).length == 1) {
276 jQuery("li", this).addClass("wpp-stats-last-item");
277 } else {
278 jQuery("li:last", this).addClass("wpp-stats-last-item");
279 }
280 });
281
282 // FAQ
283 jQuery(".wp-list-table a").click(function(e){
284 var ans = jQuery(this).attr("rel");
285
286 jQuery(".wpp-ans:visible").hide();
287 //jQuery("#"+ans).slideToggle();
288 jQuery("#"+ans).show();
289
290 e.preventDefault();
291 });
292
293 // TOOLS
294 // thumb source selection
295 jQuery("#thumb_source").change(function() {
296 if (jQuery(this).val() == "custom_field") {
297 jQuery("#lbl_field, #thumb_field, #row_custom_field, #row_custom_field_resize").show();
298 } else {
299 jQuery("#lbl_field, #thumb_field, #row_custom_field, #row_custom_field_resize").hide();
300 }
301 });
302 // cache interval
303 jQuery("#cache").change(function() {
304 if (jQuery(this).val() == 1) {
305 jQuery("#cache_refresh_interval").show();
306 } else {
307 jQuery("#cache_refresh_interval, #cache_too_long").hide();
308 }
309 });
310 // interval
311 jQuery("#cache_interval_time").change(function() {
312 var value = parseInt( jQuery("#cache_interval_value").val() );
313 var time = jQuery(this).val();
314
315 console.log(time + " " + value);
316
317 if ( time == "hour" && value > 72 ) {
318 jQuery("#cache_too_long").show();
319 } else if ( time == "day" && value > 3 ) {
320 jQuery("#cache_too_long").show();
321 } else if ( time == "week" && value > 1 ) {
322 jQuery("#cache_too_long").show();
323 } else if ( time == "month" && value >= 1 ) {
324 jQuery("#cache_too_long").show();
325 } else if ( time == "year" && value >= 1 ) {
326 jQuery("#cache_too_long").show();
327 } else {
328 jQuery("#cache_too_long").hide();
329 }
330 });
331
332 jQuery("#cache_interval_value").change(function() {
333 var value = parseInt( jQuery(this).val() );
334 var time = jQuery("#cache_interval_time").val();
335
336 if ( time == "hour" && value > 72 ) {
337 jQuery("#cache_too_long").show();
338 } else if ( time == "day" && value > 3 ) {
339 jQuery("#cache_too_long").show();
340 } else if ( time == "week" && value > 1 ) {
341 jQuery("#cache_too_long").show();
342 } else if ( time == "month" && value >= 1 ) {
343 jQuery("#cache_too_long").show();
344 } else if ( time == "year" && value >= 1 ) {
345 jQuery("#cache_too_long").show();
346 } else {
347 jQuery("#cache_too_long").hide();
348 }
349 });
350
351 });
352
353 // TOOLS
354 function confirm_reset_cache() {
355 if (confirm("<?php _e("This operation will delete all entries from Wordpress Popular Posts' cache table and cannot be undone.", "wordpress-popular-posts"); ?> \n" + "<?php _e("Do you want to continue?", "wordpress-popular-posts"); ?>")) {
356 jQuery.post(ajaxurl, {action: 'wpp_clear_cache', token: '<?php echo get_option("wpp_rand"); ?>', clear: 'cache'}, function(data){
357 alert(data);
358 });
359 }
360 }
361
362 function confirm_reset_all() {
363 if (confirm("<?php _e("This operation will delete all stored info from Wordpress Popular Posts' data tables and cannot be undone.", "wordpress-popular-posts"); ?> \n" + "<?php _e("Do you want to continue?", "wordpress-popular-posts"); ?>")) {
364 jQuery.post(ajaxurl, {action: 'wpp_clear_all', token: '<?php echo get_option("wpp_rand"); ?>', clear: 'all'}, function(data){
365 alert(data);
366 });
367 }
368 }
369
370 </script>
371
372 <div class="wrap">
373 <div id="icon-options-general" class="icon32"><br /></div>
374 <h2 id="wmpp-title">Wordpress Popular Posts</h2>
375
376 <ul class="subsubsub">
377 <li id="btn_stats"><a href="#" <?php if (!isset($_POST['section']) || (isset($_POST['section']) && $_POST['section'] == "stats") ) {?>class="current"<?php } ?> rel="wpp_stats"><?php _e("Stats", "wordpress-popular-posts"); ?></a> |</li>
378 <li id="btn_faq"><a href="#" rel="wpp_faq"><?php _e("FAQ", "wordpress-popular-posts"); ?></a> |</li>
379 <li id="btn_tools"><a href="#" rel="wpp_tools"<?php if (isset($_POST['section']) && ($_POST['section'] == "logging" || $_POST['section'] == "tools" || $_POST['section'] == "ajax" || $_POST['section'] == "css") ) {?> class="current"<?php } ?>><?php _e("Tools", "wordpress-popular-posts"); ?></a></li>
380 </ul>
381 <!-- Start stats -->
382 <div id="wpp_stats" class="wpp_boxes"<?php if (!isset($_POST['section']) || (isset($_POST['section']) && $_POST['section'] == "stats") ) {?> style="display:block;"<?php } ?>>
383 <p><?php _e("Click on each tab to see what are the most popular entries on your blog in the last 24 hours, this week, last 30 days or all time since Wordpress Popular Posts was installed.", "wordpress-popular-posts"); ?></p>
384
385 <div class="tablenav top">
386 <div class="alignleft actions">
387 <form action="" method="post" id="wpp_stats_options" name="wpp_stats_options">
388 <select name="stats_order">
389 <option <?php if ($ops['stats']['order_by'] == "comments") {?>selected="selected"<?php } ?> value="comments"><?php _e("Order by comments", "wordpress-popular-posts"); ?></option>
390 <option <?php if ($ops['stats']['order_by'] == "views") {?>selected="selected"<?php } ?> value="views"><?php _e("Order by views", "wordpress-popular-posts"); ?></option>
391 <option <?php if ($ops['stats']['order_by'] == "avg") {?>selected="selected"<?php } ?> value="avg"><?php _e("Order by avg. daily views", "wordpress-popular-posts"); ?></option>
392 </select>
393 <label for="stats_type"><?php _e("Post type", "wordpress-popular-posts"); ?>:</label> <input type="text" name="stats_type" value="<?php echo $ops['stats']['post_type']; ?>" size="15" />
394 <label for="stats_limits"><?php _e("Limit", "wordpress-popular-posts"); ?>:</label> <input type="text" name="stats_limit" value="<?php echo $ops['stats']['limit']; ?>" size="5" />
395 <input type="hidden" name="section" value="stats" />
396 <input type="submit" class="button-secondary action" value="<?php _e("Apply", "wordpress-popular-posts"); ?>" name="" />
397 </form>
398 </div>
399 </div>
400 <br />
401 <div id="wpp-stats-tabs">
402 <a href="#" class="button-primary" rel="wpp-daily"><?php _e("Last 24 hours", "wordpress-popular-posts"); ?></a>
403 <a href="#" class="button-secondary" rel="wpp-weekly"><?php _e("Last 7 days", "wordpress-popular-posts"); ?></a>
404 <a href="#" class="button-secondary" rel="wpp-monthly"><?php _e("Last 30 days", "wordpress-popular-posts"); ?></a>
405 <a href="#" class="button-secondary" rel="wpp-all"><?php _e("All-time", "wordpress-popular-posts"); ?></a>
406 </div>
407 <div id="wpp-stats-canvas">
408 <div class="wpp-stats wpp-stats-active" id="wpp-daily">
409 <?php echo do_shortcode("[wpp range='daily' post_type='".$ops['stats']['post_type']."' stats_comments=1 stats_views=1 order_by='".$ops['stats']['order_by']."' wpp_start='<ol>' wpp_end='</ol>' post_html='<li>{title} <span class=\"post-stats\">{stats}</span></li>' limit=".$ops['stats']['limit']."]"); ?>
410 </div>
411 <div class="wpp-stats" id="wpp-weekly">
412 <?php echo do_shortcode("[wpp range='weekly' post_type='".$ops['stats']['post_type']."' stats_comments=1 stats_views=1 order_by='".$ops['stats']['order_by']."' wpp_start='<ol>' wpp_end='</ol>' post_html='<li>{title} <span class=\"post-stats\">{stats}</span></li>' limit=".$ops['stats']['limit']."]"); ?>
413 </div>
414 <div class="wpp-stats" id="wpp-monthly">
415 <?php echo do_shortcode("[wpp range='monthly' post_type='".$ops['stats']['post_type']."' stats_comments=1 stats_views=1 order_by='".$ops['stats']['order_by']."' wpp_start='<ol>' wpp_end='</ol>' post_html='<li>{title} <span class=\"post-stats\">{stats}</span></li>' limit=".$ops['stats']['limit']."]"); ?>
416 </div>
417 <div class="wpp-stats" id="wpp-all">
418 <?php echo do_shortcode("[wpp range='all' post_type='".$ops['stats']['post_type']."' stats_views=1 order_by='".$ops['stats']['order_by']."' wpp_start='<ol>' wpp_end='</ol>' post_html='<li>{title} <span class=\"post-stats\">{stats}</span></li>' limit=".$ops['stats']['limit']."]"); ?>
419 </div>
420 </div>
421 </div>
422 <!-- End stats -->
423
424 <!-- Start faq -->
425 <div id="wpp_faq" class="wpp_boxes">
426 <h3 class="wmpp-subtitle"><?php _e("Frequently Asked Questions", "wordpress-popular-posts"); ?></h3>
427 <table cellspacing="0" class="wp-list-table widefat fixed posts">
428 <tr>
429 <td valign="top"><!-- help area -->
430 <h4>&raquo; <a href="#" rel="q-1"><?php _e('What does "Title" do?', 'wordpress-popular-posts'); ?></a></h4>
431 <div class="wpp-ans" id="q-1">
432 <p><?php _e('It allows you to show a heading for your most popular posts listing. If left empty, no heading will be displayed at all.', 'wordpress-popular-posts'); ?></p>
433 </div>
434
435 <h4>&raquo; <a href="#" rel="q-2"><?php _e('What is Time Range for?', 'wordpress-popular-posts'); ?></a></h4>
436 <div class="wpp-ans" id="q-2">
437 <p><?php _e('It will tell Wordpress Popular Posts to retrieve all posts with most views / comments within the selected time range.', 'wordpress-popular-posts'); ?></p>
438 </div>
439
440 <h4>&raquo; <a href="#" rel="q-3"><?php _e('What is "Sort post by" for?', 'wordpress-popular-posts'); ?></a></h4>
441 <div class="wpp-ans" id="q-3">
442 <p><?php _e('It allows you to decide whether to order your popular posts listing by total views, comments, or average views per day.', 'wordpress-popular-posts'); ?></p>
443 </div>
444
445 <h4>&raquo; <a href="#" rel="q-4"><?php _e('What does "Display post rating" do?', 'wordpress-popular-posts'); ?></a></h4>
446 <div class="wpp-ans" id="q-4">
447 <p><?php _e('If checked, Wordpress Popular Posts will show how your readers are rating your most popular posts. This feature requires having WP-PostRatings plugin installed and enabled on your blog for it to work.', 'wordpress-popular-posts'); ?></p>
448 </div>
449
450 <h4>&raquo; <a href="#" rel="q-5"><?php _e('What does "Shorten title" do?', 'wordpress-popular-posts'); ?></a></h4>
451 <div class="wpp-ans" id="q-5">
452 <p><?php _e('If checked, all posts titles will be shortened to "n" characters/words. A new "Shorten title to" option will appear so you can set it to whatever you like.', 'wordpress-popular-posts'); ?></p>
453 </div>
454
455 <h4>&raquo; <a href="#" rel="q-6"><?php _e('What does "Display post excerpt" do?', 'wordpress-popular-posts'); ?></a></h4>
456 <div class="wpp-ans" id="q-6">
457 <p><?php _e('If checked, Wordpress Popular Posts will also include a small extract of your posts in the list. Similarly to the previous option, you will be able to decide how long the post excerpt should be.', 'wordpress-popular-posts'); ?></p>
458 </div>
459
460 <h4>&raquo; <a href="#" rel="q-7"><?php _e('What does "Keep text format and links" do?', 'wordpress-popular-posts'); ?></a></h4>
461 <div class="wpp-ans" id="q-7">
462 <p><?php _e('If checked, and if the Post Excerpt feature is enabled, Wordpress Popular Posts will keep the styling tags (eg. bold, italic, etc) that were found in the excerpt. Hyperlinks will remain intact, too.', 'wordpress-popular-posts'); ?></p>
463 </div>
464
465 <h4>&raquo; <a href="#" rel="q-8"><?php _e('What is "Post type" for?', 'wordpress-popular-posts'); ?></a></h4>
466 <div class="wpp-ans" id="q-8">
467 <p><?php _e('This filter allows you to decide which post types to show on the listing. By default, it will retrieve only posts and pages (which should be fine for most cases).', 'wordpress-popular-posts'); ?></p>
468 </div>
469
470 <h4>&raquo; <a href="#" rel="q-9"><?php _e('What is "Category(ies) ID(s)" for?', 'wordpress-popular-posts'); ?></a></h4>
471 <div class="wpp-ans" id="q-9">
472 <p><?php _e('This filter allows you to select which categories should be included or excluded from the listing. A negative sign in front of the category ID number will exclude posts belonging to it from the list, for example. You can specify more than one ID with a comma separated list.', 'wordpress-popular-posts'); ?></p>
473 </div>
474
475 <h4>&raquo; <a href="#" rel="q-10"><?php _e('What is "Author(s) ID(s)" for?', 'wordpress-popular-posts'); ?></a></h4>
476 <div class="wpp-ans" id="q-10">
477 <p><?php _e('Just like the Category filter, this one lets you filter posts by author ID. You can specify more than one ID with a comma separated list.', 'wordpress-popular-posts'); ?></p>
478 </div>
479
480 <h4>&raquo; <a href="#" rel="q-11"><?php _e('What does "Display post thumbnail" do?', 'wordpress-popular-posts'); ?></a></h4>
481 <div class="wpp-ans" id="q-11">
482 <p><?php _e('If checked, Wordpress Popular Posts will attempt to retrieve the thumbnail of each post. You can set up the source of the thumbnail via Settings - Wordpress Popular Posts - Tools.', 'wordpress-popular-posts'); ?></p>
483 </div>
484
485 <h4>&raquo; <a href="#" rel="q-12"><?php _e('What does "Display comment count" do?', 'wordpress-popular-posts'); ?></a></h4>
486 <div class="wpp-ans" id="q-12">
487 <p><?php _e('If checked, Wordpress Popular Posts will display how many comments each popular post has got in the selected Time Range.', 'wordpress-popular-posts'); ?></p>
488 </div>
489
490 <h4>&raquo; <a href="#" rel="q-13"><?php _e('What does "Display views" do?', 'wordpress-popular-posts'); ?></a></h4>
491 <div class="wpp-ans" id="q-13">
492 <p><?php _e('If checked, Wordpress Popular Posts will show how many pageviews a single post has gotten in the selected Time Range.', 'wordpress-popular-posts'); ?></p>
493 </div>
494
495 <h4>&raquo; <a href="#" rel="q-14"><?php _e('What does "Display author" do?', 'wordpress-popular-posts'); ?></a></h4>
496 <div class="wpp-ans" id="q-14">
497 <p><?php _e('If checked, Wordpress Popular Posts will display the name of the author of each entry listed.', 'wordpress-popular-posts'); ?></p>
498 </div>
499
500 <h4>&raquo; <a href="#" rel="q-15"><?php _e('What does "Display date" do?', 'wordpress-popular-posts'); ?></a></h4>
501 <div class="wpp-ans" id="q-15">
502 <p><?php _e('If checked, Wordpress Popular Posts will display the date when each popular posts was published.', 'wordpress-popular-posts'); ?></p>
503 </div>
504
505 <h4>&raquo; <a href="#" rel="q-16"><?php _e('What does "Use custom HTML Markup" do?', 'wordpress-popular-posts'); ?></a></h4>
506 <div class="wpp-ans" id="q-16">
507 <p><?php _e('If checked, you will be able to customize the HTML markup of your popular posts listing. For example, you can decide whether to wrap your posts in an unordered list, an ordered list, a div, etc. If you know xHTML/CSS, this is for you!', 'wordpress-popular-posts'); ?></p>
508 </div>
509
510 <h4>&raquo; <a href="#" rel="q-17"><?php _e('What are "Content Tags"?', 'wordpress-popular-posts'); ?></a></h4>
511 <div class="wpp-ans" id="q-17">
512 <p><?php _e('Content Tags are codes to display a variety of items on your popular posts custom HTML structure. For example, setting it to "{title}: {summary}" (without the quotes) would display "Post title: excerpt of the post here". For more Content Tags, see "List of parameters accepted by wpp_get_mostpopular() and the [wpp] shortcode".', 'wordpress-popular-posts'); ?></p>
513 </div>
514
515 <h4>&raquo; <a href="#" rel="q-18"><?php _e('What are "Template Tags"?', 'wordpress-popular-posts'); ?></a></h4>
516 <div class="wpp-ans" id="q-18">
517 <p><?php _e('Template Tags are simply php functions that allow you to perform certain actions. For example, Wordpress Popular Posts currently supports two different template tags: wpp_get_mostpopular() and wpp_get_views().', 'wordpress-popular-posts'); ?></p>
518 </div>
519
520 <h4>&raquo; <a href="#" rel="q-19"><?php _e('What are the template tags that Wordpress Popular Posts supports?', 'wordpress-popular-posts'); ?></a></h4>
521 <div class="wpp-ans" id="q-19">
522 <p><?php _e('The following are the template tags supported by Wordpress Popular Posts', 'wordpress-popular-posts'); ?>:</p>
523 <table cellspacing="0" class="wp-list-table widefat fixed posts">
524 <thead>
525 <tr>
526 <th class="manage-column column-title"><?php _e('Template tag', 'wordpress-popular-posts'); ?></th>
527 <th class="manage-column column-title"><?php _e('What it does ', 'wordpress-popular-posts'); ?></th>
528 <th class="manage-column column-title"><?php _e('Parameters', 'wordpress-popular-posts'); ?></th>
529 <th class="manage-column column-title"><?php _e('Example', 'wordpress-popular-posts'); ?></th>
530 </tr>
531 </thead>
532 <tbody>
533 <tr>
534 <td class="post type-post status-draft format-standard hentry category-js alternate iedit"><strong>wpp_get_mostpopular()</strong></td>
535 <td class="post type-post status-draft format-standard hentry category-js iedit"><?php _e('Similar to the widget functionality, this tag retrieves the most popular posts on your blog. This function also accepts parameters so you can customize your popular listing, but these are not required.', 'wordpress-popular-posts'); ?></td>
536 <td class="post type-post status-draft format-standard hentry category-js alternate iedit"><?php _e('Please refer to "List of parameters accepted by wpp_get_mostpopular() and the [wpp] shortcode".', 'wordpress-popular-posts'); ?></td>
537 <td class="post type-post status-draft format-standard hentry category-js iedit">&lt;?php wpp_get_mostpopular(); ?&gt;<br />&lt;?php wpp_get_mostpopular("range=weekly&amp;limit=7"); ?&gt;</td>
538 </tr>
539 <tr>
540 <td><strong>wpp_get_views()</strong></td>
541 <td><?php _e('Displays the number of views of a single post. Post ID is required or it will return false.', 'wordpress-popular-posts'); ?></td>
542 <td><?php _e('Post ID', 'wordpress-popular-posts'); ?>, range ("daily", "weekly", "monthly", "all")</td>
543 <td>&lt;?php echo wpp_get_views($post->ID); ?&gt;<br />&lt;?php echo wpp_get_views(15, 'weekly'); ?&gt;</td>
544 </tr>
545 </tbody>
546 </table>
547 </div>
548
549 <h4>&raquo; <a href="#" rel="q-20"><?php _e('What are "shortcodes"?', 'wordpress-popular-posts'); ?></a></h4>
550 <div class="wpp-ans" id="q-20">
551 <p><?php _e('Shortcodes are similar to BB Codes, these allow us to call a php function by simply typing something like [shortcode]. With Wordpress Popular Posts, the shortcode [wpp] will let you insert a list of the most popular posts in posts content and pages too! For more information about shortcodes, please visit', 'wordpress-popular-posts', 'wordpress-popular-posts'); ?> <a href="http://codex.wordpress.org/Shortcode_API" target="_blank">Wordpress Shortcode API</a>.</p>
552 </div>
553 <h4>&raquo; <a href="#" rel="q-21"><?php _e('List of parameters accepted by wpp_get_mostpopular() and the [wpp] shortcode', 'wordpress-popular-posts'); ?></a></h4>
554 <div class="wpp-ans" id="q-21" style="display:block;">
555 <p><?php _e('These parameters can be used by both the template tag wpp_get_most_popular() and the shortcode [wpp].', 'wordpress-popular-posts'); ?>:</p>
556 <table cellspacing="0" class="wp-list-table widefat fixed posts">
557 <thead>
558 <tr>
559 <th class="manage-column column-title"><?php _e('Parameter', 'wordpress-popular-posts'); ?></th>
560 <th class="manage-column column-title"><?php _e('What it does ', 'wordpress-popular-posts'); ?></th>
561 <th class="manage-column column-title"><?php _e('Possible values', 'wordpress-popular-posts'); ?></th>
562 <th class="manage-column column-title"><?php _e('Defaults to', 'wordpress-popular-posts'); ?></th>
563 <th class="manage-column column-title"><?php _e('Example', 'wordpress-popular-posts'); ?></th>
564 </tr>
565 </thead>
566 <tbody>
567 <tr>
568 <td><strong>header</strong></td>
569 <td><?php _e('Sets a heading for the list', 'wordpress-popular-posts'); ?></td>
570 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
571 <td><?php _e('Popular Posts', 'wordpress-popular-posts'); ?></td>
572 <td>header="Popular Posts"</td>
573 </tr>
574 <tr class="alternate">
575 <td><strong>header_start</strong></td>
576 <td><?php _e('Set the opening tag for the heading of the list', 'wordpress-popular-posts'); ?></td>
577 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
578 <td>&lt;h2&gt;</td>
579 <td>header_start="&lt;h2&gt;"</td>
580 </tr>
581 <tr>
582 <td><strong>header_end</strong></td>
583 <td><?php _e('Set the closing tag for the heading of the list', 'wordpress-popular-posts'); ?></td>
584 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
585 <td>&lt;/h2&gt;</td>
586 <td>header_end="&lt;/h2&gt;"</td>
587 </tr>
588 <tr class="alternate">
589 <td><strong>limit</strong></td>
590 <td><?php _e('Sets the maximum number of popular posts to be shown on the listing', 'wordpress-popular-posts'); ?></td>
591 <td><?php _e('Positive integer', 'wordpress-popular-posts'); ?></td>
592 <td>10</td>
593 <td>limit=10</td>
594 </tr>
595 <tr>
596 <td><strong>range</strong></td>
597 <td><?php _e('Tells Wordpress Popular Posts to retrieve the most popular entries within the time range specified by you', 'wordpress-popular-posts'); ?></td>
598 <td>"daily", "weekly", "monthly", "all"</td>
599 <td>daily</td>
600 <td>range="daily"</td>
601 </tr>
602 <tr class="alternate">
603 <td><strong>order_by</strong></td>
604 <td><?php _e('Sets the sorting option of the popular posts', 'wordpress-popular-posts'); ?></td>
605 <td>"comments", "views", "avg" <?php _e('(for average views per day)', 'wordpress-popular-posts'); ?></td>
606 <td>views</td>
607 <td>order_by="comments"</td>
608 </tr>
609 <tr>
610 <td><strong>post_type</strong></td>
611 <td><?php _e('Defines the type of posts to show on the listing', 'wordpress-popular-posts'); ?></td>
612 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
613 <td>post,page</td>
614 <td>post_type=post,page,your-custom-post-type</td>
615 </tr>
616 <tr class="alternate">
617 <td><strong>pid</strong></td>
618 <td><?php _e('If set, Wordpress Popular Posts will exclude the specified post(s) ID(s) form the listing.', 'wordpress-popular-posts'); ?></td>
619 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
620 <td><?php _e('None', 'wordpress-popular-posts'); ?></td>
621 <td>pid="60,25,31"</td>
622 </tr>
623 <tr>
624 <td><strong>cat</strong></td>
625 <td><?php _e('If set, Wordpress Popular Posts will retrieve all entries that belong to the specified category(ies) ID(s). If a minus sign is used, the category(ies) will be excluded instead.', 'wordpress-popular-posts'); ?></td>
626 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
627 <td><?php _e('None', 'wordpress-popular-posts'); ?></td>
628 <td>cat="1,55,-74"</td>
629 </tr>
630 <tr class="alternate">
631 <td><strong>author</strong></td>
632 <td><?php _e('If set, Wordpress Popular Posts will retrieve all entries created by specified author(s) ID(s).', 'wordpress-popular-posts'); ?></td>
633 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
634 <td><?php _e('None', 'wordpress-popular-posts'); ?></td>
635 <td>author="75,8,120"</td>
636 </tr>
637 <tr>
638 <td><strong>title_length</strong></td>
639 <td><?php _e('If set, Wordpress Popular Posts will shorten each post title to "n" characters whenever possible', 'wordpress-popular-posts'); ?></td>
640 <td><?php _e('Positive integer', 'wordpress-popular-posts'); ?></td>
641 <td>25</td>
642 <td>title_length=25</td>
643 </tr>
644 <tr>
645 <td><strong>title_by_words</strong></td>
646 <td><?php _e('If set to 1, Wordpress Popular Posts will shorten each post title to "n" words instead of characters', 'wordpress-popular-posts'); ?></td>
647 <td>1 (true), (0) false</td>
648 <td>0</td>
649 <td>title_by_words=1</td>
650 </tr>
651 <tr class="alternate">
652 <td><strong>excerpt_length</strong></td>
653 <td><?php _e('If set, Wordpress Popular Posts will build and include an excerpt of "n" characters long from the content of each post listed as popular', 'wordpress-popular-posts'); ?></td>
654 <td><?php _e('Positive integer', 'wordpress-popular-posts'); ?></td>
655 <td>0</td>
656 <td>excerpt_length=55</td>
657 </tr>
658 <tr>
659 <td><strong>excerpt_format</strong></td>
660 <td><?php _e('If set, Wordpress Popular Posts will maintaing all styling tags (strong, italic, etc) and hyperlinks found in the excerpt', 'wordpress-popular-posts'); ?></td>
661 <td>1 (true), (0) false</td>
662 <td>0</td>
663 <td>excerpt_format=1</td>
664 </tr>
665 <tr>
666 <td><strong>excerpt_by_words</strong></td>
667 <td><?php _e('If set to 1, Wordpress Popular Posts will shorten the excerpt to "n" words instead of characters', 'wordpress-popular-posts'); ?></td>
668 <td>1 (true), (0) false</td>
669 <td>0</td>
670 <td>excerpt_by_words=1</td>
671 </tr>
672 <tr class="alternate">
673 <td><strong>thumbnail_width</strong></td>
674 <td><?php _e('If set, and if your current server configuration allows it, you will be able to display thumbnails of your posts. This attribute sets the width for thumbnails', 'wordpress-popular-posts'); ?></td>
675 <td><?php _e('Positive integer', 'wordpress-popular-posts'); ?></td>
676 <td>15</td>
677 <td>thumbnail_width=30</td>
678 </tr>
679 <tr>
680 <td><strong>thumbnail_height</strong></td>
681 <td><?php _e('If set, and if your current server configuration allows it, you will be able to display thumbnails of your posts. This attribute sets the height for thumbnails', 'wordpress-popular-posts'); ?></td>
682 <td><?php _e('Positive integer', 'wordpress-popular-posts'); ?></td>
683 <td>15</td>
684 <td>thumbnail_height=30</td>
685 </tr>
686 <tr class="alternate">
687 <td><strong>rating</strong></td>
688 <td><?php _e('If set, and if the WP-PostRatings plugin is installed and enabled on your blog, Wordpress Popular Posts will show how your visitors are rating your entries', 'wordpress-popular-posts'); ?></td>
689 <td>1 (true), (0) false</td>
690 <td>0</td>
691 <td>rating=1</td>
692 </tr>
693 <tr>
694 <td><strong>stats_comments</strong></td>
695 <td><?php _e('If set, Wordpress Popular Posts will show how many comments each popular post has got until now', 'wordpress-popular-posts'); ?></td>
696 <td>1 (true), 0 (false)</td>
697 <td>1</td>
698 <td>stats_comments=1</td>
699 </tr>
700 <tr class="alternate">
701 <td><strong>stats_views</strong></td>
702 <td><?php _e('If set, Wordpress Popular Posts will show how many views each popular post has got since it was installed', 'wordpress-popular-posts'); ?></td>
703 <td>1 (true), (0) false</td>
704 <td>0</td>
705 <td>stats_views=1</td>
706 </tr>
707 <tr>
708 <td><strong>stats_author</strong></td>
709 <td><?php _e('If set, Wordpress Popular Posts will show who published each popular post on the list', 'wordpress-popular-posts'); ?></td>
710 <td>1 (true), (0) false</td>
711 <td>0</td>
712 <td>stats_author=1</td>
713 </tr>
714 <tr class="alternate">
715 <td><strong>stats_date</strong></td>
716 <td><?php _e('If set, Wordpress Popular Posts will display the date when each popular post on the list was published', 'wordpress-popular-posts'); ?></td>
717 <td>1 (true), (0) false</td>
718 <td>0</td>
719 <td>stats_date=1</td>
720 </tr>
721 <tr>
722 <td><strong>stats_date_format</strong></td>
723 <td><?php _e('Sets the date format', 'wordpress-popular-posts'); ?></td>
724 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
725 <td>0</td>
726 <td>stats_date_format='F j, Y'</td>
727 </tr>
728 <tr class="alternate">
729 <td><strong>stats_category</strong></td>
730 <td><?php _e('If set, Wordpress Popular Posts will display the category', 'wordpress-popular-posts'); ?></td>
731 <td>1 (true), (0) false</td>
732 <td>0</td>
733 <td>stats_category=1</td>
734 </tr>
735 <tr>
736 <td><strong>wpp_start</strong></td>
737 <td><?php _e('Sets the opening tag for the listing', 'wordpress-popular-posts'); ?></td>
738 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
739 <td>&lt;ul&gt;</td>
740 <td>wpp_start="&lt;ul&gt;"</td>
741 </tr>
742 <tr class="alternate">
743 <td><strong>wpp_end</strong></td>
744 <td><?php _e('Sets the closing tag for the listing', 'wordpress-popular-posts'); ?></td>
745 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
746 <td>&lt;/ul&gt;</td>
747 <td>wpp_end="&lt;/ul&gt;"</td>
748 </tr>
749 <tr>
750 <td><strong>post_html</strong></td>
751 <td><?php _e('Sets the HTML structure of each post', 'wordpress-popular-posts'); ?></td>
752 <td><?php _e('Text string, custom HTML', 'wordpress-popular-posts'); ?>.<br /><br /><strong><?php _e('Available Content Tags', 'wordpress-popular-posts'); ?>:</strong> <br /><em>{thumb}</em> (<?php _e('displays thumbnail linked to post/page', 'wordpress-popular-posts'); ?>)<br /> <em>{title}</em> (<?php _e('displays linked post/page title', 'wordpress-popular-posts'); ?>)<br /> <em>{summary}</em> (<?php _e('displays post/page excerpt, and requires excerpt_length to be greater than 0', 'wordpress-popular-posts'); ?>)<br /> <em>{stats}</em> (<?php _e('displays the default stats tags', 'wordpress-popular-posts'); ?>)<br /> <em>{rating}</em> (<?php _e('displays post/page current rating, requires WP-PostRatings installed and enabled', 'wordpress-popular-posts'); ?>)<br /> <em>{score}</em> (<?php _e('displays post/page current rating as an integer, requires WP-PostRatings installed and enabled', 'wordpress-popular-posts'); ?>)<br /> <em>{url}</em> (<?php _e('outputs the URL of the post/page', 'wordpress-popular-posts'); ?>)<br /> <em>{text_title}</em> (<?php _e('displays post/page title, no link', 'wordpress-popular-posts'); ?>)<br /> <em>{author}</em> (<?php _e('displays linked author name, requires stats_author=1', 'wordpress-popular-posts'); ?>)<br /> <em>{category}</em> (<?php _e('displays linked category name, requires stats_category=1', 'wordpress-popular-posts'); ?>)<br /> <em>{views}</em> (<?php _e('displays views count only, no text', 'wordpress-popular-posts'); ?>)<br /> <em>{comments}</em> (<?php _e('displays comments count only, no text, requires stats_comments=1', 'wordpress-popular-posts'); ?>)</td>
753 <td>&lt;li&gt;{thumb} {title} {stats}&lt;/li&gt;</td>
754 <td>post_html="&lt;li&gt;{thumb} &lt;a href='{url}'&gt;{text_title}&lt;/a&gt; &lt;/li&gt;"</td>
755 </tr>
756 <!--<tr class="alternate">
757 <td><strong>post_start</strong></td>
758 <td><?php _e('Sets the opening tag for each item on the list', 'wordpress-popular-posts'); ?></td>
759 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
760 <td>&lt;li&gt;</td>
761 <td>post_start="&lt;li&gt;"</td>
762 </tr>
763 <tr>
764 <td><strong>post_end</strong></td>
765 <td><?php _e('Sets the closing tag for each item on the list', 'wordpress-popular-posts'); ?></td>
766 <td><?php _e('Text string', 'wordpress-popular-posts'); ?></td>
767 <td>&lt;/li&gt;</td>
768 <td>post_end="&lt;/li&gt;"</td>
769 </tr>
770 <tr class="alternate">
771 <td><strong>do_pattern</strong></td>
772 <td><?php _e('If set, this option will allow you to decide the order of the contents within each item on the list.', 'wordpress-popular-posts'); ?></td>
773 <td>1 (true), (0) false</td>
774 <td>0</td>
775 <td>do_pattern=1</td>
776 </tr>
777 <tr>
778 <td><strong>pattern_form</strong></td>
779 <td><?php _e('If set, you can decide the order of each content inside a single item on the list. For example, setting it to "{title}: {summary}" would output something like "Your Post Title: summary here". This attribute requires do_pattern to be true.', 'wordpress-popular-posts'); ?></td>
780 <td><?php _e('Available tags', 'wordpress-popular-posts'); ?>: {thumb}, {title}, {summary}, {stats}, {rating}, {url}, {text_title}, {author}, {category}, {views}, {comments}</td>
781 <td>{image} {thumb}: {summary} {stats}</td>
782 <td>pattern_form="{thumb} {title}: {summary} {stats}"</td>
783 </tr>-->
784 </tbody>
785 </table>
786 </div>
787 </td>
788 </tr>
789 </table>
790 </div>
791 <!-- End faq -->
792
793 <!-- Start tools -->
794 <div id="wpp_tools" class="wpp_boxes"<?php if (isset($_POST['section']) && ($_POST['section'] == "linking" || $_POST['section'] == "logging" || $_POST['section'] == "tools" || $_POST['section'] == "ajax" || $_POST['section'] == "css") ) {?> style="display:block;"<?php } ?>>
795 <p><?php _e("Here you will find a handy group of options to tweak Wordpress Popular Posts.", "wordpress-popular-posts"); ?></p><br />
796
797 <h3 class="wmpp-subtitle"><?php _e("Popular Posts links behavior", "wordpress-popular-posts"); ?></h3>
798
799 <form action="" method="post" id="wpp_link_options" name="wpp_link_options">
800 <table class="form-table">
801 <tbody>
802 <tr valign="top">
803 <th scope="row"><label for="link_target"><?php _e("Open links in", "wordpress-popular-posts"); ?>:</label></th>
804 <td>
805 <select name="link_target" id="link_target">
806 <option <?php if (!isset($ops['tools']['link']['target']) || $ops['tools']['link']['target'] == '_self') {?>selected="selected"<?php } ?> value="_self"><?php _e("Current window", "wordpress-popular-posts"); ?></option>
807 <option <?php if (isset($ops['tools']['link']['target']) && $ops['tools']['link']['target'] == '_blank') {?>selected="selected"<?php } ?> value="_blank"><?php _e("New tab/window", "wordpress-popular-posts"); ?></option>
808 </select>
809 <br />
810 </td>
811 </tr>
812 <tr valign="top">
813 <td colspan="2">
814 <input type="hidden" name="section" value="linking" />
815 <input type="submit" class="button-secondary action" id="btn_link_ops" value="<?php _e("Apply", "wordpress-popular-posts"); ?>" name="" />
816 </td>
817 </tr>
818 </tbody>
819 </table>
820 </form>
821 <br />
822 <p style="display:block; float:none; clear:both">&nbsp;</p>
823
824 <h3 class="wmpp-subtitle"><?php _e("Views logging behavior", "wordpress-popular-posts"); ?></h3>
825
826 <form action="" method="post" id="wpp_log_options" name="wpp_log_options">
827 <table class="form-table">
828 <tbody>
829 <tr valign="top">
830 <th scope="row"><label for="log_option"><?php _e("Log views from", "wordpress-popular-posts"); ?>:</label></th>
831 <td>
832 <select name="log_option" id="log_option">
833 <option <?php if (!isset($ops['tools']['log_loggedin']) || $ops['tools']['log_loggedin'] == 0) {?>selected="selected"<?php } ?> value="0"><?php _e("Visitors only", "wordpress-popular-posts"); ?></option>
834 <option <?php if (isset($ops['tools']['log_loggedin']) && $ops['tools']['log_loggedin'] == 1) {?>selected="selected"<?php } ?> value="1"><?php _e("Everyone", "wordpress-popular-posts"); ?></option>
835 </select>
836 <br />
837 </td>
838 </tr>
839 <tr valign="top">
840 <td colspan="2">
841 <input type="hidden" name="section" value="logging" />
842 <input type="submit" class="button-secondary action" id="btn_log_ops" value="<?php _e("Apply", "wordpress-popular-posts"); ?>" name="" />
843 </td>
844 </tr>
845 </tbody>
846 </table>
847 </form>
848 <br />
849 <p style="display:block; float:none; clear:both">&nbsp;</p>
850
851 <h3 class="wmpp-subtitle"><?php _e("Thumbnail source", "wordpress-popular-posts"); ?></h3>
852
853 <form action="" method="post" id="wpp_thumbnail_options" name="wpp_thumbnail_options">
854 <table class="form-table">
855 <tbody>
856 <tr valign="top">
857 <th scope="row"><label for="thumb_default"><?php _e("Default thumbnail", "wordpress-popular-posts"); ?>:</label></th>
858 <td>
859 <input id="upload_thumb_button" type="button" class="button" value="<?php _e( "Upload thumbnail", "wordpress-popular-posts" ); ?>" />
860 <input type="hidden" id="upload_thumb_src" name="upload_thumb_src" value="" />
861 <br />
862 <p class="description"><?php _e("How-to: upload (or select) an image, set Size to Full and click on Upload. After it's done, hit on Apply to save changes", "wordpress-popular-posts"); ?></p>
863 <div style="display:<?php if ( !empty($ops['tools']['thumbnail']['default']) ) : ?>block<?php else: ?>none<?php endif; ?>;">
864 <label><?php _e("Preview", "wordpress-popular-posts"); ?>:</label>
865 <div id="thumb-review">
866 <img src="<?php echo $ops['tools']['thumbnail']['default']; ?>" alt="" border="0" />
867 </div>
868 </div>
869 </td>
870 </tr>
871 <tr valign="top">
872 <th scope="row"><label for="thumb_source"><?php _e("Pick image from", "wordpress-popular-posts"); ?>:</label></th>
873 <td>
874 <select name="thumb_source" id="thumb_source">
875 <option <?php if ($ops['tools']['thumbnail']['source'] == "featured") {?>selected="selected"<?php } ?> value="featured"><?php _e("Featured image", "wordpress-popular-posts"); ?></option>
876 <option <?php if ($ops['tools']['thumbnail']['source'] == "first_image") {?>selected="selected"<?php } ?> value="first_image"><?php _e("First image on post", "wordpress-popular-posts"); ?></option>
877 <option <?php if ($ops['tools']['thumbnail']['source'] == "custom_field") {?>selected="selected"<?php } ?> value="custom_field"><?php _e("Custom field", "wordpress-popular-posts"); ?></option>
878 </select>
879 <br />
880 <p class="description"><?php _e("Tell Wordpress Popular Posts where it should get thumbnails from", "wordpress-popular-posts"); ?></p>
881 </td>
882 </tr>
883 <tr valign="top" <?php if ($ops['tools']['thumbnail']['source'] != "custom_field") {?>style="display:none;"<?php } ?> id="row_custom_field">
884 <th scope="row"><label for="thumb_field"><?php _e("Custom field name", "wordpress-popular-posts"); ?>:</label></th>
885 <td>
886 <input type="text" id="thumb_field" name="thumb_field" value="<?php echo $ops['tools']['thumbnail']['field']; ?>" size="10" <?php if ($ops['tools']['thumbnail']['source'] != "custom_field") {?>style="display:none;"<?php } ?> />
887 </td>
888 </tr>
889 <tr valign="top" <?php if ($ops['tools']['thumbnail']['source'] != "custom_field") {?>style="display:none;"<?php } ?> id="row_custom_field_resize">
890 <th scope="row"><label for="thumb_field_resize"><?php _e("Resize image from Custom field?", "wordpress-popular-posts"); ?>:</label></th>
891 <td>
892 <select name="thumb_field_resize" id="thumb_field_resize">
893 <option <?php if ( !isset($ops['tools']['thumbnail']['resize']) || !$ops['tools']['thumbnail']['resize'] ) {?>selected="selected"<?php } ?> value="0"><?php _e("No, I will upload my own thumbnail", "wordpress-popular-posts"); ?></option>
894 <option <?php if ( isset($ops['tools']['thumbnail']['resize'] ) && $ops['tools']['thumbnail']['resize'] == 1 ) {?>selected="selected"<?php } ?> value="1"><?php _e("Yes", "wordpress-popular-posts"); ?></option>
895 </select>
896 </td>
897 </tr>
898 <tr valign="top">
899 <td colspan="2">
900 <input type="hidden" name="section" value="tools" />
901 <input type="submit" class="button-secondary action" id="btn_th_ops" value="<?php _e("Apply", "wordpress-popular-posts"); ?>" name="" />
902 </td>
903 </tr>
904 </tbody>
905 </table>
906 </form>
907
908 <br />
909 <p style="display:block; float:none; clear:both">&nbsp;</p>
910
911 <h3 class="wmpp-subtitle"><?php _e("Wordpress Popular Posts Stylesheet", "wordpress-popular-posts"); ?></h3>
912 <p><?php _e("By default, the plugin includes a stylesheet called wpp.css which you can use to style your popular posts listing. If you wish to use your own stylesheet or do not want it to have it included in the header section of your site, use this.", "wordpress-popular-posts"); ?></p>
913 <div class="tablenav top">
914 <div class="alignleft actions">
915 <form action="" method="post" id="wpp_css_options" name="wpp_css_options">
916 <select name="css" id="css">
917 <option <?php if ($ops['tools']['css']) {?>selected="selected"<?php } ?> value="1"><?php _e("Enabled", "wordpress-popular-posts"); ?></option>
918 <option <?php if (!$ops['tools']['css']) {?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", "wordpress-popular-posts"); ?></option>
919 </select>
920 <input type="hidden" name="section" value="css" />
921 <input type="submit" class="button-secondary action" id="btn_css_ops" value="<?php _e("Apply", "wordpress-popular-posts"); ?>" name="" />
922 </form>
923 </div>
924 </div>
925 <br /><br />
926
927 <h3 class="wmpp-subtitle"><?php _e("Data tools", "wordpress-popular-posts"); ?></h3>
928 <form action="" method="post" id="wpp_ajax_options" name="wpp_ajax_options">
929 <table class="form-table">
930 <tbody>
931 <tr valign="top">
932 <th scope="row"><label for="thumb_source"><?php _e("Ajaxify widget", "wordpress-popular-posts"); ?>:</label></th>
933 <td>
934 <select name="ajax" id="ajax">
935 <option <?php if (!$ops['tools']['ajax']) {?>selected="selected"<?php } ?> value="0"><?php _e("Disabled", "wordpress-popular-posts"); ?></option>
936 <option <?php if ($ops['tools']['ajax']) {?>selected="selected"<?php } ?> value="1"><?php _e("Enabled", "wordpress-popular-posts"); ?></option>
937 </select>
938
939 <br />
940 <p class="description"><?php _e("If you are using a caching plugin such as WP Super Cache, enabling this feature will keep the popular list from being cached by it", "wordpress-popular-posts"); ?></p>
941 </td>
942 </tr>
943 <tr valign="top" style="display:none;">
944 <th scope="row"><label for="thumb_source"><?php _e("Popular posts listing refresh interval", "wordpress-popular-posts"); ?>:</label></th>
945 <td>
946 <select name="cache" id="cache">
947 <option <?php if ( !isset($ops['tools']['cache']['active']) || !$ops['tools']['cache']['active'] ) { ?>selected="selected"<?php } ?> value="0"><?php _e("Live", "wordpress-popular-posts"); ?></option>
948 <option <?php if ( isset($ops['tools']['cache']['active']) && $ops['tools']['cache']['active'] ) { ?>selected="selected"<?php } ?> value="1"><?php _e("Custom interval", "wordpress-popular-posts"); ?></option>
949 </select>
950
951 <br />
952 <p class="description"><?php _e("Sets how often the listing should be updated. For most sites the Live option should be fine, however if you are experiencing slowdowns or your blog gets a lot of visitors then you might want to change the refresh rate", "wordpress-popular-posts"); ?></p>
953 </td>
954 </tr>
955 <tr valign="top" <?php if ( !isset($ops['tools']['cache']['active']) || !$ops['tools']['cache']['active'] ) { ?>style="display:none;"<?php } ?> id="cache_refresh_interval">
956 <th scope="row"><label for="thumb_field_resize"><?php _e("Refresh interval", "wordpress-popular-posts"); ?>:</label></th>
957 <td>
958 <input name="cache_interval_value" type="text" id="cache_interval_value" value="<?php echo ( isset($ops['tools']['cache']['interval']['value']) ) ? (int) $ops['tools']['cache']['interval']['value'] : 1; ?>" class="small-text">
959 <select name="cache_interval_time" id="cache_interval_time">
960 <option <?php if ($ops['tools']['cache']['interval']['time'] == "hour") {?>selected="selected"<?php } ?> value="hour"><?php _e("Hour(s)", "wordpress-popular-posts"); ?></option>
961 <option <?php if ($ops['tools']['cache']['interval']['time'] == "day") {?>selected="selected"<?php } ?> value="day"><?php _e("Day(s)", "wordpress-popular-posts"); ?></option>
962 <option <?php if ($ops['tools']['cache']['interval']['time'] == "week") {?>selected="selected"<?php } ?> value="week"><?php _e("Week(s)", "wordpress-popular-posts"); ?></option>
963 <option <?php if ($ops['tools']['cache']['interval']['time'] == "month") {?>selected="selected"<?php } ?> value="month"><?php _e("Month(s)", "wordpress-popular-posts"); ?></option>
964 <option <?php if ($ops['tools']['cache']['interval']['time'] == "year") {?>selected="selected"<?php } ?> value="month"><?php _e("Year(s)", "wordpress-popular-posts"); ?></option>
965 </select>
966 <br />
967 <p class="description" style="display:none;" id="cache_too_long"><?php _e("Really? That long?", "wordpress-popular-posts"); ?></p>
968 </td>
969 </tr>
970 <tr valign="top">
971 <td colspan="2">
972 <input type="hidden" name="section" value="ajax" />
973 <input type="submit" class="button-secondary action" id="btn_ajax_ops" value="<?php _e("Apply", "wordpress-popular-posts"); ?>" name="" />
974 </td>
975 </tr>
976 </tbody>
977 </table>
978 </form>
979
980 <br /><br />
981
982 <p><?php _e('Wordpress Popular Posts maintains data in two separate tables: one for storing the most popular entries in the past 30 days (from now on, "cache"), and another one to keep the All-time data (from now on, "historical data" or just "data"). If for some reason you need to clear the cache table, or even both historical and cache tables, please use the buttons below to do so.', 'wordpress-popular-posts') ?></p>
983 <p><input type="button" name="wpp-reset-cache" id="wpp-reset-cache" class="button-secondary" value="<?php _e("Empty cache", "wordpress-popular-posts"); ?>" onclick="confirm_reset_cache()" /> <label for="wpp-reset-cache"><small><?php _e('Use this button to manually clear entries from WPP cache only', 'wordpress-popular-posts'); ?></small></label></p>
984 <p><input type="button" name="wpp-reset-all" id="wpp-reset-all" class="button-secondary" value="<?php _e("Clear all data", "wordpress-popular-posts"); ?>" onclick="confirm_reset_all()" /> <label for="wpp-reset-all"><small><?php _e('Use this button to manually clear entries from all WPP data tables', 'wordpress-popular-posts'); ?></small></label></p>
985 </div>
986 <!-- End tools -->
987
988 <br />
989 <hr />
990 <p><?php _e('Do you like this plugin?', 'wordpress-popular-posts'); ?> <a title="<?php _e('Rate Wordpress Popular Posts!', 'wordpress-popular-posts'); ?>" href="http://wordpress.org/extend/plugins/wordpress-popular-posts/#rate-response" target="_blank"><strong><?php _e('Rate it', 'wordpress-popular-posts'); ?></strong></a> <?php _e('on the official Plugin Directory!', 'wordpress-popular-posts'); ?></p>
991 <p><?php _e('Do you love this plugin?', 'wordpress-popular-posts'); ?> <a title="<?php _e('Buy me a beer!', 'wordpress-popular-posts'); ?>" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=dadslayer%40gmail%2ecom&lc=GB&item_name=Wordpress%20Popular%20Posts%20Plugin&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG_global%2egif%3aNonHosted" target="_blank"><strong><?php _e('Buy me a beer!', 'wordpress-popular-posts'); ?></strong></a>. <?php _e('Each donation motivates me to keep releasing free stuff for the Wordpress community!', 'wordpress-popular-posts'); ?></p>
992 <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=dadslayer%40gmail%2ecom&lc=GB&item_name=Wordpress%20Popular%20Posts%20Plugin&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG_global%2egif%3aNonHosted" target="_blank" rel="external nofollow"><img src="<?php echo get_bloginfo('url') . "/" . PLUGINDIR; ?>/wordpress-popular-posts/btn_donateCC_LG_global.gif" width="122" height="47" alt="<?php _e('Buy me a beer!', 'wordpress-popular-posts'); ?>" border="0" /></a>
993 </div>