1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

Log Plugin improvements/fixes - now uses jQuery

This commit is contained in:
Cameron
2012-12-04 17:00:40 -08:00
parent b03275934b
commit eaac6875e9
5 changed files with 1467 additions and 55 deletions

View File

@@ -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);
}
});
});

File diff suppressed because it is too large Load Diff

View File

@@ -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,6 +216,8 @@ if ($p_handle)
// Get current IP address - return as a hex-encoded string
if(!function_exists('getip'))
{
function getip()
{
$ip = $_SERVER['REMOTE_ADDR'];
@@ -261,6 +275,6 @@ function getip()
return $ret;
}
}
}
?>

View File

@@ -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 ) )
{

View File

@@ -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)