Top 10 – Popular posts plugin for WordPress - Version 1.5.3

Version Description

  • Added: You can now use HTML in the counter display
Download this release

Release Info

Developer Ajay
Plugin Icon 128x128 Top 10 – Popular posts plugin for WordPress
Version 1.5.3
Comparing to
See all releases

Code changes from version 1.5.2 to 1.5.3

Files changed (5) hide show
  1. admin.inc.php +1 -1
  2. readme.txt +4 -1
  3. top-10-counter.js.php +2 -2
  4. top-10-daily.js.php +1 -1
  5. top-10.php +12 -7
admin.inc.php CHANGED
@@ -16,7 +16,7 @@ function tptn_options() {
16
  if($_POST['tptn_save']){
17
  $tptn_settings[title] = ($_POST['title']);
18
  $tptn_settings[title_daily] = ($_POST['title_daily']);
19
- $tptn_settings[daily_range] = ($_POST['daily_range']);
20
  $tptn_settings[limit] = intval($_POST['limit']);
21
  $tptn_settings[count_disp_form] = ($_POST['count_disp_form']);
22
  $tptn_settings[add_to_content] = (($_POST['add_to_content']) ? true : false);
16
  if($_POST['tptn_save']){
17
  $tptn_settings[title] = ($_POST['title']);
18
  $tptn_settings[title_daily] = ($_POST['title_daily']);
19
+ $tptn_settings[daily_range] = intval($_POST['daily_range']);
20
  $tptn_settings[limit] = intval($_POST['limit']);
21
  $tptn_settings[count_disp_form] = ($_POST['count_disp_form']);
22
  $tptn_settings[add_to_content] = (($_POST['add_to_content']) ? true : false);
readme.txt CHANGED
@@ -1,5 +1,5 @@
1
  === Top 10 ===
2
- Tags: top 10, popular posts, top posts, counter, daily popular, page views, statistics
3
  Contributors: Ajay, Mark Ghosh
4
  Donate link: http://ajaydsouza.com/donate/
5
  Stable tag: trunk
@@ -29,6 +29,9 @@ Includes a sidebar widget to display the popular posts. And, all settings can be
29
 
30
  == Changelog ==
31
 
 
 
 
32
  = 1.5.2 =
33
  * Fixed: Fixed display of post thumbnails using postmeta field
34
 
1
  === Top 10 ===
2
+ Tags: top 10, counter, popular posts, top posts, daily popular, page views, statistics
3
  Contributors: Ajay, Mark Ghosh
4
  Donate link: http://ajaydsouza.com/donate/
5
  Stable tag: trunk
29
 
30
  == Changelog ==
31
 
32
+ = 1.5.3 =
33
+ * Added: You can now use HTML in the counter display
34
+
35
  = 1.5.2 =
36
  * Fixed: Fixed display of post thumbnails using postmeta field
37
 
top-10-counter.js.php CHANGED
@@ -18,7 +18,7 @@ function tptn_disp_count() {
18
  $table_name = $wpdb->prefix . "top_ten";
19
  $table_name_daily = $wpdb->prefix . "top_ten_daily";
20
  $tptn_settings = tptn_read_options();
21
- $count_disp_form = htmlspecialchars(stripslashes($tptn_settings[count_disp_form]));
22
 
23
  $id = intval($_GET['top_ten_id']);
24
  if($id > 0) {
@@ -38,4 +38,4 @@ function tptn_disp_count() {
38
  }
39
  }
40
  tptn_disp_count();
41
- ?>
18
  $table_name = $wpdb->prefix . "top_ten";
19
  $table_name_daily = $wpdb->prefix . "top_ten_daily";
20
  $tptn_settings = tptn_read_options();
21
+ $count_disp_form = stripslashes($tptn_settings[count_disp_form]);
22
 
23
  $id = intval($_GET['top_ten_id']);
24
  if($id > 0) {
38
  }
39
  }
40
  tptn_disp_count();
41
+ ?>
top-10-daily.js.php CHANGED
@@ -61,7 +61,7 @@ function tptn_daily_lists() {
61
  if ($tptn_settings['disp_list_count']) $output .= ' ('.$result->sumCount.')';
62
  $output .= $tptn_settings['after_list_item'];
63
  }
64
- if ($tptn_settings['show_credit']) $output .= '<li>Popular posts by <a href="http://ajaydsouza.com/wordpress/plugins/top-10/">Top 10 plugin</a></li>';
65
  $output .= $tptn_settings['after_list'];
66
  }
67
 
61
  if ($tptn_settings['disp_list_count']) $output .= ' ('.$result->sumCount.')';
62
  $output .= $tptn_settings['after_list_item'];
63
  }
64
+ if ($tptn_settings['show_credit']) $output .= $tptn_settings['before_list_item'].'Popular posts by <a href="http://ajaydsouza.com/wordpress/plugins/top-10/">Top 10 plugin</a>'.$tptn_settings['after_list_item'];
65
  $output .= $tptn_settings['after_list'];
66
  }
67
 
top-10.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Top 10
4
- Version: 1.5.2
5
  Plugin URI: http://ajaydsouza.com/wordpress/plugins/top-10/
6
  Description: Count daily and total visits per post and display the most popular posts based on the number of views. Based on the plugin by <a href="http://weblogtoolscollection.com">Mark Ghosh</a>
7
  Author: Ajay D'Souza
@@ -13,13 +13,18 @@ define('ALD_TPTN_DIR', dirname(__FILE__));
13
  define('TPTN_LOCAL_NAME', 'tptn');
14
 
15
  // Pre-2.6 compatibility
16
- if ( !defined('WP_CONTENT_URL') )
17
- define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
18
- if ( !defined('WP_CONTENT_DIR') )
19
- define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
 
 
 
 
 
20
  // Guess the location
21
- $tptn_path = WP_CONTENT_DIR.'/plugins/'.plugin_basename(dirname(__FILE__));
22
- $tptn_url = WP_CONTENT_URL.'/plugins/'.plugin_basename(dirname(__FILE__));
23
 
24
 
25
 
1
  <?php
2
  /*
3
  Plugin Name: Top 10
4
+ Version: 1.5.3
5
  Plugin URI: http://ajaydsouza.com/wordpress/plugins/top-10/
6
  Description: Count daily and total visits per post and display the most popular posts based on the number of views. Based on the plugin by <a href="http://weblogtoolscollection.com">Mark Ghosh</a>
7
  Author: Ajay D'Souza
13
  define('TPTN_LOCAL_NAME', 'tptn');
14
 
15
  // Pre-2.6 compatibility
16
+ if ( ! defined( 'WP_CONTENT_URL' ) )
17
+ define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
18
+ if ( ! defined( 'WP_CONTENT_DIR' ) )
19
+ define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
20
+ if ( ! defined( 'WP_PLUGIN_URL' ) )
21
+ define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
22
+ if ( ! defined( 'WP_PLUGIN_DIR' ) )
23
+ define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
24
+
25
  // Guess the location
26
+ $tptn_path = WP_PLUGIN_DIR.'/'.plugin_basename(dirname(__FILE__));
27
+ $tptn_url = WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__));
28
 
29
 
30