mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 22:27:34 +02:00
Log Plugin improvements/fixes - now uses jQuery
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
|
||||
if (isset($pref['statActivate']) && $pref['statActivate'])
|
||||
if (vartrue($pref['statActivate']))
|
||||
{
|
||||
if(!$pref['statCountAdmin'] && ADMIN)
|
||||
{
|
||||
@@ -31,10 +31,12 @@ if (isset($pref['statActivate']) && $pref['statActivate'])
|
||||
if (is_numeric(e_QUERY)) $err_flag .= '/'.substr(e_QUERY,0,10); // This should pick up the error code - and limit numeric length to upset the malicious
|
||||
$err_flag .= "&err_referer=".$_SERVER['HTTP_REFERER'];
|
||||
}
|
||||
|
||||
/*
|
||||
$logJS = "
|
||||
function rstr2b64(input)
|
||||
{
|
||||
var b64pad = \"=\"; /* base-64 pad character. \"=\" for strict RFC compliance */
|
||||
var b64pad = \"=\"; // base-64 pad character. \"=\" for strict RFC compliance
|
||||
var tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";
|
||||
var output = \"\";
|
||||
var len = input.length;
|
||||
@@ -59,6 +61,7 @@ logString = rstr2b64(logString);
|
||||
document.write('<link rel=\"stylesheet\" type=\"text/css\" href=\"".e_PLUGIN_ABS."log/log.php?lv='+logString + '\">' );
|
||||
";
|
||||
|
||||
*/
|
||||
|
||||
$logJS = "
|
||||
|
||||
@@ -102,7 +105,7 @@ $(function() {
|
||||
url: url,
|
||||
data: {'lv' :logString},
|
||||
success: function() {
|
||||
alert(logString);
|
||||
// alert(logString);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
1391
e107_plugins/log/js/awesomechart.js
Normal file
1391
e107_plugins/log/js/awesomechart.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -26,6 +26,14 @@
|
||||
// Normally the file is 'silent' - if any errors occur, not sure where they'll appear - (file type now text/html instead of text/css)
|
||||
*/
|
||||
//error_reporting(0);
|
||||
$_E107['minimum'] = true;
|
||||
require_once("../../class2.php");
|
||||
if (!e107::isInstalled('log'))
|
||||
{
|
||||
header('Location: '.e_BASE.'index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
define('log_INIT', TRUE);
|
||||
|
||||
// Array of page names which should have individual query values recorded.
|
||||
@@ -36,6 +44,10 @@ $pageUnique = array('page' => 1, 'content' => array('content'));
|
||||
|
||||
//$logVals = urldecode(base64_decode($_SERVER['QUERY_STRING']));
|
||||
$logVals = urldecode(base64_decode($_GET['lv']));
|
||||
|
||||
|
||||
file_put_contents(e_LOG."test.log",print_r($logVals,true)); // , FILE_APPEND | LOCK_EX
|
||||
|
||||
parse_str($logVals, $vals);
|
||||
|
||||
// We MUST have a timezone set in PHP >= 5.3. This should work for PHP >= 5.1:
|
||||
@@ -61,7 +73,7 @@ $ref = addslashes(strip_tags((isset($vals['referer']) ? $vals['referer'] : '')))
|
||||
$logQry = isset($vals['qry']) && $vals['qry'];
|
||||
|
||||
$date = date('z.Y', time());
|
||||
$logPfile = 'logs/logp_'.$date.'.php';
|
||||
$logPfile = e_LOG.'logp_'.$date.'.php';
|
||||
|
||||
//$logString = "Colour: {$colour} Res: {$res} Self: {$self} Referrer: {$ref} ErrCode: {$vals['err_direct']}\n";
|
||||
//$logfp = fopen('logs/rcvstring.txt', 'a+'); fwrite($logfp, $logString); fclose($logfp);
|
||||
@@ -204,8 +216,10 @@ if ($p_handle)
|
||||
|
||||
|
||||
// Get current IP address - return as a hex-encoded string
|
||||
function getip()
|
||||
if(!function_exists('getip'))
|
||||
{
|
||||
function getip()
|
||||
{
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
if (getenv('HTTP_X_FORWARDED_FOR'))
|
||||
{
|
||||
@@ -260,7 +274,7 @@ function getip()
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
@@ -11,7 +11,7 @@
|
||||
|
||||
if (!defined('log_INIT')) { exit; }
|
||||
|
||||
$logIfile = "logs/logi_{$date}.php";
|
||||
$logIfile = e_LOG."logi_{$date}.php";
|
||||
$i_handle = fopen($logIfile, 'r+');
|
||||
if($i_handle && flock( $i_handle, LOCK_EX ) )
|
||||
{
|
||||
|
@@ -1181,6 +1181,8 @@ class siteStats
|
||||
if (!is_array($selection)) $selection = array(1);
|
||||
$text = '';
|
||||
|
||||
|
||||
|
||||
foreach ($selection as $act)
|
||||
{
|
||||
unset($statBrowser);
|
||||
@@ -1901,6 +1903,8 @@ class siteStats
|
||||
$utotal += $fvalue['unq'];
|
||||
}
|
||||
|
||||
print_a($dayarray);;
|
||||
|
||||
$text = "<table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 30%;'>".ADSTAT_L33." ".($amount+1)." ".ADSTAT_L40."</td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L34."</td>\n</tr>\n";
|
||||
|
||||
foreach($dayarray as $date => $total)
|
||||
|
Reference in New Issue
Block a user