diff --git a/e107_plugins/log/e_url.php b/e107_plugins/log/e_url.php index 9fe0c8b2e..9571f0e63 100644 --- a/e107_plugins/log/e_url.php +++ b/e107_plugins/log/e_url.php @@ -32,6 +32,13 @@ class log_url // plugin-folder + '_url' ); + $config['others'] = array( + 'regex' => '^stats/\?([\d]*)$', // matched against url, and if true, redirected to 'redirect' below. + 'sef' => 'stats', // used by e107::url(); to create a url from the db table. + 'redirect' => '{e_PLUGIN}log/stats.php?$1', // file-path of what to load when the regex returns true. + + ); + return $config; } diff --git a/e107_plugins/log/stats.php b/e107_plugins/log/stats.php index de2bcc4e7..9d825b10b 100644 --- a/e107_plugins/log/stats.php +++ b/e107_plugins/log/stats.php @@ -742,7 +742,8 @@ class siteStats function renderNav($action) { - $path = e_PLUGIN_ABS.'log/stats.php'; + // $path = e_PLUGIN_ABS.'log/stats.php'; + $path = e_REQUEST_SELF; $links = array( 1 => array('label' => ADSTAT_L8, 'pref' => null), @@ -872,10 +873,11 @@ class siteStats function renderAlltimeVisits($action, $do_errors = FALSE) { $sql = e107::getDB(); + $tp = e107::getParser(); $text = ''; $sql->select("logstats", "*", "log_id='pageTotal' "); - $row = $sql -> db_Fetch(); + $row = $sql->fetch(); $pageTotal = unserialize($row['log_data']); $total = 0; @@ -925,7 +927,7 @@ class siteStats $text .= " ".($can_delete ? "".ADSTAT_L39." " : "")." - ".$key." + ".$tp->text_truncate($key,50)." "; $text .= " ".$this->bar($percentage, $info['ttlv'])." @@ -933,7 +935,7 @@ class siteStats \n"; } } - $text .= "".ADSTAT_L21."{$total}\n"; + $text .= "".ADSTAT_L21."".number_format($total)."\n"; $uniqueArray = array(); @@ -950,7 +952,13 @@ class siteStats $uniqueArray = $this -> arraySort($uniqueArray, "unqv"); $text .= "
- \n\n\n\n\n\n"; +
Page".ADSTAT_L24."%
+ + + + + \n"; + foreach($uniqueArray as $key => $info) { if ($info['ttlv']) @@ -958,13 +966,13 @@ class siteStats if (!$info['url'] && (($key == 'index') || (strpos($key,':index') !== FALSE))) $info['url'] = e_HTTP.'index.php'; // Avoids empty link $percentage = round(($info['unqv']/$totalv) * 100, 2); $text .= " - + \n"; } } - $text .= "\n
".ADSTAT_L19."".ADSTAT_L24."%
".$key." ".$tp->text_truncate($key, 50)." ".$this -> bar($percentage, $info['unqv'])." ".$percentage."%
".ADSTAT_L21."$totalv
"; + $text .= "".ADSTAT_L21."".number_format($totalv)."\n"; return $text; } @@ -1979,7 +1987,7 @@ class siteStats $text .= " - ".$val; + ".number_format($val); return $text; }