1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-30 09:39:55 +02:00

Small bug fix, remove files no longer required

This commit is contained in:
e107steved
2007-11-07 22:20:27 +00:00
parent 075dcbba76
commit 6576723824
3 changed files with 4 additions and 373 deletions

View File

@@ -1,330 +0,0 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/log/log_update.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:35:27 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
set_time_limit(300);
$us = new updateStats;
for ($i = 1; $i <= 7; $i++) {
if (!$sql -> db_Select("generic", "*", "gen_type='stat_update' && gen_intdata=".$i)) {
if (!$sql -> db_Select("stat_info", "*", "info_type='99' && info_count='".$i."'")) {
$func = "stage".$i;
$us -> $func();
$sql -> db_Insert("stat_info", "'Stats Update Stage ".$i." Complete', '".$i."', '99'");
}
} else {
$sql -> db_Insert("stat_info", "'Stats Update Stage ".$i." Complete', '".$i."', '99'");
$sql -> db_Delete("generic", "gen_type='stat_update' && gen_intdata=".$i);
}
}
if (!$sql -> db_Select("logstats", "*", "log_id='statQuery'")) {
$sql -> db_Insert("logstats", "0, 'statQuery', ''");
}
class updateStats {
function stage1() {
global $sql;
// Converting stat_counter entries
$stattotal = $sql -> db_Select("logstats", "*", "log_id='statTotal' ");
$statunique = $sql -> db_Select("logstats", "*", "log_id='statUnique' ");
if($sql -> db_Select("logstats", "*", "log_id='pageTotal' "))
{
$row = $sql -> db_Fetch();
$pageTotal = unserialize($row['log_data']);
}
else
{
$pageTotal = array();
}
if(!$sql -> db_Select("stat_counter", "*", "ORDER BY counter_date, counter_url DESC", "nowhere"))
{
return;
}
$monthArray = array();
$totalArray = array();
while($stat = $sql -> db_Fetch())
{
extract($stat);
/* collate pageTotal */
$pagename = str_replace(".php", "", $counter_url);
$totalArray[$pagename]['ttlv'] += $counter_total;
$totalArray[$pagename]['unqv'] += $counter_unique;
$stattotal += $counter_total;
$statunique += $counter_unique;
/* done */
/* collate monthly totals */
list($year, $month, $day) = explode("-", $counter_date);
$monthstore = $year."-".$month;
if(strstr($pagename, "forum"))
{
$pagename = "forum";
}
$monthArray[$monthstore]['TOTAL']['ttlv'] += $counter_total;
$monthArray[$monthstore]['TOTAL']['unqv'] += $counter_unique;
$monthArray[$monthstore][$counter_url]['ttlv'] += $counter_total;
$monthArray[$monthstore][$counter_url]['unqv'] += $counter_unique;
$dailyArray[$counter_date][$pagename] = array('url' => $counter_url, 'ttl' => $counter_total, 'unq' => $counter_unique);
$dailyTotal[$counter_date]['ttl'] += $counter_total;
$dailyTotal[$counter_date]['unq'] += $counter_unique;
}
if(!$sql -> db_Update("logstats", "log_data='$stattotal' WHERE log_id='statTotal' "))
{
$sql -> db_Insert("logstats", "0, 'statTotal', '$stattotal' ");
}
if(!$sql -> db_Update("logstats", "log_data='$statunique' WHERE log_id='statUnique' "))
{
$sql -> db_Insert("logstats", "0, 'statUnique', '$statunique' ");
}
$totalarray = serialize($totalArray);
if(!$sql -> db_Update("logstats", "log_data='$totalarray' WHERE log_id='pageTotal' "))
{
$sql -> db_Insert("logstats", "0, 'pageTotal', '$totalarray' ");
}
foreach($monthArray as $key => $value)
{
$sql -> db_Insert("logstats", "0, '$key', '".serialize($value)."'");
}
foreach($dailyArray as $key => $value)
{
$data = "";
foreach($value as $value2)
{
$data .= $value2['url']."|".$value2['ttl']."|".$value2['unq'].chr(1);
}
$data = $dailyTotal[$key]['ttl'].chr(1).$dailyTotal[$key]['unq'].chr(1) . $data;
$sql -> db_Insert("logstats", "0, '$key', '$data'");
}
}
/* ----------------------------------------------------------------------------------------------------------------------- */
function stage2()
{
// Converting browser entries
global $sql;
if($sql -> db_Select("logstats", "*", "log_id='statBrowser' "))
{
$row = $sql -> db_Fetch();
$browserTotal = unserialize($row['log_data']);
}
else
{
$browserTotal = array();
}
if(!$sql -> db_Select("stat_info", "*", "info_type='1'"))
{
return;
}
while($stat = $sql -> db_Fetch())
{
extract($stat);
$browserTotal[$info_name] += $info_count;
}
$data = serialize($browserTotal);
if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statBrowser' "))
{
$sql -> db_Insert("logstats", "0, 'statBrowser', '$data' ");
}
}
/* ----------------------------------------------------------------------------------------------------------------------- */
function stage3()
{
// Operating system entries
global $sql;
if($sql -> db_Select("logstats", "*", "log_id='statOs' "))
{
$row = $sql -> db_Fetch();
$osTotal = unserialize($row['log_data']);
}
else
{
$osTotal = array();
}
if(!$sql -> db_Select("stat_info", "*", "info_type='2'"))
{
return;
}
while($stat = $sql -> db_Fetch())
{
extract($stat);
$osTotal[$info_name] += $info_count;
}
$data = serialize($osTotal);
if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statOs' "))
{
$sql -> db_Insert("logstats", "0, 'statOs', '$data' ");
}
}
/* ----------------------------------------------------------------------------------------------------------------------- */
function stage4()
{
// Domain entries to convert
global $sql;
if($sql -> db_Select("logstats", "*", "log_id='statDomain' "))
{
$row = $sql -> db_Fetch();
$domTotal = unserialize($row['log_data']);
}
else
{
$domTotal = array();
}
if(!$sql -> db_Select("stat_info", "*", "info_type='4'"))
{
return;
}
while($stat = $sql -> db_Fetch())
{
extract($stat);
$domTotal[$info_name] += $info_count;
}
$data = serialize($domTotal);
if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statDomain' "))
{
$sql -> db_Insert("logstats", "0, 'statDomain', '$data' ");
}
}
/* ----------------------------------------------------------------------------------------------------------------------- */
function stage5()
{
// Screen entries to convert
global $sql;
if($sql -> db_Select("logstats", "*", "log_id='statScreen' "))
{
$row = $sql -> db_Fetch();
$screenTotal = unserialize($row['log_data']);
}
else
{
$screenTotal = array();
}
if(!$sql -> db_Select("stat_info", "*", "info_type='5'"))
{
return;
}
while($stat = $sql -> db_Fetch())
{
extract($stat);
if(!strstr($info_name, "undefined") && !strstr($info_name, "res"))
{
$info_name = str_replace(" @ ", "@", $info_name);
$screenTotal[$info_name] += $info_count;
}
}
$data = serialize($screenTotal);
if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statScreen' "))
{
$sql -> db_Insert("logstats", "0, 'statScreen', '$data' ");
}
}
/* ----------------------------------------------------------------------------------------------------------------------- */
function stage6()
{
// Converting referrer entries
global $sql;
if($sql -> db_Select("logstats", "*", "log_id='statReferer' "))
{
$row = $sql -> db_Fetch();
$refTotal = unserialize($row['log_data']);
}
else
{
$refTotal = array();
}
if(!$sql -> db_Select("stat_info", "*", "info_type='6'"))
{
return;
}
while($stat = $sql -> db_Fetch())
{
extract($stat);
if(!strstr($info_name, "undefined") && !strstr($info_name, "'"))
{
$refTotal[$info_name]['url'] = $info_name;
$refTotal[$info_name]['ttl'] += $info_count;
}
}
$data = serialize($refTotal);
if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statReferer' "))
{
$sql -> db_Insert("logstats", "0, 'statReferer', '$data' ");
}
}
/* ----------------------------------------------------------------------------------------------------------------------- */
function stage7()
{
// Correcting referrer entries
global $sql;
$sql -> db_Select("logstats", "*", "log_id='statReferer'");
$row = $sql -> db_Fetch();
$refTotal = unserialize($row['log_data']);
foreach ($refTotal as $key => $ref) {
if (!is_array($ref)){
unset($refTotal['key']);
$refTotal[$key]['url'] = $key;
$refTotal[$key]['ttl'] = $ref;
}
}
$data = serialize($refTotal);
if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statReferer' "))
{
$sql -> db_Insert("logstats", "0, 'statReferer', '$data' ");
}
}
}
?>

View File

@@ -1,39 +0,0 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/log/log_update_check.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:35:27 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
$dbupdatep['log_07'] = LAN_UPDATE_8." .617 statistics ".LAN_UPDATE_9." .7 statistics";
function update_log_07($type) {
global $sql, $mySQLdefaultdb;
if ($type == 'do') {
include_once(e_PLUGIN.'log/log_update.php');
} else {
if ($sql -> db_Query("SHOW COLUMNS FROM ".MPREFIX."stat_info") && $sql -> db_Select("plugin", "*", "plugin_path = 'log' AND plugin_installflag='1'")) {
if ($sql -> db_Count('stat_info','(*)',"WHERE info_type='99'") < 7) {
return FALSE;
} else {
return TRUE;
}
} else {
return TRUE;
}
}
}
?>

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/log/stats.php,v $
| $Revision: 1.6 $
| $Date: 2007-11-04 09:24:59 $
| $Revision: 1.7 $
| $Date: 2007-11-07 22:20:27 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -934,7 +934,7 @@ class siteStats
$text .= "<table class='fborder' style='width: 100%;'>\n
<tr><td class='fcaption' colspan='4' style='text-align:center'>".$this->browser_headings[$act].$pars['hdg_extra']."</td></tr>\n
<tr><td class='fcaption' style='width: 20%;'>
<a title='".($this -> order ? ADSTAT_L48 : ADSTAT_L49)."' href='".e_SELF."?3".($this -> order ? "" : ".1" )."'>".ADSTAT_L26."</a>
<a title='".($this -> order ? ADSTAT_L48 : ADSTAT_L49)."' href='".e_SELF."?".($show_version ? "3" : "14").($this -> order ? "" : ".1" )."'>".ADSTAT_L26."</a>
</td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L21."</td>\n
<td class='fcaption' style='width: 10%; text-align: center;'>%</td>\n</tr>\n";
@@ -1055,7 +1055,7 @@ class siteStats
$text .= "<table class='fborder' style='width: 100%;'>\n
<tr><td class='fcaption' colspan='4' style='text-align:center'>".$this->browser_headings[$act].$pars['hdg_extra']."</td></tr>\n
<tr>\n<td class='fcaption' style='width: 20%;'>
<a title='".($this -> order ? "sort by total" : "sort alphabetically")."' href='".e_SELF."?4".($this -> order ? "" : ".1" )."'>".ADSTAT_L27."</a></td>\n
<a title='".($this -> order ? "sort by total" : "sort alphabetically")."' href='".e_SELF."?".($show_version ? "4" : "15").($this -> order ? "" : ".1" )."'>".ADSTAT_L27."</a></td>\n
<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L21."</td>\n<td class='fcaption' style='width: 10%; text-align: center;'>%</td>\n</tr>\n";
if (count($osArray))