Top 10 – Popular posts plugin for WordPress - Version 1.4

Version Description

  • Added localisation support
  • Separate options to display number of views on posts and pages
Download this release

Release Info

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

Code changes from version 1.3 to 1.4

admin.inc.php CHANGED
@@ -2,6 +2,10 @@
2
  /**********************************************************************
3
  * Admin Page *
4
  *********************************************************************/
 
 
 
 
5
  function tptn_options() {
6
 
7
  global $wpdb;
@@ -17,6 +21,7 @@ function tptn_options() {
17
  $tptn_settings[count_disp_form] = ($_POST['count_disp_form']);
18
  $tptn_settings[add_to_content] = (($_POST['add_to_content']) ? true : false);
19
  $tptn_settings[exclude_pages] = (($_POST['exclude_pages']) ? true : false);
 
20
  $tptn_settings[track_authors] = (($_POST['track_authors']) ? true : false);
21
  $tptn_settings[pv_in_admin] = (($_POST['pv_in_admin']) ? true : false);
22
  $tptn_settings[disp_list_count] = (($_POST['disp_list_count']) ? true : false);
@@ -25,7 +30,7 @@ function tptn_options() {
25
 
26
  update_option('ald_tptn_settings', $tptn_settings);
27
 
28
- $str = '<div id="message" class="updated fade"><p>'. __('Options saved successfully.','ald_tptn_plugin') .'</p></div>';
29
  echo $str;
30
  }
31
 
@@ -34,7 +39,7 @@ function tptn_options() {
34
  $tptn_settings = tptn_default_options();
35
  update_option('ald_tptn_settings', $tptn_settings);
36
 
37
- $str = '<div id="message" class="updated fade"><p>'. __('Options set to Default.','ald_tptn_plugin') .'</p></div>';
38
  echo $str;
39
  }
40
  ?>
@@ -45,100 +50,106 @@ function tptn_options() {
45
  <fieldset class="options">
46
  <legend>
47
  <h3>
48
- <?php _e('Support the Development','ald_tptn_plugin'); ?>
49
  </h3>
50
  </legend>
51
  <p>
52
- <?php _e('If you find ','ald_tptn_plugin'); ?>
53
  <a href="http://ajaydsouza.com/wordpress/plugins/top-10/">Top 10</a>
54
- <?php _e('useful, please do','ald_tptn_plugin'); ?>
55
- <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=donate@ajaydsouza.com&amp;item_name=Top%10%20(From%20WP-Admin)&amp;no_shipping=1&amp;return=http://ajaydsouza.com/wordpress/plugins/top-10/&amp;cancel_return=http://ajaydsouza.com/wordpress/plugins/top-10/&amp;cn=Note%20to%20Author&amp;tax=0&amp;currency_code=USD&amp;bn=PP-DonationsBF&amp;charset=UTF-8" title="Donate via PayPal"><?php _e('drop in your contribution','ald_tptn_plugin'); ?></a>.
56
- (<a href="http://ajaydsouza.com/donate/"><?php _e('Some reasons why you should.','ald_tptn_plugin'); ?></a>)</p>
57
  </fieldset>
58
  </div>
59
  <form method="post" id="tptn_options" name="tptn_options" style="border: #ccc 1px solid; padding: 10px">
60
  <fieldset class="options">
61
  <legend>
62
  <h3>
63
- <?php _e('Options:','ald_tptn_plugin'); ?>
64
  </h3>
65
  </legend>
66
  <p>
67
  <label>
68
- <?php _e('Format to display the count in: ','ald_tptn_plugin'); ?><br />
69
  <textarea name="count_disp_form" id="count_disp_form" cols="50" rows="5"><?php echo htmlspecialchars(stripslashes($tptn_settings[count_disp_form])); ?></textarea>
70
  </label>
71
  </p>
72
- <p><?php _e('Use <code>%totalcount%</code> to display the total count and <code>%dailycount%</code> to display the daily count. e.g. the default options displays <code>(Visited 123 times, 23 visits today)</code>','ald_tptn_plugin'); ?></p>
73
  <p>
74
  <label>
75
- <?php _e('Number of popular posts to display: ','ald_tptn_plugin'); ?>
76
  <input type="textbox" name="limit" id="limit" value="<?php echo stripslashes($tptn_settings[limit]); ?>">
77
  </label>
78
  </p>
79
  <p>
80
  <label>
81
- <?php _e('Title of popular posts: ','ald_tptn_plugin'); ?>
82
  <input type="textbox" name="title" id="title" value="<?php echo stripslashes($tptn_settings[title]); ?>">
83
  </label>
84
  </p>
85
  <p>
86
  <label>
87
- <?php _e('Title of daily popular posts: ','ald_tptn_plugin'); ?>
88
  <input type="textbox" name="title_daily" id="title_daily" value="<?php echo stripslashes($tptn_settings[title_daily]); ?>">
89
  </label>
90
  </p>
91
  <p>
92
  <label>
93
- <?php _e('Daily Popular should contain views of how many days? ','ald_tptn_plugin'); ?>
94
  <input type="textbox" name="daily_range" id="daily_range" size="3" value="<?php echo stripslashes($tptn_settings[daily_range]); ?>">
95
  </label>
96
  </p>
97
  <p>
98
  <label>
99
  <input type="checkbox" name="exclude_pages" id="exclude_pages" <?php if ($tptn_settings[exclude_pages]) echo 'checked="checked"' ?> />
100
- <?php _e('Exclude Pages in display of Popular Posts? Number of views on Pages will continue to be counted.','ald_tptn_plugin'); ?>
101
  </label>
102
  </p>
103
  <p>
104
  <label>
105
- <input type="checkbox" name="track_authors" id="track_authors" <?php if ($tptn_settings[track_authors]) echo 'checked="checked"' ?> />
106
- <?php _e('Track visits of authors on their own posts?','ald_tptn_plugin'); ?>
107
  </label>
108
  </p>
109
  <p>
110
  <label>
111
- <input type="checkbox" name="disp_list_count" id="disp_list_count" <?php if ($tptn_settings[disp_list_count]) echo 'checked="checked"' ?> />
112
- <?php _e('Display number of page views in popular lists?','ald_tptn_plugin'); ?>
113
  </label>
114
  </p>
115
  <p>
116
  <label>
117
- <input type="checkbox" name="d_use_js" id="d_use_js" <?php if ($tptn_settings[d_use_js]) echo 'checked="checked"' ?> />
118
- <?php _e('Force daily posts\' list to be dynamic? This options uses JavaScript to load the post and can increase your page load time','ald_tptn_plugin'); ?>
119
  </label>
120
  </p>
121
  <p>
122
  <label>
123
- <input type="checkbox" name="pv_in_admin" id="pv_in_admin" <?php if ($tptn_settings[pv_in_admin]) echo 'checked="checked"' ?> />
124
- <?php _e('Display page views on Edit posts/pages in WP-Admin? An extra column is added with the count','ald_tptn_plugin'); ?>
125
  </label>
126
  </p>
127
  <p>
128
  <label>
129
- <input type="checkbox" name="add_to_content" id="add_to_content" <?php if ($tptn_settings[add_to_content]) echo 'checked="checked"' ?> />
130
- <?php _e('Add post count to content?','ald_tptn_plugin'); ?>
 
 
 
 
 
 
131
  </label>
132
  </p>
133
  <p>
134
  <label>
135
  <input type="checkbox" name="show_credit" id="show_credit" <?php if ($tptn_settings[show_credit]) echo 'checked="checked"' ?> />
136
- <?php _e('A link to the plugin is added as an extra list item to the list of popular posts. Not mandatory, but thanks if you do it!','ald_tptn_plugin'); ?>
137
  </label>
138
  </p>
139
  <p>
140
  <input type="submit" name="tptn_save" id="tptn_save" value="Save Options" style="border:#00CC00 1px solid" />
141
- <input name="tptn_default" type="submit" id="tptn_default" value="Default Options" style="border:#FF0000 1px solid" onclick="if (!confirm('<?php _e('Do you want to set options to Default?','ald_tptn_plugin'); ?>')) return false;" />
142
  </p>
143
  </fieldset>
144
  </form>
@@ -154,7 +165,7 @@ function tptn_manage() {
154
 
155
  echo '<div class="wrap">';
156
  echo '<h2>';
157
- if (!$daily) echo 'Popular Posts'; else echo 'Daily Popular Posts';
158
  echo '</h2>';
159
  echo '<div style="border: #ccc 1px solid; padding: 10px">';
160
  echo tptn_pop_display($daily,$paged,$limit);
@@ -177,8 +188,8 @@ function tptn_adminmenu() {
177
  }
178
 
179
  if ((function_exists('add_options_page'))&&($tptn_is_admin)) {
180
- add_options_page(__("Top 10", 'myald_tptn_plugin'), __("Top 10", 'myald_tptn_plugin'), 9, 'tptn_options', 'tptn_options');
181
- add_posts_page(__("Popular Posts", 'myald_tptn_plugin'), __("Top 10", 'myald_tptn_plugin'), 9, 'tptn_manage', 'tptn_manage');
182
  }
183
  }
184
  add_action('admin_menu', 'tptn_adminmenu');
@@ -257,11 +268,17 @@ function tptn_pop_display($daily = false, $page = 0, $limit = 10) {
257
  $output = '<div id="tptn_popular_posts">';
258
  $output .= '<table width="100%" border="0">
259
  <tr>
260
- <td width="50%" align="left">
261
- Results <strong>'.$first.'</strong> - <strong>'.$last.'</strong> of <strong>'.$numrows.'</strong>
 
 
 
262
  </td>
263
- <td width="50%" align="right">
264
- Page <strong>'.$current.'</strong> of <strong>'.$total.'</strong>
 
 
 
265
  </td>
266
  </tr>
267
  <tr>
@@ -271,12 +288,17 @@ function tptn_pop_display($daily = false, $page = 0, $limit = 10) {
271
  <td align="left">';
272
 
273
  if(!$daily) {
274
- $output .= '<a href="./edit.php?page=tptn_manage&daily=1">View Daily Popular Posts</a></td>';
 
 
275
  } else {
276
- $output .= '<a href="./edit.php?page=tptn_manage&daily=0">View Overall Popular Posts</a></td>';
 
 
277
  }
278
- $output .= '<td align="right">
279
- Results per-page: <a href="./edit.php?page=tptn_manage&daily='.$daily.'&limit=10">10</a> | <a href="./edit.php?page=tptn_manage&daily='.$daily.'&limit=20">20</a> | <a href="./edit.php?page=tptn_manage&daily='.$daily.'&limit=50">50</a> | <a href="./edit.php?page=tptn_manage&daily='.$daily.'&limit=100">100</a>
 
280
  </td>
281
  </tr>
282
  <tr>
@@ -298,22 +320,27 @@ function tptn_pop_display($daily = false, $page = 0, $limit = 10) {
298
  $output .= '<p align="center">';
299
  if ($page != 0) { // Don't show back link if current page is first page.
300
  $back_page = $page - $limit;
301
- $output .= "<a href=\"./edit.php?page=tptn_manage&paged=$back_page&daily=$daily&limit=$limit\">&laquo; Previous</a> \n";
 
 
302
  }
303
 
304
  for ($i=1; $i <= $pages; $i++) // loop through each page and give link to it.
305
  {
306
  $ppage = $limit*($i - 1);
307
  if ($ppage == $page){
308
- $output .= ("<b>$i</b>\n");} // If current page don't give link, just text.
 
309
  else{
310
- $output .= ("<a href=\"./edit.php?page=tptn_manage&paged=$ppage&daily=$daily&limit=$limit\">$i</a> \n");
311
  }
312
  }
313
 
314
  if (!((($page+$limit) / $limit) >= $pages) && $pages != 1) { // If last page don't give next link.
315
  $next_page = $page + $limit;
316
- $output .= " <a href=\"./edit.php?page=tptn_manage&paged=$next_page&daily=$daily&limit=$limit\">Next &raquo;</a>";
 
 
317
  }
318
  $output .= '</p>';
319
  $output .= '<p style="text-align:center;border-top: #000 1px solid">Popular posts by <a href="http://ajaydsouza.com/wordpress/plugins/top-10/">Top 10 plugin</a></p>';
@@ -334,8 +361,8 @@ function tptn_pop_daily_dashboard() {
334
 
335
  function tptn_pop_dashboard_setup() {
336
  if (function_exists('wp_add_dashboard_widget')) {
337
- wp_add_dashboard_widget( 'tptn_pop_dashboard', __( 'Popular Posts' ), 'tptn_pop_dashboard' );
338
- wp_add_dashboard_widget( 'tptn_pop_daily_dashboard', __( 'Daily Popular' ), 'tptn_pop_daily_dashboard' );
339
  }
340
  }
341
  add_action('wp_dashboard_setup', 'tptn_pop_dashboard_setup');
@@ -346,7 +373,7 @@ add_action('wp_dashboard_setup', 'tptn_pop_dashboard_setup');
346
  function tptn_column($cols) {
347
  $tptn_settings = tptn_read_options();
348
 
349
- if ($tptn_settings[pv_in_admin]) $cols['tptn'] = __('Total / Today\'s Views','ald_tptn_plugin');
350
  return $cols;
351
  }
352
 
2
  /**********************************************************************
3
  * Admin Page *
4
  *********************************************************************/
5
+ if (!defined('ABSPATH')) die("Aren't you supposed to come here via WP-Admin?");
6
+ define('ALD_TPTN_DIR', dirname(__FILE__));
7
+ if (!defined('TPTN_LOCAL_NAME')) define('TPTN_LOCAL_NAME', 'tptn');
8
+
9
  function tptn_options() {
10
 
11
  global $wpdb;
21
  $tptn_settings[count_disp_form] = ($_POST['count_disp_form']);
22
  $tptn_settings[add_to_content] = (($_POST['add_to_content']) ? true : false);
23
  $tptn_settings[exclude_pages] = (($_POST['exclude_pages']) ? true : false);
24
+ $tptn_settings[count_on_pages] = (($_POST['count_on_pages']) ? true : false);
25
  $tptn_settings[track_authors] = (($_POST['track_authors']) ? true : false);
26
  $tptn_settings[pv_in_admin] = (($_POST['pv_in_admin']) ? true : false);
27
  $tptn_settings[disp_list_count] = (($_POST['disp_list_count']) ? true : false);
30
 
31
  update_option('ald_tptn_settings', $tptn_settings);
32
 
33
+ $str = '<div id="message" class="updated fade"><p>'. __('Options saved successfully.',TPTN_LOCAL_NAME) .'</p></div>';
34
  echo $str;
35
  }
36
 
39
  $tptn_settings = tptn_default_options();
40
  update_option('ald_tptn_settings', $tptn_settings);
41
 
42
+ $str = '<div id="message" class="updated fade"><p>'. __('Options set to Default.',TPTN_LOCAL_NAME) .'</p></div>';
43
  echo $str;
44
  }
45
  ?>
50
  <fieldset class="options">
51
  <legend>
52
  <h3>
53
+ <?php _e('Support the Development',TPTN_LOCAL_NAME); ?>
54
  </h3>
55
  </legend>
56
  <p>
57
+ <?php _e('If you find ',TPTN_LOCAL_NAME); ?>
58
  <a href="http://ajaydsouza.com/wordpress/plugins/top-10/">Top 10</a>
59
+ <?php _e('useful, please do',TPTN_LOCAL_NAME); ?>
60
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=donate@ajaydsouza.com&amp;item_name=Top%10%20(From%20WP-Admin)&amp;no_shipping=1&amp;return=http://ajaydsouza.com/wordpress/plugins/top-10/&amp;cancel_return=http://ajaydsouza.com/wordpress/plugins/top-10/&amp;cn=Note%20to%20Author&amp;tax=0&amp;currency_code=USD&amp;bn=PP-DonationsBF&amp;charset=UTF-8" title="Donate via PayPal"><?php _e('drop in your contribution',TPTN_LOCAL_NAME); ?></a>.
61
+ (<a href="http://ajaydsouza.com/donate/"><?php _e('Some reasons why you should.',TPTN_LOCAL_NAME); ?></a>)</p>
62
  </fieldset>
63
  </div>
64
  <form method="post" id="tptn_options" name="tptn_options" style="border: #ccc 1px solid; padding: 10px">
65
  <fieldset class="options">
66
  <legend>
67
  <h3>
68
+ <?php _e('Options:',TPTN_LOCAL_NAME); ?>
69
  </h3>
70
  </legend>
71
  <p>
72
  <label>
73
+ <?php _e('Format to display the count in: ',TPTN_LOCAL_NAME); ?><br />
74
  <textarea name="count_disp_form" id="count_disp_form" cols="50" rows="5"><?php echo htmlspecialchars(stripslashes($tptn_settings[count_disp_form])); ?></textarea>
75
  </label>
76
  </p>
77
+ <p><?php _e('Use <code>%totalcount%</code> to display the total count and <code>%dailycount%</code> to display the daily count. e.g. the default options displays <code>(Visited 123 times, 23 visits today)</code>',TPTN_LOCAL_NAME); ?></p>
78
  <p>
79
  <label>
80
+ <?php _e('Number of popular posts to display: ',TPTN_LOCAL_NAME); ?>
81
  <input type="textbox" name="limit" id="limit" value="<?php echo stripslashes($tptn_settings[limit]); ?>">
82
  </label>
83
  </p>
84
  <p>
85
  <label>
86
+ <?php _e('Title of popular posts: ',TPTN_LOCAL_NAME); ?>
87
  <input type="textbox" name="title" id="title" value="<?php echo stripslashes($tptn_settings[title]); ?>">
88
  </label>
89
  </p>
90
  <p>
91
  <label>
92
+ <?php _e('Title of daily popular posts: ',TPTN_LOCAL_NAME); ?>
93
  <input type="textbox" name="title_daily" id="title_daily" value="<?php echo stripslashes($tptn_settings[title_daily]); ?>">
94
  </label>
95
  </p>
96
  <p>
97
  <label>
98
+ <?php _e('Daily Popular should contain views of how many days? ',TPTN_LOCAL_NAME); ?>
99
  <input type="textbox" name="daily_range" id="daily_range" size="3" value="<?php echo stripslashes($tptn_settings[daily_range]); ?>">
100
  </label>
101
  </p>
102
  <p>
103
  <label>
104
  <input type="checkbox" name="exclude_pages" id="exclude_pages" <?php if ($tptn_settings[exclude_pages]) echo 'checked="checked"' ?> />
105
+ <?php _e('Exclude Pages in display of Popular Posts? Number of views on Pages will continue to be counted.',TPTN_LOCAL_NAME); ?>
106
  </label>
107
  </p>
108
  <p>
109
  <label>
110
+ <input type="checkbox" name="add_to_content" id="add_to_content" <?php if ($tptn_settings[add_to_content]) echo 'checked="checked"' ?> />
111
+ <?php _e('Display number of views on posts?',TPTN_LOCAL_NAME); ?>
112
  </label>
113
  </p>
114
  <p>
115
  <label>
116
+ <input type="checkbox" name="count_on_pages" id="count_on_pages" <?php if ($tptn_settings[count_on_pages]) echo 'checked="checked"' ?> />
117
+ <?php _e('Display number of views on pages?',TPTN_LOCAL_NAME); ?>
118
  </label>
119
  </p>
120
  <p>
121
  <label>
122
+ <input type="checkbox" name="track_authors" id="track_authors" <?php if ($tptn_settings[track_authors]) echo 'checked="checked"' ?> />
123
+ <?php _e('Track visits of authors on their own posts?',TPTN_LOCAL_NAME); ?>
124
  </label>
125
  </p>
126
  <p>
127
  <label>
128
+ <input type="checkbox" name="disp_list_count" id="disp_list_count" <?php if ($tptn_settings[disp_list_count]) echo 'checked="checked"' ?> />
129
+ <?php _e('Display number of page views in popular lists?',TPTN_LOCAL_NAME); ?>
130
  </label>
131
  </p>
132
  <p>
133
  <label>
134
+ <input type="checkbox" name="d_use_js" id="d_use_js" <?php if ($tptn_settings[d_use_js]) echo 'checked="checked"' ?> />
135
+ <?php _e('Force daily posts\' list to be dynamic? This options uses JavaScript to load the post and can increase your page load time',TPTN_LOCAL_NAME); ?>
136
+ </label>
137
+ </p>
138
+ <p>
139
+ <label>
140
+ <input type="checkbox" name="pv_in_admin" id="pv_in_admin" <?php if ($tptn_settings[pv_in_admin]) echo 'checked="checked"' ?> />
141
+ <?php _e('Display page views on Edit posts/pages in WP-Admin? An extra column is added with the count',TPTN_LOCAL_NAME); ?>
142
  </label>
143
  </p>
144
  <p>
145
  <label>
146
  <input type="checkbox" name="show_credit" id="show_credit" <?php if ($tptn_settings[show_credit]) echo 'checked="checked"' ?> />
147
+ <?php _e('A link to the plugin is added as an extra list item to the list of popular posts. Not mandatory, but thanks if you do it!',TPTN_LOCAL_NAME); ?>
148
  </label>
149
  </p>
150
  <p>
151
  <input type="submit" name="tptn_save" id="tptn_save" value="Save Options" style="border:#00CC00 1px solid" />
152
+ <input name="tptn_default" type="submit" id="tptn_default" value="Default Options" style="border:#FF0000 1px solid" onclick="if (!confirm('<?php _e('Do you want to set options to Default?',TPTN_LOCAL_NAME); ?>')) return false;" />
153
  </p>
154
  </fieldset>
155
  </form>
165
 
166
  echo '<div class="wrap">';
167
  echo '<h2>';
168
+ if (!$daily) _e('Popular Posts',TPTN_LOCAL_NAME); else _e('Daily Popular Posts',TPTN_LOCAL_NAME);
169
  echo '</h2>';
170
  echo '<div style="border: #ccc 1px solid; padding: 10px">';
171
  echo tptn_pop_display($daily,$paged,$limit);
188
  }
189
 
190
  if ((function_exists('add_options_page'))&&($tptn_is_admin)) {
191
+ add_options_page(__("Top 10", TPTN_LOCAL_NAME), __("Top 10", TPTN_LOCAL_NAME), 9, 'tptn_options', 'tptn_options');
192
+ add_posts_page(__("Popular Posts", TPTN_LOCAL_NAME), __("Top 10", TPTN_LOCAL_NAME), 9, 'tptn_manage', 'tptn_manage');
193
  }
194
  }
195
  add_action('admin_menu', 'tptn_adminmenu');
268
  $output = '<div id="tptn_popular_posts">';
269
  $output .= '<table width="100%" border="0">
270
  <tr>
271
+ <td width="50%" align="left">';
272
+ $output .= __('Results',TPTN_LOCAL_NAME);
273
+ $output .= ' <strong>'.$first.'</strong> - <strong>'.$last.'</strong> ';
274
+ $output .= __('of',TPTN_LOCAL_NAME);
275
+ $output .= ' <strong>'.$numrows.'</strong>
276
  </td>
277
+ <td width="50%" align="right">';
278
+ $output .= __('Page',TPTN_LOCAL_NAME);
279
+ $output .= ' <strong>'.$current.'</strong> ';
280
+ $output .= __('of',TPTN_LOCAL_NAME);
281
+ $output .= ' <strong>'.$total.'</strong>
282
  </td>
283
  </tr>
284
  <tr>
288
  <td align="left">';
289
 
290
  if(!$daily) {
291
+ $output .= '<a href="./edit.php?page=tptn_manage&daily=1">';
292
+ $output .= __('View Daily Popular Posts',TPTN_LOCAL_NAME);
293
+ $output .= '</a></td>';
294
  } else {
295
+ $output .= '<a href="./edit.php?page=tptn_manage&daily=0">';
296
+ $output .= __('View Overall Popular Posts',TPTN_LOCAL_NAME);
297
+ $output .= '</a></td>';
298
  }
299
+ $output .= '<td align="right">';
300
+ $output .= __('Results per-page:',TPTN_LOCAL_NAME);
301
+ $output .= ' <a href="./edit.php?page=tptn_manage&daily='.$daily.'&limit=10">10</a> | <a href="./edit.php?page=tptn_manage&daily='.$daily.'&limit=20">20</a> | <a href="./edit.php?page=tptn_manage&daily='.$daily.'&limit=50">50</a> | <a href="./edit.php?page=tptn_manage&daily='.$daily.'&limit=100">100</a>
302
  </td>
303
  </tr>
304
  <tr>
320
  $output .= '<p align="center">';
321
  if ($page != 0) { // Don't show back link if current page is first page.
322
  $back_page = $page - $limit;
323
+ $output .= "<a href=\"./edit.php?page=tptn_manage&paged=$back_page&daily=$daily&limit=$limit\">&laquo; ";
324
+ $output .= __('Previous',TPTN_LOCAL_NAME);
325
+ $output .= "</a>\n";
326
  }
327
 
328
  for ($i=1; $i <= $pages; $i++) // loop through each page and give link to it.
329
  {
330
  $ppage = $limit*($i - 1);
331
  if ($ppage == $page){
332
+ $output .= "<b>$i</b>\n";
333
+ } // If current page don't give link, just text.
334
  else{
335
+ $output .= "<a href=\"./edit.php?page=tptn_manage&paged=$ppage&daily=$daily&limit=$limit\">$i</a> \n";
336
  }
337
  }
338
 
339
  if (!((($page+$limit) / $limit) >= $pages) && $pages != 1) { // If last page don't give next link.
340
  $next_page = $page + $limit;
341
+ $output .= "<a href=\"./edit.php?page=tptn_manage&paged=$next_page&daily=$daily&limit=$limit\">";
342
+ $output .= __('Next',TPTN_LOCAL_NAME);
343
+ $output .= " &raquo;</a>";
344
  }
345
  $output .= '</p>';
346
  $output .= '<p style="text-align:center;border-top: #000 1px solid">Popular posts by <a href="http://ajaydsouza.com/wordpress/plugins/top-10/">Top 10 plugin</a></p>';
361
 
362
  function tptn_pop_dashboard_setup() {
363
  if (function_exists('wp_add_dashboard_widget')) {
364
+ wp_add_dashboard_widget( 'tptn_pop_dashboard', __( 'Popular Posts',TPTN_LOCAL_NAME ), 'tptn_pop_dashboard' );
365
+ wp_add_dashboard_widget( 'tptn_pop_daily_dashboard', __( 'Daily Popular',TPTN_LOCAL_NAME ), 'tptn_pop_daily_dashboard' );
366
  }
367
  }
368
  add_action('wp_dashboard_setup', 'tptn_pop_dashboard_setup');
373
  function tptn_column($cols) {
374
  $tptn_settings = tptn_read_options();
375
 
376
+ if ($tptn_settings[pv_in_admin]) $cols['tptn'] = __('Total / Today\'s Views',TPTN_LOCAL_NAME);
377
  return $cols;
378
  }
379
 
languages/tptn-en_US.mo ADDED
Binary file
languages/tptn-en_US.po ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Top 10\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2009-07-26 23:48+0530\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Ajay D'Souza <me@ajaydsouza.com>\n"
8
+ "Language-Team: Ajay D'Souza <me@ajaydsouza.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-Language: English\n"
13
+ "X-Poedit-KeywordsList: _e;__\n"
14
+ "X-Poedit-Basepath: ../\n"
15
+ "X-Poedit-SearchPath-0: .\n"
16
+
17
+ #: admin.inc.php:33
18
+ msgid "Options saved successfully."
19
+ msgstr ""
20
+
21
+ #: admin.inc.php:42
22
+ msgid "Options set to Default."
23
+ msgstr ""
24
+
25
+ #: admin.inc.php:53
26
+ msgid "Support the Development"
27
+ msgstr ""
28
+
29
+ #: admin.inc.php:57
30
+ msgid "If you find "
31
+ msgstr ""
32
+
33
+ #: admin.inc.php:59
34
+ msgid "useful, please do"
35
+ msgstr ""
36
+
37
+ #: admin.inc.php:60
38
+ msgid "drop in your contribution"
39
+ msgstr ""
40
+
41
+ #: admin.inc.php:61
42
+ msgid "Some reasons why you should."
43
+ msgstr ""
44
+
45
+ #: admin.inc.php:68
46
+ msgid "Options:"
47
+ msgstr ""
48
+
49
+ #: admin.inc.php:73
50
+ msgid "Format to display the count in: "
51
+ msgstr ""
52
+
53
+ #: admin.inc.php:77
54
+ msgid "Use <code>%totalcount%</code> to display the total count and <code>%dailycount%</code> to display the daily count. e.g. the default options displays <code>(Visited 123 times, 23 visits today)</code>"
55
+ msgstr ""
56
+
57
+ #: admin.inc.php:80
58
+ msgid "Number of popular posts to display: "
59
+ msgstr ""
60
+
61
+ #: admin.inc.php:86
62
+ msgid "Title of popular posts: "
63
+ msgstr ""
64
+
65
+ #: admin.inc.php:92
66
+ msgid "Title of daily popular posts: "
67
+ msgstr ""
68
+
69
+ #: admin.inc.php:98
70
+ msgid "Daily Popular should contain views of how many days? "
71
+ msgstr ""
72
+
73
+ #: admin.inc.php:105
74
+ msgid "Exclude Pages in display of Popular Posts? Number of views on Pages will continue to be counted."
75
+ msgstr ""
76
+
77
+ #: admin.inc.php:111
78
+ msgid "Display number of views on posts?"
79
+ msgstr ""
80
+
81
+ #: admin.inc.php:117
82
+ msgid "Display number of views on pages?"
83
+ msgstr ""
84
+
85
+ #: admin.inc.php:123
86
+ msgid "Track visits of authors on their own posts?"
87
+ msgstr ""
88
+
89
+ #: admin.inc.php:129
90
+ msgid "Display number of page views in popular lists?"
91
+ msgstr ""
92
+
93
+ #: admin.inc.php:135
94
+ msgid "Force daily posts' list to be dynamic? This options uses JavaScript to load the post and can increase your page load time"
95
+ msgstr ""
96
+
97
+ #: admin.inc.php:141
98
+ msgid "Display page views on Edit posts/pages in WP-Admin? An extra column is added with the count"
99
+ msgstr ""
100
+
101
+ #: admin.inc.php:147
102
+ msgid "A link to the plugin is added as an extra list item to the list of popular posts. Not mandatory, but thanks if you do it!"
103
+ msgstr ""
104
+
105
+ #: admin.inc.php:152
106
+ msgid "Do you want to set options to Default?"
107
+ msgstr ""
108
+
109
+ #: admin.inc.php:168
110
+ #: admin.inc.php:192
111
+ #: admin.inc.php:364
112
+ #: top-10.php:354
113
+ #: top-10.php:373
114
+ msgid "Popular Posts"
115
+ msgstr ""
116
+
117
+ #: admin.inc.php:168
118
+ msgid "Daily Popular Posts"
119
+ msgstr ""
120
+
121
+ #: admin.inc.php:191
122
+ #: admin.inc.php:192
123
+ msgid "Top 10"
124
+ msgstr ""
125
+
126
+ #: admin.inc.php:272
127
+ msgid "Results"
128
+ msgstr ""
129
+
130
+ #: admin.inc.php:274
131
+ #: admin.inc.php:280
132
+ msgid "of"
133
+ msgstr ""
134
+
135
+ #: admin.inc.php:278
136
+ msgid "Page"
137
+ msgstr ""
138
+
139
+ #: admin.inc.php:292
140
+ msgid "View Daily Popular Posts"
141
+ msgstr ""
142
+
143
+ #: admin.inc.php:296
144
+ msgid "View Overall Popular Posts"
145
+ msgstr ""
146
+
147
+ #: admin.inc.php:300
148
+ msgid "Results per-page:"
149
+ msgstr ""
150
+
151
+ #: admin.inc.php:324
152
+ msgid "Previous"
153
+ msgstr ""
154
+
155
+ #: admin.inc.php:342
156
+ msgid "Next"
157
+ msgstr ""
158
+
159
+ #: admin.inc.php:365
160
+ #: top-10.php:303
161
+ #: top-10.php:374
162
+ msgid "Daily Popular"
163
+ msgstr ""
164
+
165
+ #: admin.inc.php:376
166
+ msgid "Total / Today's Views"
167
+ msgstr ""
168
+
169
+ #: top-10.php:156
170
+ msgid "<h3>Popular Posts</h3>"
171
+ msgstr ""
172
+
173
+ #: top-10.php:157
174
+ msgid "<h3>Daily Popular</h3>"
175
+ msgstr ""
176
+
languages/tptn-en_US.pot ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Top 10\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2009-07-26 23:48+0530\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Ajay D'Souza <me@ajaydsouza.com>\n"
8
+ "Language-Team: Ajay D'Souza <me@ajaydsouza.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-Language: English\n"
13
+ "X-Poedit-KeywordsList: _e;__\n"
14
+ "X-Poedit-Basepath: ../\n"
15
+ "X-Poedit-SearchPath-0: .\n"
16
+
17
+ #: admin.inc.php:33
18
+ msgid "Options saved successfully."
19
+ msgstr ""
20
+
21
+ #: admin.inc.php:42
22
+ msgid "Options set to Default."
23
+ msgstr ""
24
+
25
+ #: admin.inc.php:53
26
+ msgid "Support the Development"
27
+ msgstr ""
28
+
29
+ #: admin.inc.php:57
30
+ msgid "If you find "
31
+ msgstr ""
32
+
33
+ #: admin.inc.php:59
34
+ msgid "useful, please do"
35
+ msgstr ""
36
+
37
+ #: admin.inc.php:60
38
+ msgid "drop in your contribution"
39
+ msgstr ""
40
+
41
+ #: admin.inc.php:61
42
+ msgid "Some reasons why you should."
43
+ msgstr ""
44
+
45
+ #: admin.inc.php:68
46
+ msgid "Options:"
47
+ msgstr ""
48
+
49
+ #: admin.inc.php:73
50
+ msgid "Format to display the count in: "
51
+ msgstr ""
52
+
53
+ #: admin.inc.php:77
54
+ msgid "Use <code>%totalcount%</code> to display the total count and <code>%dailycount%</code> to display the daily count. e.g. the default options displays <code>(Visited 123 times, 23 visits today)</code>"
55
+ msgstr ""
56
+
57
+ #: admin.inc.php:80
58
+ msgid "Number of popular posts to display: "
59
+ msgstr ""
60
+
61
+ #: admin.inc.php:86
62
+ msgid "Title of popular posts: "
63
+ msgstr ""
64
+
65
+ #: admin.inc.php:92
66
+ msgid "Title of daily popular posts: "
67
+ msgstr ""
68
+
69
+ #: admin.inc.php:98
70
+ msgid "Daily Popular should contain views of how many days? "
71
+ msgstr ""
72
+
73
+ #: admin.inc.php:105
74
+ msgid "Exclude Pages in display of Popular Posts? Number of views on Pages will continue to be counted."
75
+ msgstr ""
76
+
77
+ #: admin.inc.php:111
78
+ msgid "Display number of views on posts?"
79
+ msgstr ""
80
+
81
+ #: admin.inc.php:117
82
+ msgid "Display number of views on pages?"
83
+ msgstr ""
84
+
85
+ #: admin.inc.php:123
86
+ msgid "Track visits of authors on their own posts?"
87
+ msgstr ""
88
+
89
+ #: admin.inc.php:129
90
+ msgid "Display number of page views in popular lists?"
91
+ msgstr ""
92
+
93
+ #: admin.inc.php:135
94
+ msgid "Force daily posts' list to be dynamic? This options uses JavaScript to load the post and can increase your page load time"
95
+ msgstr ""
96
+
97
+ #: admin.inc.php:141
98
+ msgid "Display page views on Edit posts/pages in WP-Admin? An extra column is added with the count"
99
+ msgstr ""
100
+
101
+ #: admin.inc.php:147
102
+ msgid "A link to the plugin is added as an extra list item to the list of popular posts. Not mandatory, but thanks if you do it!"
103
+ msgstr ""
104
+
105
+ #: admin.inc.php:152
106
+ msgid "Do you want to set options to Default?"
107
+ msgstr ""
108
+
109
+ #: admin.inc.php:168
110
+ #: admin.inc.php:192
111
+ #: admin.inc.php:364
112
+ #: top-10.php:354
113
+ #: top-10.php:373
114
+ msgid "Popular Posts"
115
+ msgstr ""
116
+
117
+ #: admin.inc.php:168
118
+ msgid "Daily Popular Posts"
119
+ msgstr ""
120
+
121
+ #: admin.inc.php:191
122
+ #: admin.inc.php:192
123
+ msgid "Top 10"
124
+ msgstr ""
125
+
126
+ #: admin.inc.php:272
127
+ msgid "Results"
128
+ msgstr ""
129
+
130
+ #: admin.inc.php:274
131
+ #: admin.inc.php:280
132
+ msgid "of"
133
+ msgstr ""
134
+
135
+ #: admin.inc.php:278
136
+ msgid "Page"
137
+ msgstr ""
138
+
139
+ #: admin.inc.php:292
140
+ msgid "View Daily Popular Posts"
141
+ msgstr ""
142
+
143
+ #: admin.inc.php:296
144
+ msgid "View Overall Popular Posts"
145
+ msgstr ""
146
+
147
+ #: admin.inc.php:300
148
+ msgid "Results per-page:"
149
+ msgstr ""
150
+
151
+ #: admin.inc.php:324
152
+ msgid "Previous"
153
+ msgstr ""
154
+
155
+ #: admin.inc.php:342
156
+ msgid "Next"
157
+ msgstr ""
158
+
159
+ #: admin.inc.php:365
160
+ #: top-10.php:303
161
+ #: top-10.php:374
162
+ msgid "Daily Popular"
163
+ msgstr ""
164
+
165
+ #: admin.inc.php:376
166
+ msgid "Total / Today's Views"
167
+ msgstr ""
168
+
169
+ #: top-10.php:156
170
+ msgid "<h3>Popular Posts</h3>"
171
+ msgstr ""
172
+
173
+ #: top-10.php:157
174
+ msgid "<h3>Daily Popular</h3>"
175
+ msgstr ""
176
+
languages/tptn-it_IT.mo ADDED
Binary file
languages/tptn-it_IT.po ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Top 10 in italiano\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2009-07-26 23:48+0530\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Gianni Diurno (aka gidibao) <gidibao@gmail.com>\n"
8
+ "Language-Team: Gianni Diurno | http://gidibao.net/ <gidibao@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
+ "X-Poedit-Language: Italian\n"
13
+ "X-Poedit-KeywordsList: _e;__\n"
14
+ "X-Poedit-Basepath: ../\n"
15
+ "X-Poedit-Country: ITALY\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: admin.inc.php:33
19
+ msgid "Options saved successfully."
20
+ msgstr "Le opzioni sono state salvate con successo."
21
+
22
+ #: admin.inc.php:42
23
+ msgid "Options set to Default."
24
+ msgstr "Opzioni impostate alle predefinite."
25
+
26
+ #: admin.inc.php:53
27
+ msgid "Support the Development"
28
+ msgstr "Sostieni lo sviluppo"
29
+
30
+ #: admin.inc.php:57
31
+ msgid "If you find "
32
+ msgstr "Avessi trovato utile il mio"
33
+
34
+ #: admin.inc.php:59
35
+ msgid "useful, please do"
36
+ msgstr ", effettua"
37
+
38
+ #: admin.inc.php:60
39
+ msgid "drop in your contribution"
40
+ msgstr "una donazione"
41
+
42
+ #: admin.inc.php:61
43
+ msgid "Some reasons why you should."
44
+ msgstr "alcuni motivi affinché tu lo faccia"
45
+
46
+ #: admin.inc.php:68
47
+ msgid "Options:"
48
+ msgstr "Opzioni:"
49
+
50
+ #: admin.inc.php:73
51
+ msgid "Format to display the count in: "
52
+ msgstr "Formato per il conteggio:"
53
+
54
+ #: admin.inc.php:77
55
+ msgid "Use <code>%totalcount%</code> to display the total count and <code>%dailycount%</code> to display the daily count. e.g. the default options displays <code>(Visited 123 times, 23 visits today)</code>"
56
+ msgstr "Utilizza <code>%totalcount%</code> per potere mostrare il computo totale e <code>%dailycount%</code> per visualizzare quello del giorno corrente. Ad esempio, le opzioni predefinite verranno mostrate online con un <code>(letto 123 volte, 23 visite odierne)</code>"
57
+
58
+ #: admin.inc.php:80
59
+ msgid "Number of popular posts to display: "
60
+ msgstr "Numero degli articoli più popolari da mostrare:"
61
+
62
+ #: admin.inc.php:86
63
+ msgid "Title of popular posts: "
64
+ msgstr "Titolo per gli articoli più popolari:"
65
+
66
+ #: admin.inc.php:92
67
+ msgid "Title of daily popular posts: "
68
+ msgstr "Titolo per gli articoli più popolari del giorno:"
69
+
70
+ #: admin.inc.php:98
71
+ msgid "Daily Popular should contain views of how many days? "
72
+ msgstr "Quanti giorni desideri siano considerati per il computo delle visualizzazioni per articoli più popolari del giorno?"
73
+
74
+ #: admin.inc.php:105
75
+ msgid "Exclude Pages in display of Popular Posts? Number of views on Pages will continue to be counted."
76
+ msgstr "Desideri escludere le pagine dalla visualizzazione per gli articoli più popolari? Il numero delle visualizzazioni continuerà ad essere comunque aggiornato."
77
+
78
+ #: admin.inc.php:111
79
+ msgid "Display number of views on posts?"
80
+ msgstr "Desideri mostrare il numero delle visualizzazioni negli articoli?"
81
+
82
+ #: admin.inc.php:117
83
+ msgid "Display number of views on pages?"
84
+ msgstr "Desideri mostrare il numero delle visualizzazioni nelle pagine?"
85
+
86
+ #: admin.inc.php:123
87
+ msgid "Track visits of authors on their own posts?"
88
+ msgstr "Desideri che vengano conteggiate anche le visite da parte dell'amministatore del sito?"
89
+
90
+ #: admin.inc.php:129
91
+ msgid "Display number of page views in popular lists?"
92
+ msgstr "Desideri mostrare il numero delle visualizzazioni per pagina nella lista dei più popolari?"
93
+
94
+ #: admin.inc.php:135
95
+ msgid "Force daily posts' list to be dynamic? This options uses JavaScript to load the post and can increase your page load time"
96
+ msgstr "Desideri che la lista degli articoli odierni sia dinamica? Questa opzione utilizza un JavaScript per il caricamento dell'articolo e di conseguenza potrà fare aumentare i tempi di caricamento della stessa pagina"
97
+
98
+ #: admin.inc.php:141
99
+ msgid "Display page views on Edit posts/pages in WP-Admin? An extra column is added with the count"
100
+ msgstr "Desideri mostrare il totale delle visualizzazioni sotto Modifica Articoli/Pagine in WP-Admin? Se sì, verrà aggiunta una nuova sezione (a nome Top 10) con i conteggi nel dettaglio"
101
+
102
+ #: admin.inc.php:147
103
+ msgid "A link to the plugin is added as an extra list item to the list of popular posts. Not mandatory, but thanks if you do it!"
104
+ msgstr "Nella lista dei tuoi articoli più popolari é stato aggiunto un link alla pagina del plugin. Ti sarei molto grato qualora non disattivassi questa opzione!"
105
+
106
+ #: admin.inc.php:152
107
+ msgid "Do you want to set options to Default?"
108
+ msgstr "Desideri ripristinare alle predefinite?"
109
+
110
+ #: admin.inc.php:168
111
+ #: admin.inc.php:192
112
+ #: admin.inc.php:364
113
+ #: top-10.php:354
114
+ #: top-10.php:373
115
+ msgid "Popular Posts"
116
+ msgstr "Gli articoli più popolari"
117
+
118
+ #: admin.inc.php:168
119
+ msgid "Daily Popular Posts"
120
+ msgstr "Gli articoli più popolari di oggi"
121
+
122
+ #: admin.inc.php:191
123
+ #: admin.inc.php:192
124
+ msgid "Top 10"
125
+ msgstr "Top 10"
126
+
127
+ #: admin.inc.php:272
128
+ msgid "Results"
129
+ msgstr "Risultati"
130
+
131
+ #: admin.inc.php:274
132
+ #: admin.inc.php:280
133
+ msgid "of"
134
+ msgstr "di"
135
+
136
+ #: admin.inc.php:278
137
+ msgid "Page"
138
+ msgstr "Pagina"
139
+
140
+ #: admin.inc.php:292
141
+ msgid "View Daily Popular Posts"
142
+ msgstr "Visualizza gli articoli più letti di oggi"
143
+
144
+ #: admin.inc.php:296
145
+ msgid "View Overall Popular Posts"
146
+ msgstr "Visualizza panoramica articoli più popolari"
147
+
148
+ #: admin.inc.php:300
149
+ msgid "Results per-page:"
150
+ msgstr "Risultati per pagina:"
151
+
152
+ #: admin.inc.php:324
153
+ msgid "Previous"
154
+ msgstr "Precedente"
155
+
156
+ #: admin.inc.php:342
157
+ msgid "Next"
158
+ msgstr "Successiva"
159
+
160
+ #: admin.inc.php:365
161
+ #: top-10.php:303
162
+ #: top-10.php:374
163
+ msgid "Daily Popular"
164
+ msgstr "I più letti di oggi"
165
+
166
+ #: admin.inc.php:376
167
+ msgid "Total / Today's Views"
168
+ msgstr "Totale / Visualizzazioni odierne"
169
+
170
+ #: top-10.php:156
171
+ msgid "<h3>Popular Posts</h3>"
172
+ msgstr "<h3>Articoli più letti</h3>"
173
+
174
+ #: top-10.php:157
175
+ msgid "<h3>Daily Popular</h3>"
176
+ msgstr "<h3>I più letti di oggi</h3>"
177
+
languages/tptn-ru_RU.mo ADDED
Binary file
languages/tptn-ru_RU.po ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Топ 10\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2009-07-26 23:48+0530\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: \n"
8
+ "Language-Team: Elvis (fweb.org.ru) <kopper@rkmail.ru>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-Language: Russian\n"
13
+ "X-Poedit-Country: RUSSIAN FEDERATION\n"
14
+
15
+ #: admin.inc.php:33
16
+ msgid "Options saved successfully."
17
+ msgstr "Настройки сохранены."
18
+
19
+ #: admin.inc.php:42
20
+ msgid "Options set to Default."
21
+ msgstr "Настройки сброшены."
22
+
23
+ #: admin.inc.php:53
24
+ msgid "Support the Development"
25
+ msgstr "Поддержите создателя плагина"
26
+
27
+ #: admin.inc.php:57
28
+ msgid "If you find "
29
+ msgstr "Если вы считаете плагин"
30
+
31
+ #: admin.inc.php:59
32
+ msgid "useful, please do"
33
+ msgstr "полезным, пожалуйста, сделайте"
34
+
35
+ #: admin.inc.php:60
36
+ msgid "drop in your contribution"
37
+ msgstr "пожертвование"
38
+
39
+ #: admin.inc.php:61
40
+ msgid "Some reasons why you should."
41
+ msgstr "Несколько причин сделать это."
42
+
43
+ #: admin.inc.php:68
44
+ msgid "Options:"
45
+ msgstr "Настройки плагина:"
46
+
47
+ #: admin.inc.php:73
48
+ msgid "Format to display the count in: "
49
+ msgstr "Формат отображения количества просмотров:"
50
+
51
+ #: admin.inc.php:77
52
+ msgid "Use <code>%totalcount%</code> to display the total count and <code>%dailycount%</code> to display the daily count. e.g. the default options displays <code>(Visited 123 times, 23 visits today)</code>"
53
+ msgstr "Используйте <code>%totalcount%</code> чтобы показывать общее число просмотров, а <code>%dailycount%</code> - просмотры за сутки. Например: <code>(Просмотрена 123 раз, 23 раза просмотра сегодня)</code>"
54
+
55
+ #: admin.inc.php:80
56
+ msgid "Number of popular posts to display: "
57
+ msgstr "Количество Популярных записей в списке:"
58
+
59
+ #: admin.inc.php:86
60
+ msgid "Title of popular posts: "
61
+ msgstr "Заголовок блока Популярных записей:"
62
+
63
+ #: admin.inc.php:92
64
+ msgid "Title of daily popular posts: "
65
+ msgstr "Заголовок блока Популярных сегодня записей:"
66
+
67
+ #: admin.inc.php:98
68
+ msgid "Daily Popular should contain views of how many days? "
69
+ msgstr "За сколько дней считать просмотры для записей, Популярных сегодня?"
70
+
71
+ #: admin.inc.php:105
72
+ msgid "Exclude Pages in display of Popular Posts? Number of views on Pages will continue to be counted."
73
+ msgstr "Исключить страницы из списка Популярных записей? Количество просмотров для страниц будет подсчитываться."
74
+
75
+ #: admin.inc.php:111
76
+ msgid "Display number of views on posts?"
77
+ msgstr "Показывать количество просмотров записи в ее \"теле\"?"
78
+
79
+ #: admin.inc.php:117
80
+ msgid "Display number of views on pages?"
81
+ msgstr "Показывать количество просмотров страницы в ее \"теле\"?"
82
+
83
+ #: admin.inc.php:123
84
+ msgid "Track visits of authors on their own posts?"
85
+ msgstr "Учитывать просмотры записей, сделанные их же авторами?"
86
+
87
+ #: admin.inc.php:129
88
+ msgid "Display number of page views in popular lists?"
89
+ msgstr "Показывать количество просмотров записей/страниц в списке Популярных записей?"
90
+
91
+ #: admin.inc.php:135
92
+ msgid "Force daily posts' list to be dynamic? This options uses JavaScript to load the post and can increase your page load time"
93
+ msgstr "Сделать список Популярных записей динамичным? Опция использует JavaScript , и это может увеличить время загрузки страниц"
94
+
95
+ #: admin.inc.php:141
96
+ msgid "Display page views on Edit posts/pages in WP-Admin? An extra column is added with the count"
97
+ msgstr "Отображать количество просмотров записей/страниц в админке? Для этого будет добавлена отдельная колонка"
98
+
99
+ #: admin.inc.php:147
100
+ msgid "A link to the plugin is added as an extra list item to the list of popular posts. Not mandatory, but thanks if you do it!"
101
+ msgstr "Ссылка на плагин будет добавлена к спискам Популярных записей. Мы будем благодарны Вам, если Вы ее все же оставите!"
102
+
103
+ #: admin.inc.php:152
104
+ msgid "Do you want to set options to Default?"
105
+ msgstr "Сбросить настройки плагина?"
106
+
107
+ #: admin.inc.php:168
108
+ #: admin.inc.php:192
109
+ #: admin.inc.php:364
110
+ #: top-10.php:354
111
+ #: top-10.php:373
112
+ msgid "Popular Posts"
113
+ msgstr "Популярные записи"
114
+
115
+ #: admin.inc.php:168
116
+ msgid "Daily Popular Posts"
117
+ msgstr "Популярные сегодня записи"
118
+
119
+ #: admin.inc.php:191
120
+ #: admin.inc.php:192
121
+ msgid "Top 10"
122
+ msgstr "Топ 10 записей"
123
+
124
+ #: admin.inc.php:272
125
+ msgid "Results"
126
+ msgstr "Результаты"
127
+
128
+ #: admin.inc.php:274
129
+ #: admin.inc.php:280
130
+ msgid "of"
131
+ msgstr "из"
132
+
133
+ #: admin.inc.php:278
134
+ msgid "Page"
135
+ msgstr "Страница"
136
+
137
+ #: admin.inc.php:292
138
+ msgid "View Daily Popular Posts"
139
+ msgstr "Посмотреть все Популярные сегодня записи"
140
+
141
+ #: admin.inc.php:296
142
+ msgid "View Overall Popular Posts"
143
+ msgstr "Посмотреть все Популярные записи"
144
+
145
+ #: admin.inc.php:300
146
+ msgid "Results per-page:"
147
+ msgstr "Результатов на страницу:"
148
+
149
+ #: admin.inc.php:324
150
+ msgid "Previous"
151
+ msgstr "Предыдущая страница"
152
+
153
+ #: admin.inc.php:342
154
+ msgid "Next"
155
+ msgstr "Следующая страница"
156
+
157
+ #: admin.inc.php:365
158
+ #: top-10.php:303
159
+ #: top-10.php:374
160
+ msgid "Daily Popular"
161
+ msgstr "Популярные сегодня записи"
162
+
163
+ #: admin.inc.php:376
164
+ msgid "Total / Today's Views"
165
+ msgstr "Всего / Сегодня просмотров"
166
+
167
+ #: top-10.php:156
168
+ msgid "<h3>Popular Posts</h3>"
169
+ msgstr "<h3>Популярные записи</h3>"
170
+
171
+ #: top-10.php:157
172
+ msgid "<h3>Daily Popular</h3>"
173
+ msgstr "<h3>Популярные сегодня записи</h3>"
174
+
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: Ajay, Mark Ghosh
4
  Donate link: http://ajaydsouza.com/donate/
5
  Stable tag: trunk
6
  Requires at least: 2.5
7
- Tested up to: 2.7.1
8
 
9
 
10
  Track daily and total visits on your blog posts and display the count as well as popular posts.
@@ -26,23 +26,31 @@ Includes a sidebar widget to display the popular posts. And, all settings can be
26
  * Works with caching plugins like WP-Super-Cache
27
 
28
 
29
- = Changelog =
30
-
31
- * 1.3
32
- - "Daily Popular" can now be selected over user selectable number of days.
33
- - Option to turn off display of number of pageviews in popular posts list
34
- - Option to make "Daily Popular" list compatible with caching plugins
35
- - Posts > Top 10 page to view detailed list of popular posts
36
- * 1.2
37
- - Do not display Drafts in Related Posts anymore
38
- - Option to disable tracking author visits on their own posts
39
- - Display top posts for the current day
40
- * 1.1
41
- - Added the Popular Posts sidebar widget in your theme. Find it under <strong>Appearance > Widgets</strong>
42
- - Uses JavaScript by default to count. Hence, better support for different caching plugins
43
- - Change format to display count. Now, a single textarea instead of two text boxes.
44
- - Added WordPress 2.7 Dashboard widget to display popular posts on your Dashboard
45
- * 1.0.1 - Release
 
 
 
 
 
 
 
 
46
 
47
 
48
  == Installation ==
4
  Donate link: http://ajaydsouza.com/donate/
5
  Stable tag: trunk
6
  Requires at least: 2.5
7
+ Tested up to: 2.8.2
8
 
9
 
10
  Track daily and total visits on your blog posts and display the count as well as popular posts.
26
  * Works with caching plugins like WP-Super-Cache
27
 
28
 
29
+ == Changelog ==
30
+
31
+ = 1.4 =
32
+ * Added localisation support
33
+ * Separate options to display number of views on posts and pages
34
+
35
+ = 1.3 =
36
+ * "Daily Popular" can now be selected over user selectable number of days.
37
+ * Option to turn off display of number of pageviews in popular posts list
38
+ * Option to make "Daily Popular" list compatible with caching plugins
39
+ * Posts > Top 10 page to view detailed list of popular posts
40
+
41
+ = 1.2 =
42
+ * Do not display Drafts in Related Posts anymore
43
+ * Option to disable tracking author visits on their own posts
44
+ * Display top posts for the current day
45
+
46
+ = 1.1 =
47
+ * Added the Popular Posts sidebar widget in your theme. Find it under <strong>Appearance > Widgets</strong>
48
+ * Uses JavaScript by default to count. Hence, better support for different caching plugins
49
+ * Change format to display count. Now, a single textarea instead of two text boxes.
50
+ * Added WordPress 2.7 Dashboard widget to display popular posts on your Dashboard
51
+
52
+ = 1.0.1 =
53
+ * Release
54
 
55
 
56
  == Installation ==
top-10-counter.js.php CHANGED
@@ -23,14 +23,14 @@ function tptn_disp_count() {
23
  $id = intval($_GET['top_ten_id']);
24
  if($id > 0) {
25
 
26
- $resultscount = $wpdb->get_row("SELECT postnumber, cntaccess FROM $table_name WHERE postnumber = $id");
27
  $cntaccess = number_format((($resultscount) ? $resultscount->cntaccess : 0));
28
  $count_disp_form = str_replace("%totalcount%", $cntaccess, $count_disp_form);
29
 
30
  // Now process daily count
31
  $daily_range = $tptn_settings[daily_range]. ' DAY';
32
- $current_date = $wpdb->get_var("SELECT DATE_ADD(DATE_SUB(CURDATE(), INTERVAL $daily_range), INTERVAL 1 DAY) ");
33
- $resultscount = $wpdb->get_row("SELECT postnumber, SUM(cntaccess) as sumCount FROM $table_name_daily WHERE postnumber = $id AND dp_date >= '$current_date' GROUP BY postnumber ");
34
  $cntaccess = number_format((($resultscount) ? $resultscount->sumCount : 0));
35
  $count_disp_form = str_replace("%dailycount%", $cntaccess, $count_disp_form);
36
 
23
  $id = intval($_GET['top_ten_id']);
24
  if($id > 0) {
25
 
26
+ $resultscount = $wpdb->get_row("SELECT postnumber, cntaccess FROM ".$table_name." WHERE postnumber = ".$id);
27
  $cntaccess = number_format((($resultscount) ? $resultscount->cntaccess : 0));
28
  $count_disp_form = str_replace("%totalcount%", $cntaccess, $count_disp_form);
29
 
30
  // Now process daily count
31
  $daily_range = $tptn_settings[daily_range]. ' DAY';
32
+ $current_date = $wpdb->get_var("SELECT DATE_ADD(DATE_SUB(CURDATE(), INTERVAL ".$daily_range."), INTERVAL 1 DAY) ");
33
+ $resultscount = $wpdb->get_row("SELECT postnumber, SUM(cntaccess) as sumCount FROM ".$table_name_daily." WHERE postnumber = ".$id." AND dp_date >= '".$current_date."' GROUP BY postnumber ");
34
  $cntaccess = number_format((($resultscount) ? $resultscount->sumCount : 0));
35
  $count_disp_form = str_replace("%dailycount%", $cntaccess, $count_disp_form);
36
 
top-10.php CHANGED
@@ -1,14 +1,17 @@
1
  <?php
2
  /*
3
  Plugin Name: Top 10
4
- Version: 1.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>. <a href="options-general.php?page=tptn_options">Configure...</a>
7
  Author: Ajay D'Souza
8
  Author URI: http://ajaydsouza.com/
9
  */
10
 
11
- //if (!defined('ABSPATH')) die("Aren't you supposed to come here via WP-Admin?");
 
 
 
12
  if (!function_exists('add_action')) {
13
  $wp_root = '../../..';
14
  if (file_exists($wp_root.'/wp-load.php')) {
@@ -22,12 +25,15 @@ global $tptn_db_version;
22
  $tptn_db_version = "2.8";
23
 
24
  function ald_tptn_init() {
25
- load_plugin_textdomain('myald_tptn_plugin', PLUGINDIR.'/'.dirname(plugin_basename(__FILE__)));
 
 
 
 
 
26
  }
27
  add_action('init', 'ald_tptn_init');
28
 
29
- define('ALD_TPTN_DIR', dirname(__FILE__));
30
-
31
  /*********************************************************************
32
  * Main Function (Do not edit) *
33
  ********************************************************************/
@@ -56,14 +62,17 @@ function tptn_pc_content($content) {
56
  $tptn_settings = tptn_read_options();
57
  $id = intval($post->ID);
58
 
59
- if(($single)&&($tptn_settings['add_to_content'])) {
 
 
 
60
  $output = '<script type="text/javascript" src="'.get_bloginfo('wpurl').'/wp-content/plugins/top-10/top-10-counter.js.php?top_ten_id='.$id.'"></script>';
61
  return $content.$output;
62
  } else {
63
  return $content;
64
  }
65
  }
66
- add_filter('the_content', 'tptn_pc_content');
67
 
68
  // Function to manually display count
69
  function echo_tptn_post_count() {
@@ -89,7 +98,7 @@ function tptn_show_pop_posts() {
89
 
90
  $results = $wpdb->get_results($sql);
91
 
92
- echo '<div id="crp_related">'.$tptn_settings['title'];
93
  echo '<ul>';
94
  if ($results) {
95
  foreach ($results as $result) {
@@ -126,7 +135,7 @@ function tptn_show_daily_pop_posts() {
126
 
127
  $results = $wpdb->get_results($sql);
128
 
129
- $output .= '<div id="crp_related">'.$tptn_settings['title_daily'];
130
  $output .= '<ul>';
131
  if ($results) {
132
  foreach ($results as $result) {
@@ -144,13 +153,14 @@ function tptn_show_daily_pop_posts() {
144
 
145
  // Default Options
146
  function tptn_default_options() {
147
- $title = __('<h3>Popular Posts</h3>','ald_tptn_plugin');
148
- $title_daily = __('<h3>Daily Popular</h3>','ald_tptn_plugin');
149
 
150
  $tptn_settings = Array (
151
  show_credit => true, // Add link to plugin page of my blog in top posts list
152
- add_to_content => true, // Add post count to content (only on single pages)
153
  exclude_pages => true, // Exclude Pages
 
154
  track_authors => false, // Track Authors visits
155
  pv_in_admin => true, // Add an extra column on edit posts/pages to display page views?
156
  disp_list_count => true, // Display count in popular lists?
@@ -290,7 +300,7 @@ function widget_tptn_pop_daily($args) {
290
  $tptn_settings = tptn_read_options();
291
  $limit = $tptn_settings['limit'];
292
 
293
- $title = (($tptn_settings['title_daily']) ? strip_tags($tptn_settings['title_daily']) : __('Daily Popular'));
294
  echo $before_widget;
295
  echo $before_title.$title.$after_title;
296
 
@@ -341,7 +351,7 @@ function widget_tptn_pop($args) {
341
 
342
  $results = $wpdb->get_results($sql);
343
 
344
- $title = (($tptn_settings['title']) ? strip_tags($tptn_settings['title']) : __('Popular Posts'));
345
 
346
  echo $before_widget;
347
  echo $before_title.$title.$after_title;
@@ -360,8 +370,8 @@ function widget_tptn_pop($args) {
360
  }
361
 
362
  function init_tptn(){
363
- register_sidebar_widget(__('Popular Posts','ald_tptn_plugin'), 'widget_tptn_pop');
364
- register_sidebar_widget(__('Daily Popular','ald_tptn_plugin'), 'widget_tptn_pop_daily');
365
  }
366
  add_action("plugins_loaded", "init_tptn");
367
 
1
  <?php
2
  /*
3
  Plugin Name: Top 10
4
+ Version: 1.4
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>. <a href="options-general.php?page=tptn_options">Configure...</a>
7
  Author: Ajay D'Souza
8
  Author URI: http://ajaydsouza.com/
9
  */
10
 
11
+ if (!defined('ABSPATH')) die("Aren't you supposed to come here via WP-Admin?");
12
+ define('ALD_TPTN_DIR', dirname(__FILE__));
13
+ define('TPTN_LOCAL_NAME', 'tptn');
14
+
15
  if (!function_exists('add_action')) {
16
  $wp_root = '../../..';
17
  if (file_exists($wp_root.'/wp-load.php')) {
25
  $tptn_db_version = "2.8";
26
 
27
  function ald_tptn_init() {
28
+ //* Begin Localization Code */
29
+ $tc_localizationName = TPTN_LOCAL_NAME;
30
+ $tc_comments_locale = get_locale();
31
+ $tc_comments_mofile = ALD_TPTN_DIR . "/languages/" . $tc_localizationName . "-". $tc_comments_locale.".mo";
32
+ load_textdomain($tc_localizationName, $tc_comments_mofile);
33
+ //* End Localization Code */
34
  }
35
  add_action('init', 'ald_tptn_init');
36
 
 
 
37
  /*********************************************************************
38
  * Main Function (Do not edit) *
39
  ********************************************************************/
62
  $tptn_settings = tptn_read_options();
63
  $id = intval($post->ID);
64
 
65
+ if((is_single())&&($tptn_settings['add_to_content'])) {
66
+ $output = '<script type="text/javascript" src="'.get_bloginfo('wpurl').'/wp-content/plugins/top-10/top-10-counter.js.php?top_ten_id='.$id.'"></script>';
67
+ return $content.$output;
68
+ } elseif((is_page())&&($tptn_settings['count_on_pages'])) {
69
  $output = '<script type="text/javascript" src="'.get_bloginfo('wpurl').'/wp-content/plugins/top-10/top-10-counter.js.php?top_ten_id='.$id.'"></script>';
70
  return $content.$output;
71
  } else {
72
  return $content;
73
  }
74
  }
75
+ add_filter('the_content', 'tptn_pc_content',9001);
76
 
77
  // Function to manually display count
78
  function echo_tptn_post_count() {
98
 
99
  $results = $wpdb->get_results($sql);
100
 
101
+ echo '<div id="tptn_related">'.$tptn_settings['title'];
102
  echo '<ul>';
103
  if ($results) {
104
  foreach ($results as $result) {
135
 
136
  $results = $wpdb->get_results($sql);
137
 
138
+ $output .= '<div id="tptn_related">'.$tptn_settings['title_daily'];
139
  $output .= '<ul>';
140
  if ($results) {
141
  foreach ($results as $result) {
153
 
154
  // Default Options
155
  function tptn_default_options() {
156
+ $title = __('<h3>Popular Posts</h3>',TPTN_LOCAL_NAME);
157
+ $title_daily = __('<h3>Daily Popular</h3>',TPTN_LOCAL_NAME);
158
 
159
  $tptn_settings = Array (
160
  show_credit => true, // Add link to plugin page of my blog in top posts list
161
+ add_to_content => true, // Add post count to content (only on single posts)
162
  exclude_pages => true, // Exclude Pages
163
+ count_on_pages => true, // Display on pages
164
  track_authors => false, // Track Authors visits
165
  pv_in_admin => true, // Add an extra column on edit posts/pages to display page views?
166
  disp_list_count => true, // Display count in popular lists?
300
  $tptn_settings = tptn_read_options();
301
  $limit = $tptn_settings['limit'];
302
 
303
+ $title = (($tptn_settings['title_daily']) ? strip_tags($tptn_settings['title_daily']) : __('Daily Popular',TPTN_LOCAL_NAME));
304
  echo $before_widget;
305
  echo $before_title.$title.$after_title;
306
 
351
 
352
  $results = $wpdb->get_results($sql);
353
 
354
+ $title = (($tptn_settings['title']) ? strip_tags($tptn_settings['title']) : __('Popular Posts',TPTN_LOCAL_NAME));
355
 
356
  echo $before_widget;
357
  echo $before_title.$title.$after_title;
370
  }
371
 
372
  function init_tptn(){
373
+ register_sidebar_widget(__('Popular Posts',TPTN_LOCAL_NAME), 'widget_tptn_pop');
374
+ register_sidebar_widget(__('Daily Popular',TPTN_LOCAL_NAME), 'widget_tptn_pop_daily');
375
  }
376
  add_action("plugins_loaded", "init_tptn");
377