Count per Day - Version 3.3

Version Description

  • New: List of most industrious Visitors
  • New: Export data as CSV file
  • New: count given post types only
  • New: Shortcode CPD_FLOTCHART to show the big chart
  • New: Popular Posts Widget, thanks to Maurits van der Schee http://www.leaseweblabs.com/2014/01/popular-posts-count-per-day-wordpress-plugin
  • New: Part of IP adresses in Bot List, '192.168' will block all visitors from '192.168.x.x'
  • New language: Chinese, thanks to Siyuan Tang
  • Bugfix: counting of cached pages
  • Bugfix: cleaning database, delete entries per IP in bot list
  • some little fixes
Download this release

Release Info

Developer Tom Braider
Plugin Icon 128x128 Count per Day
Version 3.3
Comparing to
See all releases

Code changes from version 3.2.10 to 3.3

counter-core.php CHANGED
@@ -49,10 +49,7 @@ function init()
49
// manual debug mode
50
if (!empty($_GET['debug']) && WP_DEBUG )
51
$this->options['debug'] = 1;
52
- // $this->dir = get_bloginfo('wpurl').'/'.PLUGINDIR.'/'.$cpd_dir_name;
53
$this->dir = plugins_url('/'.$cpd_dir_name);
54
- // var_dump($this->dir);
55
- // content_url()
56
57
$this->queries[0] = 0;
58
@@ -69,11 +66,8 @@ function init()
69
// javascript to count cached posts
70
if ($this->options['ajax'])
71
{
72
- // wp_enqueue_script('jquery');
73
add_action('wp_enqueue_scripts', array(&$this,'addJquery'));
74
add_action('wp_footer', array(&$this,'addAjaxScript'));
75
- // auch in addJQuery?
76
-
77
}
78
79
if (is_admin())
@@ -88,24 +82,6 @@ function init()
88
add_action('admin_menu', array(&$this,'setAdminMenu'));
89
// counter column posts lists
90
add_action('admin_head', array(&$this,'addPostTypesColumns'));
91
-
92
- // column page list
93
- // add_action('manage_pages_custom_column', array(&$this,'cpdColumnContent'), 10, 2);
94
- // add_filter('manage_edit-page_columns', array(&$this,'cpdColumn'));
95
-
96
- // add_action('manage_posts_custom_column', array(&$this,'cpdColumnContent'), 10, 2);
97
-
98
- // add_filter('manage_posts_columns', array(&$this,'cpdColumn'));
99
-
100
- // add_filter('manage_edit-post_columns', array(&$this,'cpdColumn'));
101
-
102
- // add_filter('manage_edit-post_sortable_columns', array(&$this,'cpdSortableColumns'));
103
- // add_filter('request', array(&$this,'cpdReadsOrderby'));
104
-
105
-
106
-
107
-
108
-
109
// adds javascript
110
add_action('admin_head', array(&$this,'addJS'));
111
// check version
@@ -179,8 +155,8 @@ function addJquery()
179
function addThickbox()
180
{
181
wp_enqueue_script('thickbox');
182
- if (strpos($_SERVER['QUERY_STRING'], 'cpd_metaboxes') !== false)
183
- wp_enqueue_script('cpd_flot', $this->dir.'/js/jquery.flot.min.js', 'jQuery');
184
}
185
186
@@ -200,13 +176,12 @@ function startSession()
200
* @param string|array $sql sql query [and args]
201
* @param string $func name for debug info
202
*/
203
- function mysqlQuery( $kind = '', $sql, $func = '' )
204
{
205
global $wpdb;
206
if (empty($sql))
207
return;
208
$t = microtime(true);
209
- $con = $wpdb->dbh;
210
211
if ( is_array($sql) )
212
{
@@ -224,22 +199,20 @@ function mysqlQuery( $kind = '', $sql, $func = '' )
224
if ($kind == 'var')
225
$r = $wpdb->get_var( $preparedSql );
226
else if ($kind == 'count')
227
- {
228
- // $sql = 'SELECT COUNT(*) FROM ('.trim($sql,';').') t';
229
$r = $wpdb->get_var('SELECT COUNT(*) FROM ('.trim($preparedSql,';').') t');
230
- }
231
else if ($kind == 'rows')
232
- {
233
$r = $wpdb->get_results( $preparedSql );
234
- }
235
else
236
$wpdb->query( $preparedSql );
237
238
if ( $this->options['debug'] )
239
{
240
$d = number_format( microtime(true) - $t , 5);
241
$m = sprintf("%.2f", memory_get_usage()/1048576).' MB';
242
- $error = (!$r && mysql_errno($con)) ? '<b style="color:red">ERROR:</b> '.mysql_errno($con).' - '.mysql_error($con).' - ' : '';
243
$this->queries[] = $func." : <b>$d</b> - $m<br/><code>$preparedSql</code><br/>$error";
244
$this->queries[0] += $d;
245
}
@@ -339,7 +312,7 @@ function isBot( $client = '', $bots = '', $ip = '', $ref = '' )
339
$ip = $_SERVER['REMOTE_ADDR'];
340
if ( empty($ref) && isset($_SERVER['HTTP_REFERER']) )
341
$ref = $_SERVER['HTTP_REFERER'];
342
-
343
// empty/short client -> not normal browser -> bot
344
if ( empty($client) || strlen($client) < 20 )
345
return true;
@@ -353,7 +326,14 @@ function isBot( $client = '', $bots = '', $ip = '', $ref = '' )
353
if (!$isBot) // loop until first bot was found only
354
{
355
$b = trim($bot);
356
- if ( !empty($b) && ( $ip == $b || strpos( strtolower($client), strtolower($b) ) !== false || strpos( strtolower($ref), strtolower($b) ) !== false ) )
357
$isBot = true;
358
}
359
}
@@ -489,6 +469,8 @@ function createTables()
489
function register_widgets()
490
{
491
register_widget('CountPerDay_Widget');
492
}
493
494
/**
@@ -497,13 +479,18 @@ function register_widgets()
497
function showQueries()
498
{
499
global $wpdb, $cpd_path, $cpd_version;
500
echo '<div style="position:absolute;margin:10px;padding:10px;border:1px red solid;background:#fff;clear:both">
501
<b>Count per Day - DEBUG: '.round($this->queries[0], 3).' s</b><ol>'."\n";
502
echo '<li>'
503
.'<b>Server:</b> '.$_SERVER['SERVER_SOFTWARE'].'<br/>'
504
.'<b>PHP:</b> '.phpversion().'<br/>'
505
- .'<b>mySQL Server:</b> '.mysql_get_server_info($wpdb->dbh).'<br/>'
506
- .'<b>mySQL Client:</b> '.mysql_get_client_info().'<br/>'
507
.'<b>WordPress:</b> '.get_bloginfo('version').'<br/>'
508
.'<b>Count per Day:</b> '.$cpd_version.'<br/>'
509
.'<b>Time for Count per Day:</b> '.date_i18n('Y-m-d H:i').'<br/>'
@@ -577,9 +564,10 @@ function addAjaxScript()
577
<script type="text/javascript">
578
// Count per Day
579
//<![CDATA[
580
jQuery(document).ready( function()
581
{
582
- jQuery.get('{$this->dir}/ajax.php?f=count&page={$this->page}&time={$time}', function(text)
583
{
584
var cpd_funcs = text.split('|');
585
for(var i = 0; i < cpd_funcs.length; i++)
@@ -611,15 +599,16 @@ function cleanDB()
611
612
// delete by ip
613
foreach( $bots as $ip )
614
- if ( ip2long($ip) !== false )
615
- $this->mysqlQuery('', "DELETE FROM $wpdb->cpd_counter WHERE $this->ntoa(ip) LIKE '".$ip."%%", 'clenaDB_ip'.__LINE__);
616
617
// delete by client
618
foreach ($bots as $bot)
619
- $this->mysqlQuery('', "DELETE FROM $wpdb->cpd_counter WHERE client LIKE '%%".$bot."%%'", 'cleanDB_client'.__LINE__);
620
621
// delete if a previously countered page was deleted
622
- $this->mysqlQuery('', "DELETE FROM $wpdb->cpd_counter WHERE page NOT IN ( SELECT id FROM $wpdb->posts) AND page > 0", 'cleanDB_delPosts'.__LINE__);
623
624
$rows_after = $this->mysqlQuery('var', "SELECT COUNT(*) FROM $wpdb->cpd_counter", 'cleanDB '.__LINE__);
625
return $rows_before - $rows_after;
@@ -817,7 +806,7 @@ function onShowPage()
817
$data = '';
818
?>
819
<div id="cpd-metaboxes" class="wrap">
820
- <h2><img src="<?php echo $this->img('cpd_menu.gif') ?>" alt="" style="width:24px;height:24px" /> Count per Day - <?php _e('Statistics', 'cpd') ?></h2>
821
<?php
822
wp_nonce_field('cpd-metaboxes');
823
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
@@ -876,6 +865,7 @@ function addShortcodes()
876
add_shortcode('CPD_DAY_MOST_READS', array(&$this,'shortDayWithMostReads'));
877
add_shortcode('CPD_DAY_MOST_USERS', array(&$this,'shortDayWithMostUsers'));
878
add_shortcode('CPD_SEARCHSTRINGS', array(&$this,'shortGetSearches'));
879
}
880
function shortShow() { return $this->show('', '', false, false); }
881
function shortReadsTotal() { return $this->getReadsAll(true); }
@@ -901,6 +891,7 @@ function shortCountriesUsers(){ return $this->getCountries(0, true, true, true);
901
function shortReferers() { return $this->getReferers(0, true, 0); }
902
function shortDayWithMostReads(){ return $this->getDayWithMostReads(true, true); }
903
function shortDayWithMostUsers(){ return $this->getDayWithMostUsers(true, true); }
904
function shortMostVisitedPosts( $atts )
905
{
906
extract( shortcode_atts( array(
@@ -977,6 +968,77 @@ function getMassBots( $limit )
977
return $this->mysqlQuery('rows', $sql, 'getMassBots '.__LINE__);
978
}
979
980
/**
981
* backup the counter table to wp-content dir, gz-compressed if possible
982
*/
@@ -991,7 +1053,7 @@ function backup()
991
$name = '/'.$tname;
992
993
// wp-content or tempdir?
994
- $path = ( empty($_POST['downloadonly']) && is_writable(WP_CONTENT_DIR) ) ? WP_CONTENT_DIR.$name : tempnam('', 'cpd');
995
996
// open file
997
$f = ($gz) ? gzopen($path,'w9') : fopen($path,'w');
@@ -1024,7 +1086,7 @@ function backup()
1024
$part = min(array( round($freeMemory/1000000)*500, $part ));
1025
1026
// show progress
1027
- echo '<div id="cpd_progress" class="updated"><p>'.sprintf(__('Backup of %s entries in progress. Every point complies %s entries.', 'cpd'), $entries, $part).'<br />';
1028
$this->flush_buffers();
1029
1030
// get data
@@ -1095,7 +1157,7 @@ function backup()
1095
$toname = 'count_per_day_options_'.date_i18n('Y-m-d_H-i-s').'.txt';
1096
if ($gz) $toname .= '.gz';
1097
$oname = '/'.$toname;
1098
- $opath = ( empty($_POST['downloadonly']) && is_writable(WP_CONTENT_DIR) ) ? WP_CONTENT_DIR.$oname : tempnam('', 'cpd');
1099
$f = ($gz) ? gzopen($opath,'w9') : fopen($opath,'w');
1100
1101
foreach (array('count_per_day', 'count_per_day_summary', 'count_per_day_collected', 'count_per_day_posts', 'count_per_day_notes') as $o)
@@ -1461,7 +1523,7 @@ function getSearchString()
1461
function cpdColumn($defaults)
1462
{
1463
if ( $this->options['show_in_lists'] )
1464
- $defaults['cpd_reads'] = '<img src="'.$this->img('cpd_menu.gif').'" alt="'.__('Reads', 'cpd').'" title="'.__('Reads', 'cpd').'" style="width:12px;height:12px;" />';
1465
return $defaults;
1466
}
1467
49
// manual debug mode
50
if (!empty($_GET['debug']) && WP_DEBUG )
51
$this->options['debug'] = 1;
52
$this->dir = plugins_url('/'.$cpd_dir_name);
53
54
$this->queries[0] = 0;
55
66
// javascript to count cached posts
67
if ($this->options['ajax'])
68
{
69
add_action('wp_enqueue_scripts', array(&$this,'addJquery'));
70
add_action('wp_footer', array(&$this,'addAjaxScript'));
71
}
72
73
if (is_admin())
82
add_action('admin_menu', array(&$this,'setAdminMenu'));
83
// counter column posts lists
84
add_action('admin_head', array(&$this,'addPostTypesColumns'));
85
// adds javascript
86
add_action('admin_head', array(&$this,'addJS'));
87
// check version
155
function addThickbox()
156
{
157
wp_enqueue_script('thickbox');
158
+ // if (strpos($_SERVER['QUERY_STRING'], 'cpd_metaboxes') !== false)
159
+ // wp_enqueue_script('cpd_flot', $this->dir.'/js/jquery.flot.min.js', 'jQuery');
160
}
161
162
176
* @param string|array $sql sql query [and args]
177
* @param string $func name for debug info
178
*/
179
+ function mysqlQuery( $kind = '', $sql = '', $func = '' )
180
{
181
global $wpdb;
182
if (empty($sql))
183
return;
184
$t = microtime(true);
185
186
if ( is_array($sql) )
187
{
199
if ($kind == 'var')
200
$r = $wpdb->get_var( $preparedSql );
201
else if ($kind == 'count')
202
$r = $wpdb->get_var('SELECT COUNT(*) FROM ('.trim($preparedSql,';').') t');
203
else if ($kind == 'rows')
204
$r = $wpdb->get_results( $preparedSql );
205
else
206
$wpdb->query( $preparedSql );
207
208
if ( $this->options['debug'] )
209
{
210
+ $con = $wpdb->dbh;
211
+ $errno = (isset($con->errno)) ? $con->errno : mysql_errno($con);
212
+ $error = (isset($con->error)) ? $con->error : mysql_error($con);
213
$d = number_format( microtime(true) - $t , 5);
214
$m = sprintf("%.2f", memory_get_usage()/1048576).' MB';
215
+ $error = (!$r && $errno) ? '<b style="color:red">ERROR:</b> '.$errno.' - '.$error.' - ' : '';
216
$this->queries[] = $func." : <b>$d</b> - $m<br/><code>$preparedSql</code><br/>$error";
217
$this->queries[0] += $d;
218
}
312
$ip = $_SERVER['REMOTE_ADDR'];
313
if ( empty($ref) && isset($_SERVER['HTTP_REFERER']) )
314
$ref = $_SERVER['HTTP_REFERER'];
315
+
316
// empty/short client -> not normal browser -> bot
317
if ( empty($client) || strlen($client) < 20 )
318
return true;
326
if (!$isBot) // loop until first bot was found only
327
{
328
$b = trim($bot);
329
+ if ( !empty($b)
330
+ && (
331
+ $ip == $b
332
+ || strpos( $ip, $b ) === 0
333
+ || strpos( strtolower($client), strtolower($b) ) !== false
334
+ || strpos( strtolower($ref), strtolower($b) ) !== false
335
+ )
336
+ )
337
$isBot = true;
338
}
339
}
469
function register_widgets()
470
{
471
register_widget('CountPerDay_Widget');
472
+ register_widget('CountPerDay_PopularPostsWidget');
473
+
474
}
475
476
/**
479
function showQueries()
480
{
481
global $wpdb, $cpd_path, $cpd_version;
482
+
483
+ $serverinfo = (isset($wpdb->dbh->server_info)) ? $wpdb->dbh->server_info : mysql_get_server_info($wpdb->dbh);
484
+ $clientinfo = (isset($wpdb->dbh->client_info)) ? $wpdb->dbh->client_info : mysql_get_client_info();
485
+
486
echo '<div style="position:absolute;margin:10px;padding:10px;border:1px red solid;background:#fff;clear:both">
487
<b>Count per Day - DEBUG: '.round($this->queries[0], 3).' s</b><ol>'."\n";
488
+ // var_dump($wpdb->dbh);
489
echo '<li>'
490
.'<b>Server:</b> '.$_SERVER['SERVER_SOFTWARE'].'<br/>'
491
.'<b>PHP:</b> '.phpversion().'<br/>'
492
+ .'<b>mySQL Server:</b> '.$serverinfo.'<br/>'
493
+ .'<b>mySQL Client:</b> '.$clientinfo.'<br/>'
494
.'<b>WordPress:</b> '.get_bloginfo('version').'<br/>'
495
.'<b>Count per Day:</b> '.$cpd_version.'<br/>'
496
.'<b>Time for Count per Day:</b> '.date_i18n('Y-m-d H:i').'<br/>'
564
<script type="text/javascript">
565
// Count per Day
566
//<![CDATA[
567
+ var cpdTime = new Date().getTime() / 1000;
568
jQuery(document).ready( function()
569
{
570
+ jQuery.get('{$this->dir}/ajax.php?f=count&page={$this->page}&time='+cpdTime, function(text)
571
{
572
var cpd_funcs = text.split('|');
573
for(var i = 0; i < cpd_funcs.length; i++)
599
600
// delete by ip
601
foreach( $bots as $ip )
602
+ if ( intval($ip) > 0 )
603
+ $this->mysqlQuery('', "DELETE FROM $wpdb->cpd_counter WHERE {$this->ntoa}(ip) LIKE '".$ip."%'", 'clenaDB_ip '.__LINE__);
604
605
// delete by client
606
foreach ($bots as $bot)
607
+ if ( intval($bot) == 0 )
608
+ $this->mysqlQuery('', "DELETE FROM $wpdb->cpd_counter WHERE client LIKE '%".$bot."%'", 'cleanDB_client '.__LINE__);
609
610
// delete if a previously countered page was deleted
611
+ $this->mysqlQuery('', "DELETE FROM $wpdb->cpd_counter WHERE page NOT IN ( SELECT id FROM $wpdb->posts) AND page > 0", 'cleanDB_delPosts '.__LINE__);
612
613
$rows_after = $this->mysqlQuery('var', "SELECT COUNT(*) FROM $wpdb->cpd_counter", 'cleanDB '.__LINE__);
614
return $rows_before - $rows_after;
806
$data = '';
807
?>
808
<div id="cpd-metaboxes" class="wrap">
809
+ <h2><img src="<?php echo $count_per_day->img('cpd_logo.png') ?>" alt="Logo" class="cpd_logo" style="margin-left:8px" /> Count per Day - <?php _e('Statistics', 'cpd') ?></h2>
810
<?php
811
wp_nonce_field('cpd-metaboxes');
812
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
865
add_shortcode('CPD_DAY_MOST_READS', array(&$this,'shortDayWithMostReads'));
866
add_shortcode('CPD_DAY_MOST_USERS', array(&$this,'shortDayWithMostUsers'));
867
add_shortcode('CPD_SEARCHSTRINGS', array(&$this,'shortGetSearches'));
868
+ add_shortcode('CPD_FLOTCHART', array(&$this,'shortFlotChart'));
869
}
870
function shortShow() { return $this->show('', '', false, false); }
871
function shortReadsTotal() { return $this->getReadsAll(true); }
891
function shortReferers() { return $this->getReferers(0, true, 0); }
892
function shortDayWithMostReads(){ return $this->getDayWithMostReads(true, true); }
893
function shortDayWithMostUsers(){ return $this->getDayWithMostUsers(true, true); }
894
+ function shortFlotChart() { return $this->getFlotChart(); }
895
function shortMostVisitedPosts( $atts )
896
{
897
extract( shortcode_atts( array(
968
return $this->mysqlQuery('rows', $sql, 'getMassBots '.__LINE__);
969
}
970
971
+
972
+ /**
973
+ * backup the counter table to wp-content dir, gz-compressed if possible
974
+ */
975
+ function export( $days = 180 )
976
+ {
977
+ global $wpdb;
978
+ $t = $wpdb->cpd_counter;
979
+ $tname = $t.'_last_'.$days.'_days_'.date_i18n('Y-m-d_H-i-s').'.csv';
980
+ $path = tempnam('', 'cpdexport');
981
+
982
+ // open file
983
+ $f = fopen($path,'w');
984
+
985
+ if (!$f) :
986
+ echo '<div class="error"><p>'.__('Export failed! Cannot open file.', 'cpd').' '.$path.'.</p></div>';
987
+ else :
988
+ $part = (int) $this->options['backup_part'];
989
+ if (empty($part))
990
+ $part = 10000;
991
+ // check free memory, save 8MB for script, 5000 entries needs ~ 10MB
992
+ $freeMemory = ($this->getBytes(ini_get('memory_limit')) - memory_get_usage()) - 8000000;
993
+ $part = min(array( round($freeMemory/1000000)*500, $part ));
994
+ $start = 0;
995
+
996
+ fwrite($f, "date;ip;country;client;referer;post_cat_id;post_name;cat_tax_name;tax\r\n");
997
+
998
+ do
999
+ {
1000
+ $sql = "SELECT c.*,
1001
+ c.page post_id,
1002
+ p.post_title post,
1003
+ t.name tag_cat_name,
1004
+ x.taxonomy tax
1005
+ FROM `$t` c
1006
+ LEFT JOIN $wpdb->posts p
1007
+ ON p.id = c.page
1008
+ LEFT JOIN $wpdb->terms t
1009
+ ON t.term_id = 0 - c.page
1010
+ LEFT JOIN $wpdb->term_taxonomy x
1011
+ ON x.term_id = t.term_id
1012
+ WHERE c.date >= DATE_SUB('".date_i18n('Y-m-d')."', INTERVAL $days DAY)
1013
+ GROUP BY c.id
1014
+ ORDER BY c.date
1015
+ LIMIT $start, $part";
1016
+ $rows = $this->mysqlQuery('rows', $sql, 'export '.__LINE__);
1017
+ foreach ($rows as $row)
1018
+ {
1019
+ $row = (array) $row;
1020
+ $line = '"'.$row['date'].'";"'.long2ip($row['ip']).'";"'.$row['country'].'";"'
1021
+ .str_replace('"', ' ', $row['client']).'";"'.str_replace('"', ' ', $row['referer']).'";"'
1022
+ .abs($row['page']).'";"'.str_replace('"', ' ', $row['post']).'";"'.str_replace('"', ' ', $row['tag_cat_name']).'";"'.$row['tax'].'"'."\r\n";
1023
+ fwrite($f, $line);
1024
+ }
1025
+ $start += $part;
1026
+ }
1027
+ while (count($rows) == $part);
1028
+
1029
+ fclose($f);
1030
+
1031
+ // show download link
1032
+ $tfile = basename($path);
1033
+ echo '<div class="updated"><p>';
1034
+ _e('Download the export file:', 'cpd');
1035
+ echo ' <a href="'.$this->dir.'/download.php?f='.$tfile.'&amp;n='.$tname.'">'.$tname.'</a><br/>';
1036
+ echo '</p></div>';
1037
+
1038
+ endif;
1039
+ }
1040
+
1041
+
1042
/**
1043
* backup the counter table to wp-content dir, gz-compressed if possible
1044
*/
1053
$name = '/'.$tname;
1054
1055
// wp-content or tempdir?
1056
+ $path = ( empty($_POST['downloadonly']) && is_writable(WP_CONTENT_DIR) ) ? WP_CONTENT_DIR.$name : tempnam('', 'cpdbackup');
1057
1058
// open file
1059
$f = ($gz) ? gzopen($path,'w9') : fopen($path,'w');
1086
$part = min(array( round($freeMemory/1000000)*500, $part ));
1087
1088
// show progress
1089
+ echo '<div id="cpd_progress" class="updated"><p>'.sprintf(__('Backup of %s entries in progress. Every point comprises %s entries.', 'cpd'), $entries, $part).'<br />';
1090
$this->flush_buffers();
1091
1092
// get data
1157
$toname = 'count_per_day_options_'.date_i18n('Y-m-d_H-i-s').'.txt';
1158
if ($gz) $toname .= '.gz';
1159
$oname = '/'.$toname;
1160
+ $opath = ( empty($_POST['downloadonly']) && is_writable(WP_CONTENT_DIR) ) ? WP_CONTENT_DIR.$oname : tempnam('', 'cpdbackup');
1161
$f = ($gz) ? gzopen($opath,'w9') : fopen($opath,'w');
1162
1163
foreach (array('count_per_day', 'count_per_day_summary', 'count_per_day_collected', 'count_per_day_posts', 'count_per_day_notes') as $o)
1523
function cpdColumn($defaults)
1524
{
1525
if ( $this->options['show_in_lists'] )
1526
+ $defaults['cpd_reads'] = '<img src="'.$this->img('cpd_logo.png').'" alt="'.__('Reads', 'cpd').'" title="'.__('Reads', 'cpd').'" style="width:16px;height:16px;" />';
1527
return $defaults;
1528
}
1529
counter-options.php CHANGED
@@ -4,8 +4,6 @@
4
* Count Per Day - Options and Administration
5
*/
6
7
- $mysiteurl = substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], 'counter-options.php') + 19);
8
-
9
// check form
10
if(!empty($_POST['do']))
11
{
@@ -13,11 +11,13 @@ if(!empty($_POST['do']))
13
{
14
// update options
15
case 'cpd_update' :
16
$count_per_day->options['onlinetime'] = $_POST['cpd_onlinetime'];
17
$count_per_day->options['user'] = empty( $_POST['cpd_user'] ) ? 0 : 1 ;
18
$count_per_day->options['user_level'] = $_POST['cpd_user_level'];
19
$count_per_day->options['autocount'] = empty( $_POST['cpd_autocount'] ) ? 0 : 1 ;
20
$count_per_day->options['bots'] = $_POST['cpd_bots'];
21
$count_per_day->options['dashboard_posts'] = $_POST['cpd_dashboard_posts'];
22
$count_per_day->options['dashboard_last_posts'] = $_POST['cpd_dashboard_last_posts'];
23
$count_per_day->options['dashboard_last_days'] = $_POST['cpd_dashboard_last_days'];
@@ -106,6 +106,11 @@ if(!empty($_POST['do']))
106
echo '<div class="updated"><p>'.sprintf(__('Mass Bots cleaned. %s counts deleted.', 'cpd'), $sum).'</p></div>';
107
}
108
break;
109
110
// clean database
111
case 'cpd_clean' :
@@ -281,7 +286,7 @@ if(!empty($_POST['do']))
281
}
282
283
// save collection
284
- echo "<br />".__('Delete old data...', 'cpd')."\n";
285
$count_per_day->flush_buffers();
286
287
update_option('count_per_day_summary', $s);
@@ -391,24 +396,31 @@ switch($mode) {
391
$o['massbotlimit'] = (int) $_POST['limit'];
392
update_option('count_per_day', $o);
393
}
394
?>
395
- <div id="cpdtools" style="position:absolute;top:-31px;height:0x;"></div>
396
<div id="cpdtoolccs" class="wrap">
397
398
- <h2 class="nav-tab-wrapper" style="padding-bottom:0;margin-bottom:20px;">
399
- <img src="<?php echo $count_per_day->img('cpd_menu.gif') ?>" alt="" style="width:24px;height:24px" /> Count per Day
400
- <a class="nav-tab nav-tab-active" href="#cpdtools"><span class="cpd_icon cpd_tools">&nbsp;</span> <?php _e('Tools') ?></a>
401
- <a class="nav-tab" href="#cpdsettings"><span class="cpd_icon cpd_settings">&nbsp;</span> <?php _e('Settings') ?></a>
402
</h2>
403
-
404
<div id="poststuff" class="cpd_settings">
405
-
406
<?php // mass bots ?>
407
<div class="postbox">
408
<?php
409
$limit = (isset($o['massbotlimit'])) ? $o['massbotlimit'] : 25;
410
$limit = (isset($_POST['limit'])) ? $_POST['limit'] : $limit;
411
- $limit_input = '<input type="text" size="3" name="limit" value="'.$limit.'" />';
412
413
if ( $limit == 0 )
414
$limit = 50;
@@ -416,7 +428,7 @@ switch($mode) {
416
?>
417
<h3><span class="cpd_icon cpd_massbots">&nbsp;</span> <?php _e('Mass Bots', 'cpd') ?></h3>
418
<div class="inside">
419
- <form method="post" action="<?php echo $mysiteurl ?>#cpdtools">
420
<p>
421
<?php printf(__('Show all IPs with more than %s page views per day', 'cpd'), $limit_input) ?>
422
<input type="submit" name="showmassbots" value="<?php _e('show', 'cpd') ?>" class="button" />
@@ -468,9 +480,81 @@ switch($mode) {
468
</div>
469
</div>
470
471
<!-- left column -->
472
<div class="cpd_halfsize" style="margin-right: 2%;">
473
474
<!-- Backup -->
475
<div class="postbox">
476
<h3><span class="cpd_icon cpd_backup">&nbsp;</span> <?php _e('Backup', 'cpd') ?></h3>
@@ -732,15 +816,11 @@ switch($mode) {
732
733
</div> <!-- right column -->
734
735
- <div class="clear" id="cpdsettings" style="margin-bottom:41px"></div>
736
-
737
- <h2 class="nav-tab-wrapper" style="padding-bottom:0;font-size:23px;">
738
- <img src="<?php echo $count_per_day->img('cpd_menu.gif') ?>" alt="" style="width:24px;height:24px" /> Count per Day
739
- <a class="nav-tab" href="#cpdtools"><span class="cpd_icon cpd_tools">&nbsp;</span> <?php _e('Tools') ?></a>
740
- <a class="nav-tab nav-tab-active" href="#cpdsettings"><span class="cpd_icon cpd_settings">&nbsp;</span> <?php _e('Settings') ?></a>
741
- </h2>
742
-
743
-
744
<form method="post" action="<?php echo $mysiteurl ?>">
745
746
<?php // counter ?>
@@ -749,11 +829,11 @@ switch($mode) {
749
750
<table class="form-table">
751
<tr>
752
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Online time', 'cpd') ?>:</th>
753
<td><input class="code" type="text" name="cpd_onlinetime" size="3" value="<?php echo $o['onlinetime']; ?>" /> <?php _e('Seconds for online counter. Used for "Visitors online" on dashboard page.', 'cpd') ?></td>
754
</tr>
755
<tr>
756
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Logged on Users', 'cpd') ?>:</th>
757
<td>
758
<label for="cpd_user"><input type="checkbox" name="cpd_user" id="cpd_user" <?php if($o['user']==1) echo 'checked="checked"'; ?> /> <?php _e('count too', 'cpd') ?></label>
759
- <?php _e('until User Level', 'cpd') ?>
@@ -767,23 +847,23 @@ switch($mode) {
767
</td>
768
</tr>
769
<tr>
770
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Auto counter', 'cpd') ?>:</th>
771
<td><label for="cpd_autocount"><input type="checkbox" name="cpd_autocount" id="cpd_autocount" <?php checked($o['autocount'], 1) ?> /> <?php _e('Counts automatically single-posts and pages, no changes on template needed.', 'cpd') ?></label></td>
772
</tr>
773
<tr>
774
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Bots to ignore', 'cpd') ?>:</th>
775
<td><textarea name="cpd_bots" cols="50" rows="10"><?php echo $o['bots']; ?></textarea></td>
776
</tr>
777
<tr>
778
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Anonymous IP', 'cpd') ?>:</th>
779
<td><label for="cpd_anoip"><input type="checkbox" name="cpd_anoip" id="cpd_anoip" <?php checked($o['anoip'], 1) ?> /> a.b.c.d &gt; a.b.c.x</label></td>
780
</tr>
781
<tr>
782
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Cache', 'cpd') ?> (beta):</th>
783
<td><label for="cpd_ajax"><input type="checkbox" name="cpd_ajax" id="cpd_ajax" <?php checked($o['ajax'], 1) ?> /> <?php _e('I use a cache plugin. Count these visits with ajax.', 'cpd') ?></label></td>
784
</tr>
785
<tr>
786
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Clients and referrers', 'cpd') ?>:</th>
787
<td>
788
<label for="cpd_referers"><input type="checkbox" name="cpd_referers" id="cpd_referers" <?php checked($o['referers'], 1) ?> />
789
<?php _e('Save and show clients and referrers.<br />Needs a lot of space in the database but gives you more detailed informations of your visitors.', 'cpd') ?> (1000000 <?php _e('Reads', 'cpd') ?> ~ 130 MB)</label><br/>
@@ -791,6 +871,16 @@ switch($mode) {
791
<?php _e('Save URL only, no query string.', 'cpd') ?> <code>http://example.com/webhp?hl=de#sclient=psy&amp;hl=de...</code> &gt; <code>http://example.com/webhp</code></label>
792
</td>
793
</tr>
794
</table>
795
</fieldset>
796
@@ -812,7 +902,7 @@ switch($mode) {
812
813
<table class="form-table">
814
<tr>
815
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Who can see it', 'cpd') ?>:</th>
816
<td>
817
<?php $cus = (in_array($o['whocansee'], array('manage_options','manage_links','publish_posts','edit_posts','read'))) ? 0 : 1 ?>
818
<select id="cpd_whocansee" name="cpd_whocansee" onchange="checkcustom()">
@@ -831,45 +921,45 @@ switch($mode) {
831
</td>
832
</tr>
833
<tr>
834
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Visitors per post', 'cpd') ?>:</th>
835
<td><input class="code" type="text" name="cpd_dashboard_posts" size="3" value="<?php echo $o['dashboard_posts']; ?>" /> <?php _e('How many posts do you want to see on dashboard page?', 'cpd') ?></td>
836
</tr>
837
<tr>
838
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Latest Counts - Posts', 'cpd') ?>:</th>
839
<td><input class="code" type="text" name="cpd_dashboard_last_posts" size="3" value="<?php echo $o['dashboard_last_posts']; ?>" /> <?php _e('How many posts do you want to see on dashboard page?', 'cpd') ?></td>
840
</tr>
841
<tr>
842
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Latest Counts - Days', 'cpd') ?>:</th>
843
<td><input class="code" type="text" name="cpd_dashboard_last_days" size="3" value="<?php echo $o['dashboard_last_days']; ?>" /> <?php _e('How many days do you want look back?', 'cpd') ?></td>
844
</tr>
845
<tr>
846
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Chart - Days', 'cpd') ?>:</th>
847
<td><input class="code" type="text" name="cpd_chart_days" size="3" value="<?php echo $o['chart_days']; ?>" /> <?php _e('How many days do you want look back?', 'cpd') ?></td>
848
</tr>
849
<tr>
850
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Chart - Height', 'cpd') ?>:</th>
851
<td><input class="code" type="text" name="cpd_chart_height" size="3" value="<?php echo $o['chart_height']; ?>" /> px - <?php _e('Height of the biggest bar', 'cpd') ?></td>
852
</tr>
853
<?php if ($cpd_geoip) { ?>
854
<tr>
855
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Countries', 'cpd') ?>:</th>
856
<td><input class="code" type="text" name="cpd_countries" size="3" value="<?php echo $o['countries']; ?>" /> <?php _e('How many countries do you want to see on dashboard page?', 'cpd') ?></td>
857
</tr>
858
<?php } ?>
859
<tr>
860
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Browsers', 'cpd') ?>:</th>
861
- <td><input class="code" type="text" name="cpd_clients" size="50" value="<?php echo $o['clients']; ?>" /> <?php _e('Substring of the user agent, separated by comma', 'cpd') ?></td>
862
</tr>
863
<tr>
864
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Search strings', 'cpd') ?>/<?php _e('Referrers - Entries', 'cpd') ?>:</th>
865
<td><input class="code" type="text" name="cpd_dashboard_referers" size="3" value="<?php echo $o['dashboard_referers']; ?>" /> <?php _e('How many referrers do you want to see on dashboard page?', 'cpd') ?></td>
866
</tr>
867
<tr>
868
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Search strings', 'cpd') ?>/<?php _e('Referrers - Days', 'cpd') ?>:</th>
869
<td><input class="code" type="text" name="cpd_referers_last_days" size="3" value="<?php echo $o['referers_last_days']; ?>" /> <?php _e('How many days do you want look back?', 'cpd') ?></td>
870
</tr>
871
<tr>
872
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Local URLs', 'cpd') ?>:</th>
873
<td><label for="cpd_localref"><input type="checkbox" name="cpd_localref" id="cpd_localref" <?php checked($o['localref'], 1) ?> /> <?php _e('Show local referrers too.', 'cpd') ?> (<?php echo bloginfo('url') ?>/...)</label></td>
874
</tr>
875
</table>
@@ -880,7 +970,7 @@ switch($mode) {
880
<legend><span class="cpd_icon cpd_settings">&nbsp;</span> <?php _e('Posts') ?> / <?php _e('Pages') ?></legend>
881
<table class="form-table">
882
<tr>
883
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Show in lists', 'cpd') ?>:</th>
884
<td><label for="cpd_show_in_lists"><input type="checkbox" name="cpd_show_in_lists" id="cpd_show_in_lists" <?php checked($o['show_in_lists'], 1) ?> /> <?php _e('Show "Reads per Post" in a new column in post management views.', 'cpd') ?></label></td>
885
</tr>
886
</table>
@@ -896,15 +986,15 @@ switch($mode) {
896
</th>
897
</tr>
898
<tr>
899
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Start date', 'cpd') ?>:</th>
900
<td><input class="code" type="text" name="cpd_startdate" size="10" value="<?php echo $o['startdate']; ?>" /> <?php _e('Your old Counter starts at?', 'cpd') ?> [yyyy-mm-dd]</td>
901
</tr>
902
<tr>
903
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Start count', 'cpd') ?>:</th>
904
<td><input class="code" type="text" name="cpd_startcount" size="10" value="<?php echo $o['startcount']; ?>" /> <?php _e('Add this value to "Total visitors".', 'cpd') ?></td>
905
</tr>
906
<tr>
907
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Start count', 'cpd') ?>:</th>
908
<td><input class="code" type="text" name="cpd_startreads" size="10" value="<?php echo $o['startreads']; ?>" /> <?php _e('Add this value to "Total reads".', 'cpd') ?></td>
909
</tr>
910
</table>
@@ -915,7 +1005,7 @@ switch($mode) {
915
<legend><span class="cpd_icon cpd_settings">&nbsp;</span> <?php _e('Stylesheet', 'cpd') ?></legend>
916
<table class="form-table">
917
<tr>
918
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('NO Stylesheet in Frontend', 'cpd') ?>:</th>
919
<td><label for="cpd_no_front_css"><input type="checkbox" name="cpd_no_front_css" id="cpd_no_front_css" <?php checked($o['no_front_css'], 1) ?> /> <?php _e('Do not load the stylesheet "counter.css" in frontend.', 'cpd') ?></label></td>
920
</tr>
921
</table>
@@ -926,7 +1016,7 @@ switch($mode) {
926
<legend><span class="cpd_icon cpd_settings">&nbsp;</span> <?php _e('Backup', 'cpd') ?></legend>
927
<table class="form-table">
928
<tr>
929
- <th scope="row" style="vertical-align:middle;white-space:nowrap"><?php _e('Entries per pass', 'cpd') ?>:</th>
930
<td>
931
<input class="code" type="text" name="cpd_backup_part" size="10" value="<?php echo $o['backup_part']; ?>" />
932
<?php _e('How many entries should be saved per pass? Default: 10000', 'cpd') ?><br/>
@@ -953,6 +1043,9 @@ switch($mode) {
953
</form>
954
955
</div><!-- poststuff -->
956
</div><!-- wrap -->
957
958
<?php } // End switch($mode)
4
* Count Per Day - Options and Administration
5
*/
6
7
// check form
8
if(!empty($_POST['do']))
9
{
11
{
12
// update options
13
case 'cpd_update' :
14
+ $_POST['cpd_bots'] = preg_replace('/\r\n\r\n/', '', $_POST['cpd_bots']);
15
$count_per_day->options['onlinetime'] = $_POST['cpd_onlinetime'];
16
$count_per_day->options['user'] = empty( $_POST['cpd_user'] ) ? 0 : 1 ;
17
$count_per_day->options['user_level'] = $_POST['cpd_user_level'];
18
$count_per_day->options['autocount'] = empty( $_POST['cpd_autocount'] ) ? 0 : 1 ;
19
$count_per_day->options['bots'] = $_POST['cpd_bots'];
20
+ $count_per_day->options['posttypes'] = str_replace(' ', '', $_POST['cpd_posttypes']);
21
$count_per_day->options['dashboard_posts'] = $_POST['cpd_dashboard_posts'];
22
$count_per_day->options['dashboard_last_posts'] = $_POST['cpd_dashboard_last_posts'];
23
$count_per_day->options['dashboard_last_days'] = $_POST['cpd_dashboard_last_days'];
106
echo '<div class="updated"><p>'.sprintf(__('Mass Bots cleaned. %s counts deleted.', 'cpd'), $sum).'</p></div>';
107
}
108
break;
109
+
110
+ // clean database
111
+ case 'cpd_export' :
112
+ $count_per_day->export($_POST['cpd_exportdays']);
113
+ break;
114
115
// clean database
116
case 'cpd_clean' :
286
}
287
288
// save collection
289
+ echo "<br />".__('Deleting old data...', 'cpd')."\n";
290
$count_per_day->flush_buffers();
291
292
update_option('count_per_day_summary', $s);
396
$o['massbotlimit'] = (int) $_POST['limit'];
397
update_option('count_per_day', $o);
398
}
399
+
400
+ $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'tools';
401
?>
402
+
403
<div id="cpdtoolccs" class="wrap">
404
405
+ <h2><img src="<?php echo $count_per_day->img('cpd_logo.png') ?>" alt="Logo" class="cpd_logo" /> Count per Day</h2>
406
+
407
+ <h2 class="nav-tab-wrapper">
408
+ <a href="?page=count-per-day/counter-options.php&amp;tab=tools" class="nav-tab <?php echo $active_tab == 'tools' ? 'nav-tab-active' : ''; ?>"><span class="cpd_icon cpd_tools">&nbsp;</span> <?php _e('Tools') ?></a>
409
+ <a href="?page=count-per-day/counter-options.php&amp;tab=options" class="nav-tab <?php echo $active_tab == 'options' ? 'nav-tab-active' : ''; ?>"><span class="cpd_icon cpd_settings">&nbsp;</span> <?php _e('Settings') ?></a>
410
</h2>
411
+
412
<div id="poststuff" class="cpd_settings">
413
+
414
+ <?php if( $active_tab == 'tools' ) : ?>
415
+
416
+ <?php $mysiteurl = substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], 'counter-options.php') + 19).'&amp;tab=tools'; ?>
417
+
418
<?php // mass bots ?>
419
<div class="postbox">
420
<?php
421
$limit = (isset($o['massbotlimit'])) ? $o['massbotlimit'] : 25;
422
$limit = (isset($_POST['limit'])) ? $_POST['limit'] : $limit;
423
+ $limit_input = '<input type="text" size="3" name="limit" value="'.$limit.'" style="text-align:center" />';
424
425
if ( $limit == 0 )
426
$limit = 50;
428
?>
429
<h3><span class="cpd_icon cpd_massbots">&nbsp;</span> <?php _e('Mass Bots', 'cpd') ?></h3>
430
<div class="inside">
431
+ <form method="post" action="<?php echo $mysiteurl ?>">
432
<p>
433
<?php printf(__('Show all IPs with more than %s page views per day', 'cpd'), $limit_input) ?>
434
<input type="submit" name="showmassbots" value="<?php _e('show', 'cpd') ?>" class="button" />
480
</div>
481
</div>
482
483
+
484
+ <?php // industrious visitors ?>
485
+ <div class="postbox">
486
+ <?php
487
+ $limit = (!empty($_POST['vislimit'])) ? intval($_POST['vislimit']) : 10;
488
+ $limit_input = '<input type="text" size="3" name="vislimit" value="'.$limit.'" style="text-align:center" />';
489
+ $days = (!empty($_POST['visdays'])) ? intval($_POST['visdays']) : 7;
490
+ $days_input = '<input type="text" size="3" name="visdays" value="'.$days.'" style="text-align:center" />';
491
+ $list = $count_per_day->getLastVisitors( $days, $limit );
492
+ ?>
493
+ <h3><span class="cpd_icon cpd_massbots">&nbsp;</span> <?php _e('Most Industrious Visitors', 'cpd') ?></h3>
494
+ <div class="inside">
495
+ <form method="post" action="<?php echo $mysiteurl ?>#cpdtools">
496
+ <p>
497
+ <?php printf(__('Show the %s most industrious visitors of the last %s days', 'cpd'), $limit_input, $days_input) ?>
498
+ <input type="submit" name="showlastvisitors" value="<?php _e('show', 'cpd') ?>" class="button" />
499
+ </p>
500
+ </form>
501
+
502
+ <form method="post" action="<?php echo $mysiteurl ?>">
503
+ <table class="widefat post">
504
+ <thead>
505
+ <tr>
506
+ <th><?php _e('IP', 'cpd') ?></th>
507
+ <th><?php _e('Date', 'cpd') ?></th>
508
+ <th><?php _e('Client', 'cpd') ?></th>
509
+ <th style="text-align:right"><?php _e('Views', 'cpd') ?></th>
510
+ </tr>
511
+ </thead>
512
+ <?php
513
+ foreach ($list as $row)
514
+ {
515
+ $ip = $row->ip;
516
+ echo '<tr><td style="white-space:nowrap">';
517
+ if ( $cpd_geoip )
518
+ {
519
+ $c = CpdGeoIp::getCountry($ip);
520
+ echo $c[1].' &nbsp;';
521
+ }
522
+ echo '<a href="?page=count-per-day/counter-options.php&amp;dmbip='.$row->longip.'&amp;dmbdate='.$row->date.'"
523
+ title="'.sprintf(__('Delete these %s counts', 'cpd'), $row->posts).'"
524
+ style="color:red; font-weight: bold;">X</a> &nbsp;';
525
+ echo '<a href="http://www.utrace.de/?query='.$ip.'">'.$ip.'</a></td>'
526
+ .'<td style="white-space:nowrap;">'.mysql2date(get_option('date_format'), $row->date).'</td>'
527
+ .'<td>'.htmlentities($row->client).'</td>'
528
+ .'<td style="text-align:right;"><a href="'.$count_per_day->dir.'/massbots.php?dmbip='.$row->longip.'&amp;dmbdate='.$row->date.'&amp;KeepThis=true&amp;TB_iframe=true" title="Count per Day" class="thickbox">'
529
+ .$row->posts.'</a></td>'
530
+ .'</tr>';
531
+ $sum += $row->posts;
532
+ }
533
+ ?>
534
+ </table>
535
+ </form>
536
+ </div>
537
+ </div>
538
+
539
<!-- left column -->
540
<div class="cpd_halfsize" style="margin-right: 2%;">
541
542
+ <!-- Export -->
543
+ <div class="postbox">
544
+ <h3><span class="cpd_icon cpd_backup">&nbsp;</span> <?php _e('Export', 'cpd') ?></h3>
545
+ <div class="inside">
546
+ <form method="post" action="<?php echo $mysiteurl ?>">
547
+ <p>
548
+ <?php printf(__('Export the last %s days as CSV-File', 'cpd'), '<input type="text" size="4" name="cpd_exportdays" value="180" class="code" style="text-align:center" />'); ?>
549
+ </p>
550
+ <p>
551
+ <input type="hidden" name="do" value="cpd_export" />
552
+ <input type="submit" name="cpd_export" value="<?php _e('Export entries', 'cpd') ?>" class="button" />
553
+ </p>
554
+ </form>
555
+ </div>
556
+ </div>
557
+
558
<!-- Backup -->
559
<div class="postbox">
560
<h3><span class="cpd_icon cpd_backup">&nbsp;</span> <?php _e('Backup', 'cpd') ?></h3>
816
817
</div> <!-- right column -->
818
819
+
820
+ <?php else : // tools tab ?>
821
+
822
+ <?php $mysiteurl = substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], 'counter-options.php') + 19).'&amp;tab=options'; ?>
823
+
824
<form method="post" action="<?php echo $mysiteurl ?>">
825
826
<?php // counter ?>
829
830
<table class="form-table">
831
<tr>
832
+ <th scope="row" style="white-space:nowrap"><?php _e('Online time', 'cpd') ?>:</th>
833
<td><input class="code" type="text" name="cpd_onlinetime" size="3" value="<?php echo $o['onlinetime']; ?>" /> <?php _e('Seconds for online counter. Used for "Visitors online" on dashboard page.', 'cpd') ?></td>
834
</tr>
835
<tr>
836
+ <th scope="row" style="white-space:nowrap"><?php _e('Logged on Users', 'cpd') ?>:</th>
837
<td>
838
<label for="cpd_user"><input type="checkbox" name="cpd_user" id="cpd_user" <?php if($o['user']==1) echo 'checked="checked"'; ?> /> <?php _e('count too', 'cpd') ?></label>
839
- <?php _e('until User Level', 'cpd') ?>
847
</td>
848
</tr>
849
<tr>
850
+ <th scope="row" style="white-space:nowrap"><?php _e('Auto counter', 'cpd') ?>:</th>
851
<td><label for="cpd_autocount"><input type="checkbox" name="cpd_autocount" id="cpd_autocount" <?php checked($o['autocount'], 1) ?> /> <?php _e('Counts automatically single-posts and pages, no changes on template needed.', 'cpd') ?></label></td>
852
</tr>
853
<tr>
854
+ <th scope="row" style="white-space:nowrap"><?php _e('Bots to ignore', 'cpd') ?>:</th>
855
<td><textarea name="cpd_bots" cols="50" rows="10"><?php echo $o['bots']; ?></textarea></td>
856
</tr>
857
<tr>
858
+ <th scope="row" style="white-space:nowrap"><?php _e('Anonymous IP', 'cpd') ?>:</th>
859
<td><label for="cpd_anoip"><input type="checkbox" name="cpd_anoip" id="cpd_anoip" <?php checked($o['anoip'], 1) ?> /> a.b.c.d &gt; a.b.c.x</label></td>
860
</tr>
861
<tr>
862
+ <th scope="row" style="white-space:nowrap"><?php _e('Cache', 'cpd') ?> (beta):</th>
863
<td><label for="cpd_ajax"><input type="checkbox" name="cpd_ajax" id="cpd_ajax" <?php checked($o['ajax'], 1) ?> /> <?php _e('I use a cache plugin. Count these visits with ajax.', 'cpd') ?></label></td>
864
</tr>
865
<tr>
866
+ <th scope="row" style="white-space:nowrap"><?php _e('Clients and referrers', 'cpd') ?>:</th>
867
<td>
868
<label for="cpd_referers"><input type="checkbox" name="cpd_referers" id="cpd_referers" <?php checked($o['referers'], 1) ?> />
869
<?php _e('Save and show clients and referrers.<br />Needs a lot of space in the database but gives you more detailed informations of your visitors.', 'cpd') ?> (1000000 <?php _e('Reads', 'cpd') ?> ~ 130 MB)</label><br/>
871
<?php _e('Save URL only, no query string.', 'cpd') ?> <code>http://example.com/webhp?hl=de#sclient=psy&amp;hl=de...</code> &gt; <code>http://example.com/webhp</code></label>
872
</td>
873
</tr>
874
+ <tr>
875
+ <th scope="row" style="white-space:nowrap"><?php _e('Post types', 'cpd') ?>:</th>
876
+ <td>
877
+ <input class="code" type="text" name="cpd_posttypes" size="50" value="<?php echo str_replace(',', ', ', $o['posttypes']); ?>" /><br/>
878
+ <?php _e('Only count these post types. Leave empty to count them all.', 'cpd') ?><br/>
879
+ <?php printf(__('Current post types: %s', 'cpd'), '<code>'.implode(', ', get_post_types()).'</code>'); ?>
880
+ </td>
881
+ </tr>
882
+
883
+
884
</table>
885
</fieldset>
886
902
903
<table class="form-table">
904
<tr>
905
+ <th scope="row" style="white-space:nowrap"><?php _e('Who can see it', 'cpd') ?>:</th>
906
<td>
907
<?php $cus = (in_array($o['whocansee'], array('manage_options','manage_links','publish_posts','edit_posts','read'))) ? 0 : 1 ?>
908
<select id="cpd_whocansee" name="cpd_whocansee" onchange="checkcustom()">
921
</td>
922
</tr>
923
<tr>
924
+ <th scope="row" style="white-space:nowrap"><?php _e('Visitors per post', 'cpd') ?>:</th>
925
<td><input class="code" type="text" name="cpd_dashboard_posts" size="3" value="<?php echo $o['dashboard_posts']; ?>" /> <?php _e('How many posts do you want to see on dashboard page?', 'cpd') ?></td>
926
</tr>
927
<tr>
928
+ <th scope="row" style="white-space:nowrap"><?php _e('Latest Counts - Posts', 'cpd') ?>:</th>
929
<td><input class="code" type="text" name="cpd_dashboard_last_posts" size="3" value="<?php echo $o['dashboard_last_posts']; ?>" /> <?php _e('How many posts do you want to see on dashboard page?', 'cpd') ?></td>
930
</tr>
931
<tr>
932
+ <th scope="row" style="white-space:nowrap"><?php _e('Latest Counts - Days', 'cpd') ?>:</th>
933
<td><input class="code" type="text" name="cpd_dashboard_last_days" size="3" value="<?php echo $o['dashboard_last_days']; ?>" /> <?php _e('How many days do you want look back?', 'cpd') ?></td>
934
</tr>
935
<tr>
936
+ <th scope="row" style="white-space:nowrap"><?php _e('Chart - Days', 'cpd') ?>:</th>
937
<td><input class="code" type="text" name="cpd_chart_days" size="3" value="<?php echo $o['chart_days']; ?>" /> <?php _e('How many days do you want look back?', 'cpd') ?></td>
938
</tr>
939
<tr>
940
+ <th scope="row" style="white-space:nowrap"><?php _e('Chart - Height', 'cpd') ?>:</th>
941
<td><input class="code" type="text" name="cpd_chart_height" size="3" value="<?php echo $o['chart_height']; ?>" /> px - <?php _e('Height of the biggest bar', 'cpd') ?></td>
942
</tr>
943
<?php if ($cpd_geoip) { ?>
944
<tr>
945
+ <th scope="row" style="white-space:nowrap"><?php _e('Countries', 'cpd') ?>:</th>
946
<td><input class="code" type="text" name="cpd_countries" size="3" value="<?php echo $o['countries']; ?>" /> <?php _e('How many countries do you want to see on dashboard page?', 'cpd') ?></td>
947
</tr>
948
<?php } ?>
949
<tr>
950
+ <th scope="row" style="white-space:nowrap"><?php _e('Browsers', 'cpd') ?>:</th>
951
+ <td><input class="code" type="text" name="cpd_clients" size="50" value="<?php echo $o['clients']; ?>" /><br/><?php _e('Substring of the user agent, separated by comma', 'cpd') ?></td>
952
</tr>
953
<tr>
954
+ <th scope="row" style="white-space:nowrap"><?php _e('Search strings', 'cpd') ?>/<?php _e('Referrers - Entries', 'cpd') ?>:</th>
955
<td><input class="code" type="text" name="cpd_dashboard_referers" size="3" value="<?php echo $o['dashboard_referers']; ?>" /> <?php _e('How many referrers do you want to see on dashboard page?', 'cpd') ?></td>
956
</tr>
957
<tr>
958
+ <th scope="row" style="white-space:nowrap"><?php _e('Search strings', 'cpd') ?>/<?php _e('Referrers - Days', 'cpd') ?>:</th>
959
<td><input class="code" type="text" name="cpd_referers_last_days" size="3" value="<?php echo $o['referers_last_days']; ?>" /> <?php _e('How many days do you want look back?', 'cpd') ?></td>
960
</tr>
961
<tr>
962
+ <th scope="row" style="white-space:nowrap"><?php _e('Local URLs', 'cpd') ?>:</th>
963
<td><label for="cpd_localref"><input type="checkbox" name="cpd_localref" id="cpd_localref" <?php checked($o['localref'], 1) ?> /> <?php _e('Show local referrers too.', 'cpd') ?> (<?php echo bloginfo('url') ?>/...)</label></td>
964
</tr>
965
</table>
970
<legend><span class="cpd_icon cpd_settings">&nbsp;</span> <?php _e('Posts') ?> / <?php _e('Pages') ?></legend>
971
<table class="form-table">
972
<tr>
973
+ <th scope="row" style="white-space:nowrap"><?php _e('Show in lists', 'cpd') ?>:</th>
974
<td><label for="cpd_show_in_lists"><input type="checkbox" name="cpd_show_in_lists" id="cpd_show_in_lists" <?php checked($o['show_in_lists'], 1) ?> /> <?php _e('Show "Reads per Post" in a new column in post management views.', 'cpd') ?></label></td>
975
</tr>
976
</table>
986
</th>
987
</tr>
988
<tr>
989
+ <th scope="row" style="white-space:nowrap"><?php _e('Start date', 'cpd') ?>:</th>
990
<td><input class="code" type="text" name="cpd_startdate" size="10" value="<?php echo $o['startdate']; ?>" /> <?php _e('Your old Counter starts at?', 'cpd') ?> [yyyy-mm-dd]</td>
991
</tr>
992
<tr>
993
+ <th scope="row" style="white-space:nowrap"><?php _e('Start count', 'cpd') ?>:</th>
994
<td><input class="code" type="text" name="cpd_startcount" size="10" value="<?php echo $o['startcount']; ?>" /> <?php _e('Add this value to "Total visitors".', 'cpd') ?></td>
995
</tr>
996
<tr>
997
+ <th scope="row" style="white-space:nowrap"><?php _e('Start count', 'cpd') ?>:</th>
998
<td><input class="code" type="text" name="cpd_startreads" size="10" value="<?php echo $o['startreads']; ?>" /> <?php _e('Add this value to "Total reads".', 'cpd') ?></td>
999
</tr>
1000
</table>
1005
<legend><span class="cpd_icon cpd_settings">&nbsp;</span> <?php _e('Stylesheet', 'cpd') ?></legend>
1006
<table class="form-table">
1007
<tr>
1008
+ <th scope="row" style="white-space:nowrap"><?php _e('NO Stylesheet in Frontend', 'cpd') ?>:</th>
1009
<td><label for="cpd_no_front_css"><input type="checkbox" name="cpd_no_front_css" id="cpd_no_front_css" <?php checked($o['no_front_css'], 1) ?> /> <?php _e('Do not load the stylesheet "counter.css" in frontend.', 'cpd') ?></label></td>
1010
</tr>
1011
</table>
1016
<legend><span class="cpd_icon cpd_settings">&nbsp;</span> <?php _e('Backup', 'cpd') ?></legend>
1017
<table class="form-table">
1018
<tr>
1019
+ <th scope="row" style="white-space:nowrap"><?php _e('Entries per pass', 'cpd') ?>:</th>
1020
<td>
1021
<input class="code" type="text" name="cpd_backup_part" size="10" value="<?php echo $o['backup_part']; ?>" />
1022
<?php _e('How many entries should be saved per pass? Default: 10000', 'cpd') ?><br/>
1043
</form>
1044
1045
</div><!-- poststuff -->
1046
+
1047
+ <?php endif; // tabs ?>
1048
+
1049
</div><!-- wrap -->
1050
1051
<?php } // End switch($mode)
counter.css CHANGED
@@ -47,26 +47,19 @@ h2 .cpd_icon {
47
}
48
49
.cpd_settings fieldset {
50
- margin: 5px 5px 10px;
51
padding: 0 10px 0px;
52
border: 1px solid #dfdfdf;
53
- border-radius: 3px;
54
- -moz-border-radius: 3px;
55
- -webkit-border-radius: 3px;
56
background: #fafafa;
57
}
58
59
.cpd_settings legend {
60
background: #eee;
61
border: 1px solid #dfdfdf;
62
- border-radius: 3px;
63
- -moz-border-radius: 3px;
64
- -webkit-border-radius: 3px;
65
margin: 0 10px;
66
padding: 1px 7px 2px;
67
text-shadow: 0 1px 0 #fff;
68
- font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif;
69
- font-size: 15px;
70
}
71
72
.cpd_settings .form-table {
@@ -82,7 +75,7 @@ h2 .cpd_icon {
82
background: url(img/cpd_sprites.png) no-repeat top left;
83
width: 16px;
84
height: 16px;
85
- vertical-align: text-bottom;
86
padding: 0 !important;
87
}
88
.cpd_backup{background-position: 0 0}
@@ -106,13 +99,25 @@ h2 .cpd_icon {
106
.cpd_update{background-position: 0 -828px}
107
.cpd_user{background-position: 0 -874px}
108
109
/* dashboard */
110
111
#cpd-flot-place {
112
padding: 5px;
113
background: #fff;
114
- border-radius: 3px;
115
border: 1px #ccc solid;
116
}
117
118
#cpd-flot-choice {
@@ -133,7 +138,6 @@ h2 .cpd_icon {
133
text-align: center;
134
padding: 2px 4px;
135
border: 1px solid #ddd;
136
- border-radius: 4px;
137
background-color: #fff;
138
box-shadow: 3px 3px 4px rgba(0, 0, 0, 0.4);
139
}
47
}
48
49
.cpd_settings fieldset {
50
+ margin: 5px 5px 20px;
51
padding: 0 10px 0px;
52
border: 1px solid #dfdfdf;
53
background: #fafafa;
54
}
55
56
.cpd_settings legend {
57
background: #eee;
58
border: 1px solid #dfdfdf;
59
margin: 0 10px;
60
padding: 1px 7px 2px;
61
text-shadow: 0 1px 0 #fff;
62
+ font-size:15px;
63
}
64
65
.cpd_settings .form-table {
75
background: url(img/cpd_sprites.png) no-repeat top left;
76
width: 16px;
77
height: 16px;
78
+ vertical-align: middle;
79
padding: 0 !important;
80
}
81
.cpd_backup{background-position: 0 0}
99
.cpd_update{background-position: 0 -828px}
100
.cpd_user{background-position: 0 -874px}
101
102
+ .cpd_logo {
103
+ width: 32px;
104
+ height: 32px;
105
+ vertical-align: middle;
106
+ }
107
+
108
/* dashboard */
109
110
#cpd-flot-place {
111
padding: 5px;
112
background: #fff;
113
border: 1px #ccc solid;
114
+ margin: 5px 8px;
115
+ }
116
+
117
+ #cpd-flot-place .button {
118
+ padding: 2px 10px;
119
+ height: 20px;
120
+ line-height: 14px;
121
}
122
123
#cpd-flot-choice {
138
text-align: center;
139
padding: 2px 4px;
140
border: 1px solid #ddd;
141
background-color: #fff;
142
box-shadow: 3px 3px 4px rgba(0, 0, 0, 0.4);
143
}
counter.php CHANGED
@@ -3,14 +3,14 @@
3
Plugin Name: Count Per Day
4
Plugin URI: http://www.tomsdimension.de/wp-plugins/count-per-day
5
Description: Counter, shows reads and visitors per page; today, yesterday, last week, last months ... on dashboard, per shortcode or in widget.
6
- Version: 3.2.10
7
License: Postcardware
8
Author: Tom Braider
9
Author URI: http://www.tomsdimension.de
10
*/
11
12
$cpd_dir_name = 'count-per-day';
13
- $cpd_version = '3.2.10';
14
15
if (strpos($_SERVER['SERVER_NAME'], '.test'))
16
$cpd_path = str_replace('/', DIRECTORY_SEPARATOR, ABSPATH.PLUGINDIR.'/'.$cpd_dir_name.'/');
@@ -82,6 +82,19 @@ function count( $x, $page = 'x' )
82
// ajax counter on cached pages
83
$page = (int) $page;
84
85
// get userlevel from role
86
if (current_user_can('administrator')) $userlevel = 10;
87
else if (current_user_can('editor')) $userlevel = 7;
@@ -136,7 +149,7 @@ function count( $x, $page = 'x' )
136
$gi = cpd_geoip_open($cpd_path.'geoip/GeoIP.dat', GEOIP_STANDARD);
137
138
if (!filter_var($userip, FILTER_VALIDATE_IP))
139
- $userip = ' 127.0.0.1';
140
141
if ( strpos($userip,'.') !== false && strpos($userip,':') === false)
142
{
@@ -227,7 +240,7 @@ function dashboardReadsAtAll()
227
<li><?php _e('Visitors last week', 'cpd') ?>: <b><?php $this->getUserLastWeek() ?></b></li>
228
<li><?php _e('Visitors', 'cpd') ?> <?php echo $thisMonth ?>: <b><?php $this->getUserThisMonth() ?></b></li>
229
<li>&Oslash; <?php _e('Visitors per day', 'cpd') ?>: <b><?php $this->getUserPerDay($this->options['dashboard_last_days']) ?></b></li>
230
- <li><?php _e('Counter starts on', 'cpd') ?>: <b><?php $this->getFirstCount() ?></b></li>
231
<li><?php _e('Most visited day', 'cpd') ?>: <b class="cpd-r"><?php $this->getDayWithMostReads(1) ?></b></li>
232
<li><?php _e('Most visited day', 'cpd') ?>: <b class="cpd-r"><?php $this->getDayWithMostUsers(1) ?></b></li>
233
</ul>
@@ -240,6 +253,8 @@ function dashboardReadsAtAll()
240
*/
241
function getFlotChart( $limit = 0 )
242
{
243
global $wpdb;
244
if ( $limit == 0 )
245
$limit = (!empty($this->options['chart_days'])) ? $this->options['chart_days'] : 30;
@@ -881,6 +896,36 @@ function getVisitedPostsOnDay( $date = 0, $limit = 0, $show_form = true, $show_n
881
if ($return) return $r; else echo $r;
882
}
883
884
/**
885
* shows little browser statistics
886
*/
@@ -1089,10 +1134,10 @@ function getUserPer_SQL( $sql, $name = '', $frontend = false, $limit = 0 )
1089
}
1090
1091
$r .= '<a href="'.get_bloginfo('url');
1092
- if ( $row->tax == 'category' )
1093
// category
1094
$r .= '?cat='.abs($row->post_id).'">- '.__($row->tag_cat_name).' ('.__('Category').') -';
1095
- else if ( $row->tax )
1096
// tag
1097
$r .= '?tag='.$row->tag_cat_slug.'">- '.__($row->tag_cat_name).' ('.__('Tag').') -';
1098
else if ( $row->post_id == 0 )
@@ -1109,6 +1154,12 @@ function getUserPer_SQL( $sql, $name = '', $frontend = false, $limit = 0 )
1109
return $r;
1110
}
1111
1112
/**
1113
* shows searchstrings
1114
*/
@@ -1152,7 +1203,7 @@ function getSearches( $limit = 0, $days = 0, $return = false )
1152
$r .= '<ul class="cpd_front_list">';
1153
foreach ( $search as $day => $s )
1154
if (is_array($s))
1155
- $r .= '<li><div style="font-weight:bold">'.$day.'</div> '.implode(', ', $s).'</li>'."\n";
1156
$r .= '</ul>';
1157
if ($return) return $r; else echo $r;
1158
}
@@ -1256,7 +1307,7 @@ function getMap( $what = 'visitors', $width = 500, $height = 340, $min = 0 )
1256
1257
1258
/**
1259
- widget class
1260
*/
1261
class CountPerDay_Widget extends WP_Widget
1262
{
@@ -1433,6 +1484,96 @@ class CountPerDay_Widget extends WP_Widget
1433
}
1434
} // widget class
1435
1436
/**
1437
* uninstall function, deletes tables and options
1438
*/
3
Plugin Name: Count Per Day
4
Plugin URI: http://www.tomsdimension.de/wp-plugins/count-per-day
5
Description: Counter, shows reads and visitors per page; today, yesterday, last week, last months ... on dashboard, per shortcode or in widget.
6
+ Version: 3.3
7
License: Postcardware
8
Author: Tom Braider
9
Author URI: http://www.tomsdimension.de
10
*/
11
12
$cpd_dir_name = 'count-per-day';
13
+ $cpd_version = '3.3';
14
15
if (strpos($_SERVER['SERVER_NAME'], '.test'))
16
$cpd_path = str_replace('/', DIRECTORY_SEPARATOR, ABSPATH.PLUGINDIR.'/'.$cpd_dir_name.'/');
82
// ajax counter on cached pages
83
$page = (int) $page;
84
85
+ $pt = get_post_type($page);
86
+
87
+ // don't count these post type
88
+ if ( !empty($this->options['posttypes']) && !in_array($pt, explode(',', $this->options['posttypes'])) )
89
+ {
90
+ if ($this->options['debug'])
91
+ $this->queries[] = "Post Type: $pt - don't count it";
92
+ return;
93
+ }
94
+
95
+ if ($this->options['debug'])
96
+ $this->queries[] = "Post Type: $pt - count it";
97
+
98
// get userlevel from role
99
if (current_user_can('administrator')) $userlevel = 10;
100
else if (current_user_can('editor')) $userlevel = 7;
149
$gi = cpd_geoip_open($cpd_path.'geoip/GeoIP.dat', GEOIP_STANDARD);
150
151
if (!filter_var($userip, FILTER_VALIDATE_IP))
152
+ $userip = '127.0.0.1';
153
154
if ( strpos($userip,'.') !== false && strpos($userip,':') === false)
155
{
240
<li><?php _e('Visitors last week', 'cpd') ?>: <b><?php $this->getUserLastWeek() ?></b></li>
241
<li><?php _e('Visitors', 'cpd') ?> <?php echo $thisMonth ?>: <b><?php $this->getUserThisMonth() ?></b></li>
242
<li>&Oslash; <?php _e('Visitors per day', 'cpd') ?>: <b><?php $this->getUserPerDay($this->options['dashboard_last_days']) ?></b></li>
243
+ <li><?php _e('Since', 'cpd') ?>: <b><?php $this->getFirstCount() ?></b></li>
244
<li><?php _e('Most visited day', 'cpd') ?>: <b class="cpd-r"><?php $this->getDayWithMostReads(1) ?></b></li>
245
<li><?php _e('Most visited day', 'cpd') ?>: <b class="cpd-r"><?php $this->getDayWithMostUsers(1) ?></b></li>
246
</ul>
253
*/
254
function getFlotChart( $limit = 0 )
255
{
256
+ wp_enqueue_script('cpd_flot', $this->dir.'/js/jquery.flot.min.js', 'jQuery');
257
+
258
global $wpdb;
259
if ( $limit == 0 )
260
$limit = (!empty($this->options['chart_days'])) ? $this->options['chart_days'] : 30;
896
if ($return) return $r; else echo $r;
897
}
898
899
+ /**
900
+ * shows most visited pages in last days
901
+ * @param integer $days days to calc (last days)
902
+ * @param integer $limit count of visitors (last posts)
903
+ */
904
+ function getLastVisitors( $days = 0, $limit = 0 )
905
+ {
906
+ global $wpdb;
907
+ if ( $days == 0 )
908
+ $days = $this->options['dashboard_last_days'];
909
+ if ( $limit == 0 )
910
+ $limit = $this->options['dashboard_last_posts'];
911
+ $date = date_i18n('Y-m-d', current_time('timestamp') - 86400 * $days);
912
+
913
+ $sql = $wpdb->prepare("
914
+ SELECT COUNT(id) posts,
915
+ ip AS longip,
916
+ $this->ntoa(ip) AS ip,
917
+ date,
918
+ country,
919
+ client
920
+ FROM $wpdb->cpd_counter c
921
+ WHERE c.date >= %s
922
+ GROUP BY ip, date, client
923
+ ORDER BY posts DESC, date DESC
924
+ LIMIT %d",
925
+ $date, $limit);
926
+ return $this->mysqlQuery('rows', $sql, 'getLastVisitors '.__LINE__);
927
+ }
928
+
929
/**
930
* shows little browser statistics
931
*/
1134
}
1135
1136
$r .= '<a href="'.get_bloginfo('url');
1137
+ if ( !empty($row->tax) && $row->tax == 'category' )
1138
// category
1139
$r .= '?cat='.abs($row->post_id).'">- '.__($row->tag_cat_name).' ('.__('Category').') -';
1140
+ else if ( !empty($row->tax) )
1141
// tag
1142
$r .= '?tag='.$row->tag_cat_slug.'">- '.__($row->tag_cat_name).' ('.__('Tag').') -';
1143
else if ( $row->post_id == 0 )
1154
return $r;
1155
}
1156
1157
+
1158
+ /**
1159
+ * shows visitors of the last days
1160
+ */
1161
+
1162
+
1163
/**
1164
* shows searchstrings
1165
*/
1203
$r .= '<ul class="cpd_front_list">';
1204
foreach ( $search as $day => $s )
1205
if (is_array($s))
1206
+ $r .= '<li><div style="font-weight:bold">'.mysql2date(get_option('date_format'), $day).'</div> '.implode(', ', $s).'</li>'."\n";
1207
$r .= '</ul>';
1208
if ($return) return $r; else echo $r;
1209
}
1307
1308
1309
/**
1310
+ * widget class
1311
*/
1312
class CountPerDay_Widget extends WP_Widget
1313
{
1484
}
1485
} // widget class
1486
1487
+
1488
+
1489
+ /*
1490
+ * Popular Posts Widget
1491
+ * @url http://www.leaseweblabs.com/2014/01/popular-posts-count-per-day-wordpress-plugin/
1492
+ */
1493
+ class CountPerDay_PopularPostsWidget extends WP_Widget
1494
+ {
1495
+
1496
+ function __construct()
1497
+ {
1498
+ parent::__construct(
1499
+ // Base ID of your widget
1500
+ 'countperday_popular_posts_widget',
1501
+ // Widget name will appear in UI
1502
+ 'Count per Day - '.__('Popular Posts', 'cpd'),
1503
+ // Widget description
1504
+ array( 'description' => __('List of Popular Posts', 'cpd') )
1505
+ );
1506
+ }
1507
+
1508
+ // Creating widget front-end
1509
+ // This is where the action happens
1510
+ public function widget( $args, $instance )
1511
+ {
1512
+ $title = apply_filters( 'widget_title', $instance['title'] );
1513
+ $days = $instance['days' ] + 0;
1514
+ $limit = $instance['limit'] + 0;
1515
+ $head = $instance['head' ] ? true : false;
1516
+ $count = $instance['count'] ? true : false;
1517
+ // before and after widget arguments are defined by themes
1518
+ echo $args['before_widget'];
1519
+ if ( ! empty( $title ) ) {
1520
+ echo $args['before_title'].$title.$args['after_title'];
1521
+ }
1522
+ // This is where you run the code and display the output
1523
+ global $count_per_day;
1524
+ $html = $count_per_day->getMostVisitedPosts($days, $limit, 1, 1, 1);
1525
+ if (!$head ) $html = preg_replace('/<small>[^<]*<\/small>/','',$html);
1526
+ if (!$count) $html = preg_replace('/<b>[^<]*<\/b>/','',$html);
1527
+ echo $html;
1528
+ echo $args['after_widget'];
1529
+ }
1530
+
1531
+ // Widget Backend
1532
+ public function form( $instance )
1533
+ {
1534
+ $title = isset($instance['title']) ? $instance['title'] : __('Popular Posts', 'cpd');
1535
+ $days = isset($instance['days' ]) ? $instance['days' ] : '7';
1536
+ $limit = isset($instance['limit']) ? $instance['limit'] : '10';
1537
+ $head = isset($instance['head' ]) ? $instance['head' ] : false;
1538
+ $count = isset($instance['count']) ? $instance['count'] : false;
1539
+ // Widget admin form
1540
+ ?>
1541
+ <p>
1542
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'cpd' ); ?></label>
1543
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
1544
+ </p>
1545
+ <p>
1546
+ <label for="<?php echo $this->get_field_id( 'days' ); ?>"><?php _e( 'Days:', 'cpd' ); ?></label>
1547
+ <input class="widefat" id="<?php echo $this->get_field_id( 'days' ); ?>" name="<?php echo $this->get_field_name( 'days' ); ?>" type="text" value="<?php echo esc_attr( $days ); ?>" />
1548
+ </p>
1549
+ <p>
1550
+ <label for="<?php echo $this->get_field_id( 'limit' ); ?>"><?php _e( 'Limit:', 'cpd' ); ?></label>
1551
+ <input class="widefat" id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo esc_attr( $limit ); ?>" />
1552
+ </p>
1553
+ <p>
1554
+ <label for="<?php echo $this->get_field_id( 'head' ); ?>"><?php _e( 'Show header:', 'cpd' ); ?></label>
1555
+ <input class="widefat" id="<?php echo $this->get_field_id( 'head' ); ?>" name="<?php echo $this->get_field_name( 'head' ); ?>" type="checkbox" <?php echo $head?'checked="checked"':'' ?> />
1556
+ </p>
1557
+ <p>
1558
+ <label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e( 'Show counters:', 'cpd' ); ?></label>
1559
+ <input class="widefat" id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>" type="checkbox" <?php echo $count?'checked="checked"':'' ?> />
1560
+ </p>
1561
+ <?php
1562
+ }
1563
+
1564
+ // Updating widget replacing old instances with new
1565
+ public function update( $new_instance, $old_instance ) {
1566
+ $instance = array();
1567
+ $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
1568
+ $instance['days' ] = ( ! empty( $new_instance['days' ] ) ) ? strip_tags( $new_instance['days' ] ) : '';
1569
+ $instance['limit'] = ( ! empty( $new_instance['limit'] ) ) ? strip_tags( $new_instance['limit'] ) : '';
1570
+ $instance['head' ] = ( ! empty( $new_instance['head' ] ) ) ? strip_tags( $new_instance['head' ] ) : '';
1571
+ $instance['count'] = ( ! empty( $new_instance['count'] ) ) ? strip_tags( $new_instance['count'] ) : '';
1572
+ return $instance;
1573
+ }
1574
+ } // CountPerDay_PopularPostsWidget
1575
+
1576
+
1577
/**
1578
* uninstall function, deletes tables and options
1579
*/
download.php CHANGED
@@ -6,11 +6,19 @@
6
if ( empty($_GET['f']) || empty($_GET['n']) )
7
die('no way');
8
$file = sys_get_temp_dir().'/'.$_GET['f'];
9
- if ( !in_array(substr($file, -3), array('.gz','sql','txt','tmp')) || strpos($file, '..') !== false )
10
die('no way');
11
if (!file_exists($file))
12
die('file not found');
13
$name = stripslashes($_GET['n']);
14
- (substr($name, -2) == 'gz') ? header('Content-Type: application/x-gzip') : header('Content-Type: text/plain');
15
header("Content-Disposition: attachment; filename=\"$name\"");
16
readfile($file);
6
if ( empty($_GET['f']) || empty($_GET['n']) )
7
die('no way');
8
$file = sys_get_temp_dir().'/'.$_GET['f'];
9
+ if (strpos($file, '..') !== false
10
+ && strpos($file, 'cpdexport') !== 0
11
+ && strpos($file, 'cpdbackup') !== 0
12
+ )
13
die('no way');
14
if (!file_exists($file))
15
die('file not found');
16
$name = stripslashes($_GET['n']);
17
+ if (substr($name, -2) == 'gz')
18
+ header('Content-Type: application/x-gzip');
19
+ else if (substr($name, -3) == 'csv')
20
+ header('Content-Type: text/csv');
21
+ else
22
+ header('Content-Type: text/plain');
23
header("Content-Disposition: attachment; filename=\"$name\"");
24
readfile($file);
geoip/GeoIP.dat CHANGED
Binary file
img/cpd_logo.png ADDED
Binary file
locale/cpd-az_AZ.po CHANGED
@@ -1,9 +1,9 @@
1
msgid ""
2
msgstr ""
3
- "Project-Id-Version: Count Per Day v3.2.10\n"
4
"Report-Msgid-Bugs-To: \n"
5
"POT-Creation-Date: 2008-11-02 12:13+0100\n"
6
- "PO-Revision-Date: 2014-05-08 08:13:03+0000\n"
7
"Last-Translator: Madat <translator.baku@gmail.com>\n"
8
"Language-Team: Webmestre <translator.baku@gmail.com>\n"
9
"MIME-Version: 1.0\n"
@@ -25,297 +25,295 @@ msgstr ""
25
msgid "Options updated"
26
msgstr "Opsiyalar yaddaşda saxlanılıb"
27
28
- #: counter-options.php:113
29
#, php-format
30
#@ cpd
31
msgid "Database cleaned. %s rows deleted."
32
msgstr "Məlumat bazası silinib. %s sətir silinib."
33
34
- #: counter-options.php:128
35
- #: counter-options.php:719
36
#@ cpd
37
msgid "UNINSTALL Count per Day"
38
msgstr "DEİNSTALYASİYA Gündəlik Sayğac. "
39
40
- #: counter-options.php:133
41
- #: counter-options.php:134
42
- #: counter-options.php:135
43
#, php-format
44
#@ cpd
45
msgid "Table %s deleted"
46
msgstr "Cədvəl %s silinib"
47
48
- #: counter-options.php:136
49
#@ cpd
50
msgid "Options deleted"
51
msgstr "Opsiyalar silinib"
52
53
- #: counter-options.php:377
54
- #: counter-options.php:705
55
#@ cpd
56
msgid "Uninstall"
57
msgstr "Deinstalyasiya"
58
59
- #: counter-options.php:378
60
#@ cpd
61
msgid "Click here"
62
msgstr "Bura basın"
63
64
- #: counter-options.php:378
65
#@ cpd
66
msgid "to finish the uninstall and to deactivate \"Count per Day\"."
67
msgstr "deinstalyasiyanı bitirilməsi və \"Gündəlik Sayğac\" deaktivizasiya üçün. "
68
69
- #: counter-options.php:752
70
#@ cpd
71
msgid "Online time"
72
msgstr "Onlayn vaxt"
73
74
- #: counter-options.php:753
75
#@ cpd
76
msgid "Seconds for online counter. Used for \"Visitors online\" on dashboard page."
77
msgstr "Onlayn sayğac üçün saniyələr. \"İnstrumentlər panelində\" \"Onlayn qonaqlar \" üçün istifadə olunur."
78
79
- #: counter-options.php:756
80
#@ cpd
81
msgid "Logged on Users"
82
msgstr "Daxil olmuş istifadəçilər"
83
84
- #: counter-options.php:758
85
#@ cpd
86
msgid "count too"
87
msgstr "onu da saymaq"
88
89
- #: counter-options.php:770
90
#@ cpd
91
msgid "Auto counter"
92
msgstr "Avtomatik sayğac"
93
94
- #: counter-options.php:771
95
#@ cpd
96
msgid "Counts automatically single-posts and pages, no changes on template needed."
97
msgstr "Ayrica yazıları və səhifələri avtomatik olaraq sayır, heç bir dəyişiklik etmək şablonda lazım olmayacaq."
98
99
- #: counter-options.php:774
100
#@ cpd
101
msgid "Bots to ignore"
102
msgstr "Botları əhəmiyyət verməmək"
103
104
- #: counter-options.php:952
105
#@ cpd
106
msgid "Update options"
107
msgstr "Opsiyaları yeniləşdirmək"
108
109
- #: counter-options.php:553
110
- #: counter-options.php:561
111
#@ cpd
112
msgid "Clean the database"
113
msgstr "Məlumat bazasının silmək"
114
115
- #: counter-options.php:557
116
#@ cpd
117
msgid "You can clean the counter table by delete the \"spam data\".<br />If you add new bots above the old \"spam data\" keeps in the database.<br />Here you can run the bot filter again and delete the visits of the bots."
118
msgstr "\"Spam məlumatı \" silərək Siz sayğacını təmizləyə bilərsiniz. <br /> Əgər Siz köhnə \"spam məlumatının \" üstəndən yeni botlarını əlavə etsəniz, Siz məlumat bazasını qorura bilərsiniz. <br /> Burada Siz yenidən bot-filtrı yenidən qoşa bilərsiniz və botun baş çəkməsini silə bilərsiniz."
119
120
- #: counter-options.php:708
121
#@ cpd
122
msgid "If \"Count per Day\" only disabled the tables in the database will be preserved."
123
msgstr "Əgər \"Gündəlik sayğac \" aktivizasiya olunubsa, onda cədvəllər məlumat bazasında qorunacaqdır."
124
125
- #: counter-options.php:709
126
#@ cpd
127
msgid "Here you can delete the tables and disable \"Count per Day\"."
128
msgstr "Siz burada \"Gündəlik sayğacı\" silə və söndürə bilərsiniz."
129
130
- #: counter-options.php:712
131
#@ cpd
132
msgid "WARNING"
133
msgstr "DİQQƏT"
134
135
- #: counter-options.php:713
136
#@ cpd
137
msgid "These tables (with ALL counter data) will be deleted."
138
msgstr "Bu cədvəllər (Bütün sayğacın məlumatları ilə birlikdə) silinəcəkdirlər."
139
140
- #: counter-options.php:715
141
#@ cpd
142
msgid "If \"Count per Day\" re-installed, the counter starts at 0."
143
msgstr " \"Gündəlin sayğac\" yenidən instalyasiya edildikdən sonra, sayğac 0-dan başlayır."
144
145
- #: counter-options.php:695
146
- #: counter-options.php:718
147
#@ cpd
148
msgid "Yes"
149
msgstr "Bəli"
150
151
- #: counter-options.php:719
152
#@ cpd
153
msgid "You are sure to disable Count per Day and delete all data?"
154
msgstr "Siz əminsiniz ki, \"Gündəlik sayğacı\" söndürmək və bütün məlumatları silmək istəyirsiniz?"
155
156
- #: counter-core.php:820
157
- #: counter.php:1283
158
#@ cpd
159
msgid "Statistics"
160
msgstr "Statistika"
161
162
- #: counter-core.php:788
163
- #: counter.php:223
164
- #: counter.php:1167
165
- #: counter.php:1361
166
#@ cpd
167
msgid "Total visitors"
168
msgstr "Ümümi qonaqların sayı"
169
170
- #: counter.php:224
171
- #: counter.php:1367
172
#@ cpd
173
msgid "Visitors currently online"
174
msgstr "İndi qonaqların sayı saytda "
175
176
- #: counter.php:225
177
- #: counter.php:1362
178
#@ cpd
179
msgid "Visitors today"
180
msgstr "Qonaqlar sayı bu gün"
181
182
- #: counter.php:226
183
- #: counter.php:1363
184
#@ cpd
185
msgid "Visitors yesterday"
186
msgstr "Qonaqların sayı dünən"
187
188
- #: counter.php:227
189
- #: counter.php:1364
190
#@ cpd
191
msgid "Visitors last week"
192
msgstr "Qonaqların sayı keçən həftə"
193
194
- #: counter.php:230
195
- #: counter.php:924
196
- #: counter.php:1368
197
#@ cpd
198
msgid "Counter starts on"
199
msgstr "Sayğac başlanır -dan"
200
201
- #: counter-core.php:794
202
- #: counter.php:229
203
- #: counter.php:328
204
- #: counter.php:1169
205
- #: counter.php:1366
206
#: userperspan.php:46
207
#@ cpd
208
msgid "Visitors per day"
209
msgstr "Gonaqlarn sayı gündə"
210
211
- #: counter-core.php:790
212
- #: counter.php:1365
213
#@ cpd
214
msgid "Visitors per month"
215
msgstr "Qonaqların sayı ayda"
216
217
- #: counter-core.php:792
218
- #: counter-options.php:834
219
#@ cpd
220
msgid "Visitors per post"
221
msgstr "Qonaqların sayı yazışa görə"
222
223
- #: counter-options.php:123
224
#@ cpd
225
msgid "Counter reseted."
226
msgstr "Sayğac yenidən başlayıb"
227
228
- #: counter-options.php:799
229
#@ default
230
msgid "Dashboard"
231
msgstr "Konsol"
232
233
- #: counter-options.php:835
234
- #: counter-options.php:839
235
#@ cpd
236
msgid "How many posts do you want to see on dashboard page?"
237
msgstr "Konsol səhifəsində neçə yazı Siz görmək istiyardiniz?"
238
239
- #: counter-options.php:838
240
#@ cpd
241
msgid "Latest Counts - Posts"
242
msgstr "Son sayğaclar - Yazılar"
243
244
- #: counter-options.php:842
245
#@ cpd
246
msgid "Latest Counts - Days"
247
msgstr "Son sayğaclar - Günlər"
248
249
- #: counter-options.php:843
250
- #: counter-options.php:847
251
- #: counter-options.php:869
252
#@ cpd
253
msgid "How many days do you want look back?"
254
msgstr "Necə gün əvvəl olan statistikanı görmək istiyərdiniz?"
255
256
- #: counter-options.php:846
257
#@ cpd
258
msgid "Chart - Days"
259
msgstr "Cədvəl - Günlər"
260
261
- #: counter-options.php:850
262
#@ cpd
263
msgid "Chart - Height"
264
msgstr "Cədvəl - Hündürlük"
265
266
- #: counter-options.php:851
267
#@ cpd
268
msgid "Height of the biggest bar"
269
msgstr "Ən böyük olan sütunun hündürlüyü"
270
271
- #: counter-options.php:883
272
#@ cpd
273
msgid "Show in lists"
274
msgstr "Siyahıda göstərmək"
275
276
- #: counter-options.php:884
277
#@ cpd
278
msgid "Show \"Reads per Post\" in a new column in post management views."
279
msgstr "Yazılaşların idarəetməsində yeni sütunda \"Məlumatları oxumaq\" göstərmək."
280
281
- #: counter-options.php:686
282
- #: counter-options.php:696
283
#@ cpd
284
msgid "Reset the counter"
285
msgstr "Sayğacı yenidən 0 qoymaq"
286
287
- #: counter-options.php:689
288
#@ cpd
289
msgid "You can reset the counter by empty the table. ALL TO 0!<br />Make a backup if you need the current data!"
290
msgstr "Cədvəli təmizliyərək Siz sayğacı yenidən 0 qoya bilərsiniz. HAMSI 0!<br />Sizə hazırki məlumatlar lazımdırsan onda rezerv kopiyasını saxlayın!"
291
292
- #: counter.php:756
293
#, php-format
294
#@ cpd
295
msgid "The %s most visited posts in last %s days:"
296
msgstr "Son %s gün ərzində ən çox %s oxunan yazılar %s :"
297
298
- #: counter-core.php:652
299
- #: counter-options.php:401
300
- #: counter-options.php:740
301
#@ default
302
msgid "Settings"
303
msgstr "Kökləmələr"
304
305
- #: counter.php:327
306
#@ cpd
307
msgid "Reads per day"
308
msgstr "Gün ərzində oxunuş"
309
310
- #: counter-core.php:1464
311
- #: counter-options.php:789
312
- #: counter.php:222
313
- #: counter.php:974
314
#@ cpd
315
msgid "Reads"
316
msgstr "Oxumalar"
317
318
- #: counter.php:1355
319
#@ cpd
320
msgid "This post"
321
msgstr "Bu yazı"
@@ -337,188 +335,194 @@ msgstr "sonraki yeniləşdirmək"
337
msgid "Mass Bots cleaned. %s counts deleted."
338
msgstr "Bot cədvəli təmizlənib. %s yazılar silinb."
339
340
- #: counter-options.php:759
341
#@ cpd
342
msgid "until User Level"
343
msgstr "istifadəçi səviyyəsinə qədər"
344
345
- #: counter-options.php:778
346
#@ cpd
347
msgid "Anonymous IP"
348
msgstr "Anonim IP"
349
350
- #: counter-options.php:855
351
#@ cpd
352
msgid "Countries"
353
msgstr "Ölkələr"
354
355
- #: counter-options.php:856
356
#@ cpd
357
msgid "How many countries do you want to see on dashboard page?"
358
msgstr "Siyahıda neçə ölkə görmək istiyərdiniz?"
359
360
- #: counter-options.php:891
361
#@ cpd
362
msgid "Start Values"
363
msgstr "Başlanğıc məlumatlar"
364
365
- #: counter-options.php:895
366
#@ cpd
367
msgid "Here you can change the date of first count and add a start count."
368
msgstr "Burada hesablama tarixini və başlanğıc sayğacı əlavə edə bilərsiniz."
369
370
- #: counter-options.php:899
371
#@ cpd
372
msgid "Start date"
373
msgstr "Başlanğıc tarix"
374
375
- #: counter-options.php:900
376
#@ cpd
377
msgid "Your old Counter starts at?"
378
msgstr "Sizin köhnə Sayğacınız başlanır?"
379
380
- #: counter-options.php:903
381
- #: counter-options.php:907
382
#@ cpd
383
msgid "Start count"
384
msgstr "Sayın başlanğıcı"
385
386
- #: counter-options.php:904
387
#@ cpd
388
msgid "Add this value to \"Total visitors\"."
389
msgstr " \"Ümumi qonaqlar\"-ra dəyər əlavə etmək."
390
391
- #: counter-options.php:636
392
#@ cpd
393
msgid "GeoIP - Countries"
394
msgstr "GeoIP - Ölkələr"
395
396
- #: counter-options.php:645
397
#@ cpd
398
msgid "Update old counter data"
399
msgstr "Köhnə sayğacların məlumatlarını yeniləşdirmək"
400
401
- #: counter-options.php:657
402
#@ cpd
403
msgid "Update GeoIP database"
404
msgstr "GeoIP məlumat bazasını yeniləşdirmək"
405
406
- #: counter-options.php:652
407
#@ cpd
408
msgid "Download a new version of GeoIP.dat file."
409
msgstr "Yeni GeoIP.dat. versiya fayılını yükləmək."
410
411
- #: counter-options.php:662
412
#@ cpd
413
msgid "More informations about GeoIP"
414
msgstr " GeoIP haqqında daha da çox məlumat"
415
416
- #: counter-options.php:417
417
#: massbots.php:46
418
#@ cpd
419
msgid "Mass Bots"
420
msgstr "Mümkün olan botlar"
421
422
- #: counter-options.php:421
423
#, php-format
424
#@ cpd
425
msgid "Show all IPs with more than %s page views per day"
426
msgstr "Gün ərzində %s daha çox olan baxışların bütün IP-lərini göstərmək"
427
428
- #: counter-options.php:422
429
#: notes.php:84
430
#: userperspan.php:56
431
#@ cpd
432
msgid "show"
433
msgstr "göstərməkl"
434
435
- #: counter-options.php:430
436
#@ cpd
437
msgid "IP"
438
msgstr "IP"
439
440
- #: counter-options.php:431
441
#: notes.php:88
442
#@ cpd
443
#@ default
444
msgid "Date"
445
msgstr "Tarix"
446
447
- #: counter-options.php:432
448
#@ cpd
449
msgid "Client"
450
msgstr "Müştəri"
451
452
- #: counter-options.php:433
453
#@ cpd
454
msgid "Views"
455
msgstr "Baxış"
456
457
- #: counter-options.php:448
458
- #: counter-options.php:464
459
#, php-format
460
#@ cpd
461
msgid "Delete these %s counts"
462
msgstr "Bu %s sayğacları silmək"
463
464
- #: counter-options.php:727
465
#@ cpd
466
msgid "Support"
467
msgstr "Dəstək"
468
469
- #: counter-core.php:753
470
#, php-format
471
#@ cpd
472
msgid "Time for Count per Day: <code>%s</code>."
473
msgstr " Count per Day üçün vaxt: <code>%s</code>"
474
475
- #: counter-core.php:754
476
#@ cpd
477
msgid "Bug? Problem? Question? Hint? Praise?"
478
msgstr "Səhv? Problem? Sual? Məsləhət? Alqış?"
479
480
- #: counter-core.php:755
481
#, php-format
482
#@ cpd
483
msgid "Write a comment on the <a href=\"%s\">plugin page</a>."
484
msgstr " <a href=\"%s\">plaginin səhifəsinidə</a> kommentariy yazın."
485
486
- #: counter.php:218
487
- #: counter.php:1356
488
#@ cpd
489
msgid "Total reads"
490
msgstr "Ümumi oxunuş"
491
492
- #: counter.php:219
493
- #: counter.php:1357
494
#@ cpd
495
msgid "Reads today"
496
msgstr "Bu günkü oxunuş"
497
498
- #: counter.php:220
499
- #: counter.php:1358
500
#@ cpd
501
msgid "Reads yesterday"
502
msgstr "Dünənki oxunuş"
503
504
- #: counter.php:875
505
#: notes.php:55
506
#: notes.php:89
507
#@ cpd
508
msgid "Notes"
509
msgstr "Qeydlər"
510
511
- #: counter.php:873
512
#@ default
513
msgid "Show"
514
msgstr "Göstərmək"
515
516
- #: counter.php:913
517
#@ cpd
518
msgid "Other"
519
msgstr "Digər"
520
521
- #: counter.php:1085
522
#@ default
523
msgid "Edit Post"
524
msgstr "Yazışı redaktə etmək"
@@ -529,29 +533,29 @@ msgstr "Yazışı redaktə etmək"
529
msgid "Front page displays"
530
msgstr "Əsas səhifənin göstərişi"
531
532
- #: counter-core.php:799
533
- #: counter-options.php:860
534
#@ cpd
535
msgid "Browsers"
536
msgstr "Brauzerlər"
537
538
- #: counter-core.php:793
539
#@ cpd
540
msgid "Latest Counts"
541
msgstr "Yaxında keçirilmiş hesablamalar"
542
543
- #: counter-core.php:796
544
#@ default
545
msgid "Plugin"
546
msgstr "Plagin"
547
548
- #: counter-core.php:804
549
#@ cpd
550
msgid "Reads per Country"
551
msgstr "Ölkələr üzrə oxunuşlar"
552
553
- #: counter.php:418
554
- #: counter.php:1198
555
#@ cpd
556
msgid "Map"
557
msgstr "Xəritə"
@@ -596,32 +600,32 @@ msgstr "silmək"
596
msgid "edit"
597
msgstr "redaktə etmək"
598
599
- #: counter-options.php:782
600
#@ cpd
601
msgid "Cache"
602
msgstr "Keş"
603
604
- #: counter-options.php:783
605
#@ cpd
606
msgid "I use a cache plugin. Count these visits with ajax."
607
msgstr "Mən keş olan plagindən istifadə edirəm. Ajax vasitəsi ilə bu gəlişləri saymaq."
608
609
- #: counter-options.php:861
610
#@ cpd
611
msgid "Substring of the user agent, separated by comma"
612
msgstr "İstifadəçinin agentinin sətir altı vergül ilə bölünüb"
613
614
- #: counter-options.php:945
615
#@ cpd
616
msgid "Debug mode"
617
msgstr "Düzəliş rejimi"
618
619
- #: counter-options.php:947
620
#@ cpd
621
msgid "Show debug informations at the bottom of all pages."
622
msgstr "Hər səhifənin sonunda düzəliş məlıumatını əlavə etmək."
623
624
- #: counter-core.php:805
625
#@ cpd
626
msgid "Visitors per Country"
627
msgstr "Ölkə üzrə gəlişlər"
@@ -641,12 +645,12 @@ msgstr "Son"
641
msgid "PostID"
642
msgstr "ID məlumatlar"
643
644
- #: counter-options.php:908
645
#@ cpd
646
msgid "Add this value to \"Total reads\"."
647
msgstr "\"Ümumi oxunuşlar\" -ra dəyərini əlavə etmək."
648
649
- #: counter-options.php:639
650
#@ cpd
651
msgid "You can get the country data for all entries in database by checking the IP adress against the GeoIP database. This can take a while!"
652
msgstr "Siz IP adreslərini yoxluyaraq bütün yazılar üçün ölkələr üçün məlumatları ala yenidən bilərsiniz. Bir az vaxt tuta bilər!"
@@ -656,467 +660,560 @@ msgstr "Siz IP adreslərini yoxluyaraq bütün yazılar üçün ölkələr üç
656
msgid "no data found"
657
msgstr "heç bir məlumat tapılmayıb"
658
659
- #: counter-options.php:748
660
#@ cpd
661
msgid "Counter"
662
msgstr "Sayğac"
663
664
- #: counter-options.php:786
665
#@ cpd
666
msgid "Clients and referrers"
667
msgstr "Müştərilər və istinad olan saytlar"
668
669
- #: counter-options.php:789
670
#@ cpd
671
msgid "Save and show clients and referrers.<br />Needs a lot of space in the database but gives you more detailed informations of your visitors."
672
msgstr "Yaddaşda saxlamaq və müştəriləri və istenad olan saytlarını göstərmək. <br />Məlumat bazasında daha da çox həcm tələb edir, lakin gələn qonaqlar barəsində daha da ətraflı məlumat verir."
673
674
- #: counter-options.php:872
675
#@ cpd
676
msgid "Local URLs"
677
msgstr "Lokal URL"
678
679
- #: counter-options.php:873
680
#@ cpd
681
msgid "Show local referrers too."
682
msgstr "Lokal keçidləri də göstərmək."
683
684
- #: counter-options.php:880
685
#@ default
686
msgid "Posts"
687
msgstr "Yazılar"
688
689
- #: counter-options.php:880
690
#@ default
691
msgid "Pages"
692
msgstr "Səhifələr"
693
694
- #: counter.php:221
695
- #: counter.php:1359
696
#@ cpd
697
msgid "Reads last week"
698
msgstr "Ötən həftənin oxunuşları"
699
700
- #: counter.php:1094
701
#@ default
702
msgid "Category"
703
msgstr "Kateqoriyalar"
704
705
- #: counter.php:1097
706
#@ default
707
msgid "Tag"
708
msgstr "Teq"
709
710
- #: counter-core.php:756
711
#@ default
712
msgid "License"
713
msgstr "Lisenziya"
714
715
- #: counter-core.php:791
716
- #: counter.php:1360
717
#@ cpd
718
msgid "Reads per month"
719
msgstr "Ay ərzində oxunuşlar"
720
721
- #: counter-core.php:800
722
#@ cpd
723
msgid "Referrer"
724
msgstr "İstinad olunan sayt"
725
726
- #: counter-options.php:864
727
#@ cpd
728
msgid "Referrers - Entries"
729
msgstr "İstenad olan saytlar - Girişlər"
730
731
- #: counter-options.php:865
732
#@ cpd
733
msgid "How many referrers do you want to see on dashboard page?"
734
msgstr "Statistika səhifəsində neçə istenad olan saytları Siz görmək istiyərdiniz?"
735
736
- #: counter-options.php:868
737
#@ cpd
738
msgid "Referrers - Days"
739
msgstr "İstenad olan saytlar - Günlər"
740
741
- #: counter.php:944
742
#, php-format
743
#@ cpd
744
msgid "The %s referrers in last %s days:"
745
msgstr "%s istenad olan saytlar son %s günlər:"
746
747
- #: counter-core.php:789
748
#@ cpd
749
msgid "Visitors online"
750
msgstr "Qonaq onlayn"
751
752
- #: counter.php:1380
753
#@ default
754
msgid "Title"
755
msgstr "Başlıq"
756
757
- #: counter-core.php:259
758
#, php-format
759
#@ cpd
760
msgid "\"Count per Day\" updated to version %s."
761
msgstr ""
762
763
- #: counter-core.php:1000
764
#@ cpd
765
msgid "Backup failed! Cannot open file"
766
msgstr ""
767
768
- #: counter-core.php:1027
769
- #, php-format
770
- #@ cpd
771
- msgid "Backup of %s entries in progress. Every point complies %s entries."
772
- msgstr ""
773
-
774
- #: counter-core.php:1118
775
- #: counter-core.php:1126
776
#, php-format
777
#@ cpd
778
msgid "Backup of counter table saved in %s."
779
msgstr ""
780
781
- #: counter-core.php:1120
782
- #: counter-core.php:1128
783
#, php-format
784
#@ cpd
785
msgid "Backup of counter options and collection saved in %s."
786
msgstr ""
787
788
- #: counter-options.php:169
789
#@ cpd
790
msgid "Collection in progress..."
791
msgstr ""
792
793
- #: counter-options.php:263
794
#@ cpd
795
msgid "Get Visitors per Post..."
796
msgstr ""
797
798
- #: counter-options.php:284
799
- #@ cpd
800
- msgid "Delete old data..."
801
- msgstr ""
802
-
803
- #: counter-options.php:308
804
#, php-format
805
#@ cpd
806
msgid "Counter entries until %s collected and counter table %s optimized (size before = %s &gt; size after = %s)."
807
msgstr ""
808
809
- #: counter-options.php:317
810
#@ cpd
811
msgid "Installation of \"Count per Day\" checked"
812
msgstr ""
813
814
- #: counter-options.php:400
815
- #: counter-options.php:739
816
#@ default
817
msgid "Tools"
818
msgstr ""
819
820
- #: counter-options.php:791
821
#@ cpd
822
msgid "Save URL only, no query string."
823
msgstr ""
824
825
- #: counter-options.php:815
826
#@ cpd
827
msgid "Who can see it"
828
msgstr ""
829
830
- #: counter-options.php:824
831
#@ cpd
832
msgid "custom"
833
msgstr ""
834
835
- #: counter-options.php:826
836
#@ cpd
837
msgid "and higher are allowed to see the statistics page."
838
msgstr ""
839
840
- #: counter-options.php:828
841
#, php-format
842
#@ cpd
843
msgid "Set the %s capability %s a user need:"
844
msgstr ""
845
846
- #: counter-options.php:915
847
#@ cpd
848
msgid "Stylesheet"
849
msgstr ""
850
851
- #: counter-options.php:918
852
#@ cpd
853
msgid "NO Stylesheet in Frontend"
854
msgstr ""
855
856
- #: counter-options.php:919
857
#@ cpd
858
msgid "Do not load the stylesheet \"counter.css\" in frontend."
859
msgstr ""
860
861
- #: counter-options.php:476
862
- #: counter-options.php:926
863
#@ cpd
864
msgid "Backup"
865
msgstr ""
866
867
- #: counter-options.php:929
868
#@ cpd
869
msgid "Entries per pass"
870
msgstr ""
871
872
- #: counter-options.php:932
873
#@ cpd
874
msgid "How many entries should be saved per pass? Default: 10000"
875
msgstr ""
876
877
- #: counter-options.php:937
878
#@ cpd
879
msgid "If your PHP memory limit less then 50 MB and you get a white page or error messages try a smaller value."
880
msgstr ""
881
882
- #: counter-options.php:480
883
#, php-format
884
#@ cpd
885
msgid "Create a backup of the counter table %s in your wp-content directory (if writable)."
886
msgstr ""
887
888
- #: counter-options.php:487
889
#@ cpd
890
msgid "Backup the database"
891
msgstr ""
892
893
- #: counter-options.php:591
894
- #: counter-options.php:623
895
#@ cpd
896
msgid "Collect old data"
897
msgstr ""
898
899
- #: counter-options.php:577
900
- #: counter-options.php:596
901
#, php-format
902
#@ cpd
903
msgid "Current size of your counter table %s is %s."
904
msgstr ""
905
906
- #: counter-options.php:598
907
#@ cpd
908
msgid "You can collect old data and clean up the counter table.<br/>Reads and visitors will be saved per month, per country and per post.<br/>Clients and referrers will deleted."
909
msgstr ""
910
911
- #: counter-options.php:603
912
#, php-format
913
#@ cpd
914
msgid "Currently your collection contains data until %s."
915
msgstr ""
916
917
- #: counter-options.php:607
918
#@ cpd
919
msgid "Normally new data will be added to the collection."
920
msgstr ""
921
922
- #: counter-options.php:613
923
#@ cpd
924
msgid "Delete old collection and create a new one which contains only the data currently in counter table."
925
msgstr ""
926
927
- #: counter-options.php:614
928
#, php-format
929
#@ cpd
930
msgid "All collected data until %s will deleted."
931
msgstr ""
932
933
- #: counter-options.php:619
934
#, php-format
935
#@ cpd
936
msgid "Keep entries of last %s full months + current month in counter table."
937
msgstr ""
938
939
- #: counter-options.php:670
940
#@ cpd
941
msgid "ReActivation"
942
msgstr ""
943
944
- #: counter-options.php:673
945
#@ cpd
946
msgid "Here you can start the installation functions manually.<br/>Same as deactivate and reactivate the plugin."
947
msgstr ""
948
949
- #: counter-options.php:678
950
#@ cpd
951
msgid "ReActivate the plugin"
952
msgstr ""
953
954
- #: counter.php:228
955
- #: counter.php:998
956
#@ cpd
957
msgid "Visitors"
958
msgstr ""
959
960
- #: counter.php:231
961
- #: counter.php:232
962
#@ cpd
963
msgid "Most visited day"
964
msgstr ""
965
966
- #: counter.php:1399
967
#@ cpd
968
msgid "drag and drop to sort"
969
msgstr ""
970
971
- #: counter-core.php:795
972
- #: counter-options.php:864
973
- #: counter-options.php:868
974
#@ cpd
975
msgid "Search strings"
976
msgstr ""
977
978
- #: counter-core.php:1114
979
#@ cpd
980
msgid "Your can download the backup files here and now."
981
msgstr ""
982
983
- #: counter-core.php:1184
984
#@ cpd
985
msgid "Error while reading backup file!"
986
msgstr ""
987
988
- #: counter-core.php:1188
989
#, php-format
990
#@ cpd
991
msgid "The backup was added to counter table %s."
992
msgstr ""
993
994
- #: counter-core.php:1190
995
#, php-format
996
#@ cpd
997
msgid "The counter table %s was restored from backup."
998
msgstr ""
999
1000
- #: counter-core.php:1207
1001
#@ cpd
1002
msgid "Options restored from backup."
1003
msgstr ""
1004
1005
- #: counter-options.php:332
1006
#@ cpd
1007
msgid "Old search strings deleted"
1008
msgstr ""
1009
1010
- #: counter-options.php:347
1011
#@ cpd
1012
msgid "Clients and referers deleted"
1013
msgstr ""
1014
1015
- #: counter-options.php:483
1016
#@ cpd
1017
msgid "Download only"
1018
msgstr ""
1019
1020
- #: counter-options.php:515
1021
#@ cpd
1022
msgid "Settings and collections"
1023
msgstr ""
1024
1025
- #: counter-options.php:520
1026
#, php-format
1027
#@ cpd
1028
msgid "Counter table %s"
1029
msgstr ""
1030
1031
- #: counter-options.php:527
1032
#, php-format
1033
#@ cpd
1034
msgid "Add data from the backup file %s to existing counter table?"
1035
msgstr ""
1036
1037
- #: counter-options.php:527
1038
#@ cpd
1039
msgid "Add"
1040
msgstr ""
1041
1042
- #: counter-options.php:531
1043
#, php-format
1044
#@ cpd
1045
msgid "Restore data from the backup file %s ?"
1046
msgstr ""
1047
1048
- #: counter-options.php:531
1049
#@ default
1050
msgid "Restore"
1051
msgstr ""
1052
1053
- #: counter-options.php:533
1054
#@ default
1055
msgid "Delete"
1056
msgstr ""
1057
1058
- #: counter-options.php:534
1059
#, php-format
1060
#@ cpd
1061
msgid "Delete the backup file %s ?"
1062
msgstr ""
1063
1064
- #: counter-options.php:540
1065
#@ cpd
1066
msgid "add backup to current counter table"
1067
msgstr ""
1068
1069
- #: counter-options.php:541
1070
#@ cpd
1071
msgid "replace current counter table with with backup"
1072
msgstr ""
1073
1074
- #: counter-options.php:542
1075
#@ cpd
1076
msgid "delete backup file"
1077
msgstr ""
1078
1079
- #: counter-options.php:567
1080
#, php-format
1081
#@ cpd
1082
msgid "Delete search strings older than %s days."
1083
msgstr ""
1084
1085
- #: counter-options.php:571
1086
#@ cpd
1087
msgid "Delete search strings"
1088
msgstr ""
1089
1090
- #: counter-options.php:578
1091
#, php-format
1092
#@ cpd
1093
msgid "Delete clients and referers older than %s days to reduce the size of the counter table."
1094
msgstr ""
1095
1096
- #: counter-options.php:582
1097
#@ cpd
1098
msgid "Delete clients and referers"
1099
msgstr ""
1100
1101
- #: counter.php:1100
1102
#@ default
1103
msgid "Front page"
1104
msgstr ""
1105
1106
- #: counter.php:1142
1107
#, php-format
1108
#@ cpd
1109
msgid "The %s most searched strings:"
1110
msgstr ""
1111
1112
- #: counter.php:1151
1113
#, php-format
1114
#@ cpd
1115
msgid "The search strings of the last %s days:"
1116
msgstr ""
1117
1118
- #: counter.php:1315
1119
#@ default
1120
msgid "_name"
1121
msgstr ""
1122
1
msgid ""
2
msgstr ""
3
+ "Project-Id-Version: Count Per Day v3.3\n"
4
"Report-Msgid-Bugs-To: \n"
5
"POT-Creation-Date: 2008-11-02 12:13+0100\n"
6
+ "PO-Revision-Date: 2014-09-11 07:26:04+0000\n"
7
"Last-Translator: Madat <translator.baku@gmail.com>\n"
8
"Language-Team: Webmestre <translator.baku@gmail.com>\n"
9
"MIME-Version: 1.0\n"
25
msgid "Options updated"
26
msgstr "Opsiyalar yaddaşda saxlanılıb"
27
28
+ #: counter-options.php:118
29
#, php-format
30
#@ cpd
31
msgid "Database cleaned. %s rows deleted."
32
msgstr "Məlumat bazası silinib. %s sətir silinib."
33
34
+ #: counter-options.php:133
35
+ #: counter-options.php:803
36
#@ cpd
37
msgid "UNINSTALL Count per Day"
38
msgstr "DEİNSTALYASİYA Gündəlik Sayğac. "
39
40
+ #: counter-options.php:138
41
+ #: counter-options.php:139
42
+ #: counter-options.php:140
43
#, php-format
44
#@ cpd
45
msgid "Table %s deleted"
46
msgstr "Cədvəl %s silinib"
47
48
+ #: counter-options.php:141
49
#@ cpd
50
msgid "Options deleted"
51
msgstr "Opsiyalar silinib"
52
53
+ #: counter-options.php:382
54
+ #: counter-options.php:789
55
#@ cpd
56
msgid "Uninstall"
57
msgstr "Deinstalyasiya"
58
59
+ #: counter-options.php:383
60
#@ cpd
61
msgid "Click here"
62
msgstr "Bura basın"
63
64
+ #: counter-options.php:383
65
#@ cpd
66
msgid "to finish the uninstall and to deactivate \"Count per Day\"."
67
msgstr "deinstalyasiyanı bitirilməsi və \"Gündəlik Sayğac\" deaktivizasiya üçün. "
68
69
+ #: counter-options.php:832
70
#@ cpd
71
msgid "Online time"
72
msgstr "Onlayn vaxt"
73
74
+ #: counter-options.php:833
75
#@ cpd
76
msgid "Seconds for online counter. Used for \"Visitors online\" on dashboard page."
77
msgstr "Onlayn sayğac üçün saniyələr. \"İnstrumentlər panelində\" \"Onlayn qonaqlar \" üçün istifadə olunur."
78
79
+ #: counter-options.php:836
80
#@ cpd
81
msgid "Logged on Users"
82
msgstr "Daxil olmuş istifadəçilər"
83
84
+ #: counter-options.php:838
85
#@ cpd
86
msgid "count too"
87
msgstr "onu da saymaq"
88
89
+ #: counter-options.php:850
90
#@ cpd
91
msgid "Auto counter"
92
msgstr "Avtomatik sayğac"
93
94
+ #: counter-options.php:851
95
#@ cpd
96
msgid "Counts automatically single-posts and pages, no changes on template needed."
97
msgstr "Ayrica yazıları və səhifələri avtomatik olaraq sayır, heç bir dəyişiklik etmək şablonda lazım olmayacaq."
98
99
+ #: counter-options.php:854
100
#@ cpd
101
msgid "Bots to ignore"
102
msgstr "Botları əhəmiyyət verməmək"
103
104
+ #: counter-options.php:1042
105
#@ cpd
106
msgid "Update options"
107
msgstr "Opsiyaları yeniləşdirmək"
108
109
+ #: counter-options.php:637
110
+ #: counter-options.php:645
111
#@ cpd
112
msgid "Clean the database"
113
msgstr "Məlumat bazasının silmək"
114
115
+ #: counter-options.php:641
116
#@ cpd
117
msgid "You can clean the counter table by delete the \"spam data\".<br />If you add new bots above the old \"spam data\" keeps in the database.<br />Here you can run the bot filter again and delete the visits of the bots."
118
msgstr "\"Spam məlumatı \" silərək Siz sayğacını təmizləyə bilərsiniz. <br /> Əgər Siz köhnə \"spam məlumatının \" üstəndən yeni botlarını əlavə etsəniz, Siz məlumat bazasını qorura bilərsiniz. <br /> Burada Siz yenidən bot-filtrı yenidən qoşa bilərsiniz və botun baş çəkməsini silə bilərsiniz."
119
120
+ #: counter-options.php:792
121
#@ cpd
122
msgid "If \"Count per Day\" only disabled the tables in the database will be preserved."
123
msgstr "Əgər \"Gündəlik sayğac \" aktivizasiya olunubsa, onda cədvəllər məlumat bazasında qorunacaqdır."
124
125
+ #: counter-options.php:793
126
#@ cpd
127
msgid "Here you can delete the tables and disable \"Count per Day\"."
128
msgstr "Siz burada \"Gündəlik sayğacı\" silə və söndürə bilərsiniz."
129
130
+ #: counter-options.php:796
131
#@ cpd
132
msgid "WARNING"
133
msgstr "DİQQƏT"
134
135
+ #: counter-options.php:797
136
#@ cpd
137
msgid "These tables (with ALL counter data) will be deleted."
138
msgstr "Bu cədvəllər (Bütün sayğacın məlumatları ilə birlikdə) silinəcəkdirlər."
139
140
+ #: counter-options.php:799
141
#@ cpd
142
msgid "If \"Count per Day\" re-installed, the counter starts at 0."
143
msgstr " \"Gündəlin sayğac\" yenidən instalyasiya edildikdən sonra, sayğac 0-dan başlayır."
144
145
+ #: counter-options.php:779
146
+ #: counter-options.php:802
147
#@ cpd
148
msgid "Yes"
149
msgstr "Bəli"
150
151
+ #: counter-options.php:803
152
#@ cpd
153
msgid "You are sure to disable Count per Day and delete all data?"
154
msgstr "Siz əminsiniz ki, \"Gündəlik sayğacı\" söndürmək və bütün məlumatları silmək istəyirsiniz?"
155
156
+ #: counter-core.php:809
157
+ #: counter.php:1334
158
#@ cpd
159
msgid "Statistics"
160
msgstr "Statistika"
161
162
+ #: counter-core.php:777
163
+ #: counter.php:236
164
+ #: counter.php:1218
165
+ #: counter.php:1412
166
#@ cpd
167
msgid "Total visitors"
168
msgstr "Ümümi qonaqların sayı"
169
170
+ #: counter.php:237
171
+ #: counter.php:1418
172
#@ cpd
173
msgid "Visitors currently online"
174
msgstr "İndi qonaqların sayı saytda "
175
176
+ #: counter.php:238
177
+ #: counter.php:1413
178
#@ cpd
179
msgid "Visitors today"
180
msgstr "Qonaqlar sayı bu gün"
181
182
+ #: counter.php:239
183
+ #: counter.php:1414
184
#@ cpd
185
msgid "Visitors yesterday"
186
msgstr "Qonaqların sayı dünən"
187
188
+ #: counter.php:240
189
+ #: counter.php:1415
190
#@ cpd
191
msgid "Visitors last week"
192
msgstr "Qonaqların sayı keçən həftə"
193
194
+ #: counter.php:969
195
+ #: counter.php:1419
196
#@ cpd
197
msgid "Counter starts on"
198
msgstr "Sayğac başlanır -dan"
199
200
+ #: counter-core.php:783
201
+ #: counter.php:242
202
+ #: counter.php:343
203
+ #: counter.php:1220
204 <