Skip to content

Commit

Permalink
Merge remote-tracking branch 'eisfuchs/master'
Browse files Browse the repository at this point in the history
* eisfuchs/master:
  change table.php for language support (no more plain text) and add new words to the english language data
  • Loading branch information
splitbrain committed Nov 28, 2012
2 parents 5a62dcb + 9b7ad63 commit b8b0743
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 33 deletions.
66 changes: 33 additions & 33 deletions helper/table.php
Expand Up @@ -68,7 +68,7 @@ private function referer($date=''){
if(!$date) $date = date('Y-m');
$this->listtable($this->log->logdata[$date]['referer_url'],
$this->log->logdata[$date]['referer']['count'],
'Top Referrers in '.$date);
sprintf($this->getLang('t_topReferrer'), $date));
}

/**
Expand All @@ -80,7 +80,7 @@ private function entry($date=''){
if(!$date) $date = date('Y-m');
$this->listtable($this->log->logdata[$date]['entry'],
$this->log->logdata[$date]['page']['all']['count'],
'Top Entry Pages in '.$date);
sprintf($this->getLang('t_topEntry'), $date));
}

/**
Expand All @@ -92,7 +92,7 @@ private function ua($date=''){
if(!$date) $date = date('Y-m');
$this->listtable($this->log->logdata[$date]['useragent'],
$this->log->logdata[$date]['page']['all']['count'],
'Top User Agents in '.$date);
sprintf($this->getLang('t_topUserAgents') , $date));
}

/**
Expand All @@ -104,7 +104,7 @@ private function url($date=''){
if(!$date) $date = date('Y-m');
$this->listtable($this->log->logdata[$date]['page_url'],
$this->log->logdata[$date]['page']['all']['count'],
'Top Pages in '.$date);
sprintf($this->getLang('t_topPages'), $date));
}

/**
Expand Down Expand Up @@ -172,72 +172,72 @@ private function month($date = '') {
$this->R->table_open();

$this->R->tablerow_open();
$this->head('Monthly Statistics for '.$date, 3);
$this->head(sprintf($this->getLang('t_statisticMonth'), $date), 3);
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->hcell('Total hits');
$this->hcell($this->getLang('totalHits'));
$this->cell($data['page']['all']['count'] + $data['media']['all']['count'], 2);
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->hcell('Total files');
$this->hcell($this->getLang('totalFiles'));
$this->cell($data['media']['all']['count'], 2);
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->hcell('Total pages');
$this->hcell($this->getLang('totalPages'));
$this->cell($data['page']['all']['count'], 2);
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->hcell('Total visitors');
$this->hcell($this->getLang('totalVisitors'));
$this->cell($data['page']['all']['visitor'], 2);
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->hcell('Total bytes');
$this->hcell($this->getLang('totalBytes'));
$this->cell(filesize_h($data['page']['all']['bytes']), 2);
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->head('');
$this->head('avg');
$this->head('max');
$this->head($this->getLang('avg'));
$this->head($this->getLang('max'));
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->hcell('Hits per hour');
$this->hcell($this->getLang('hitsHour'));
$this->cell($this->log->avg($data['hits']['hour'], 'count'));
$this->cell($this->log->max($data['hits']['hour'], 'count'));
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->hcell('Hits per day');
$this->hcell($this->getLang('hitsDay'));
$this->cell($this->log->avg($data['hits']['day'], 'count'));
$this->cell($this->log->max($data['hits']['day'], 'count'));
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->hcell('Files per day');
$this->hcell($this->getLang('filesDay'));
$this->cell($this->log->avg($data['media']['day'], 'count'));
$this->cell($this->log->max($data['media']['day'], 'count'));
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->hcell('Pages per day');
$this->hcell($this->getLang('pagesDay'));
$this->cell($this->log->avg($data['page']['day'], 'count'));
$this->cell($this->log->max($data['page']['day'], 'count'));
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->hcell('Bytes per day');
$this->hcell($this->getLang('bytesDay'));
$this->cell(filesize_h($this->log->avg($data['hits']['day'], 'bytes')));
$this->cell(filesize_h($this->log->max($data['hits']['day'], 'bytes')));
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->head('Hits by Status Code',3);
$this->head($this->getLang('hitsStatusCode'),3);
$this->R->tablerow_close();

foreach((array) $this->log->logdata[$date]['status']['all'] as $code => $count ){
Expand All @@ -257,25 +257,25 @@ private function summary($from='', $to='') {
$this->R->table_open();

$this->R->tablerow_open();
$this->head('Summary by Month', 10);
$this->head($this->getLang('summaryMonth'), 10);
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->head('Month', 1, 2);
$this->head('Daily Average', 4);
$this->head('Monthly Totals', 5);
$this->head($this->getLang('month'), 1, 2);
$this->head($this->getLang('dailyavg'), 4);
$this->head($this->getLang('totals'), 5);
$this->R->tablerow_close();

$this->R->tablerow_open();
$this->head('Hits');
$this->head('Files');
$this->head('Pages');
$this->head('Visitors');
$this->head('Bytes');
$this->head('Visitors');
$this->head('Pages');
$this->head('Files');
$this->head('Hits');
$this->head($this->getLang('hits'));
$this->head($this->getLang('files'));
$this->head($this->getLang('pages'));
$this->head($this->getLang('visitors'));
$this->head($this->getLang('bytes'));
$this->head($this->getLang('visitors'));
$this->head($this->getLang('pages'));
$this->head($this->getLang('files'));
$this->head($this->getLang('hits'));
$this->R->tablerow_close();

foreach($this->log->logdata as $month => $data) {
Expand Down Expand Up @@ -325,8 +325,8 @@ private function listtable(&$data, $max, $title){

$this->R->tablerow_open();
$this->head('#');
$this->head('Name');
$this->head('Hits', 2);
$this->head($this->getLang('name'));
$this->head($this->getLang('hits'), 2);
$this->R->tablerow_close();


Expand Down
24 changes: 24 additions & 0 deletions lang/en/lang.php
@@ -1,4 +1,9 @@
<?php
$lang['t_statisticMonth'] = 'Monthly Statistics for %s';
$lang['t_topPages'] = 'Top Pages in %s';
$lang['t_topUserAgents'] = 'Top User Agents in %s';
$lang['t_topEntry'] = 'Top Entry Pages in %s';
$lang['t_topReferrer'] = 'Top Referrers in %s';

$lang['t_summary'] = 'Access Summary by Month';
$lang['t_month'] = 'Monthly Access Statistics for %s';
Expand All @@ -17,7 +22,26 @@
$lang['media'] = 'Media';
$lang['pages'] = 'Pages';
$lang['visitors'] = 'Visitors';
$lang['bytes'] = 'Bytes';
$lang['traffic'] = 'Traffic';
$lang['avg'] = 'avg';
$lang['max'] = 'max';
$lang['files'] = 'Files';
$lang['name'] = 'Name';

$lang['totalHits'] = 'Total hits';
$lang['totalFiles'] = 'Total files';
$lang['totalPages'] = 'Total pages';
$lang['totalVisitors'] = 'Total visitors';
$lang['totalBytes'] = 'Total bytes';

$lang['hitsHour'] = 'Hits per hour';
$lang['hitsDay'] = 'Hits per day';
$lang['filesDay'] = 'Files per day';
$lang['pagesDay'] = 'Pages per day';
$lang['bytesDay'] = 'Bytes per day';
$lang['hitsStatusCode'] = 'Hits by Status Code';
$lang['summaryMonth'] = 'Summary by Month';

$lang['status_100'] = 'Continue';
$lang['status_101'] = 'Switching Protocols';
Expand Down

0 comments on commit b8b0743

Please sign in to comment.