- ".$frm->admin_button('remSelP', ADSTAT_LAN_31, 'delete')."
-
-
- ";
-
- return $text;
-
- // $ns -> tablerender(ADSTAT_LAN_32, $text);
- }
-
-
- function rebuildPage()
- {
- $frm = e107::getForm();
- $mes = e107::getMessage();
- $tp = e107::getParser();
-
- $mes->addWarning(ADSTAT_LAN_84);
- $text = $frm->open('rebuild');
-
- $files = e107::getFile()->get_files(e_LOG."log",'_SiteStats\.log$');
-
- // print_a($_SESSION['stats_log_files']);
-
- $_SESSION['stats_log_files'] = array();
- $_SESSION['stats_log_files_count'] = 0;
-
- foreach($files as $f)
- {
- $_SESSION['stats_log_files'][] = array('path'=> $f['fname'], 'complete'=>0);
- }
-
- $_SESSION['stats_log_files_total'] = count($_SESSION['stats_log_files']);
-
- // $text .= // . " log files have been found. Click the button below to process these files.";
- $mes->addWarning($tp->lanVars(ADSTAT_LAN_85, $_SESSION['stats_log_files_total'], true));
-
- if(!empty($_SESSION['stats_log_files_total']))
- {
- $text .= $frm->progressBar('rebuild-progress',0,array("btn-label"=> ADSTAT_LAN_88, 'url'=>e_REQUEST_URI));
- }
-
- $text .= $frm->close();
- return $text;
-
-
- }
-
-
-
- function historyPage()
- {
- $mes = e107::getMessage();
- $frm = e107::getForm();
- $sql = e107::getDb();
-
- $mes->addWarning(ADSTAT_LAN_76);
- $text = "
-
-
";
-
- return $text;
- // $ns->tablerender(ADSTAT_LAN_69, $mes->render().$text);
- }
-
-
-
- private function prefsPageSubmit()
- {
-
- $statList = array( // Type = 0 for direct text, 1 for integer
- 'statActivate' => 0,
- 'statCountAdmin' => 0,
- 'statUserclass' => 0,
- 'statBrowser' => 1,
- 'statOs' => 1,
- 'statScreen' => 1,
- 'statDomain' => 1,
- 'statRefer' => 1,
- 'statQuery' => 1,
- 'statRecent' => 1,
- 'statDisplayNumber' => 0,
- 'statPrevMonth' => 1
- );
- $logStr = '';
-
- $pref = array();
-
- foreach ($statList as $k => $type)
- {
- switch ($type)
- {
- case 0 : $pref[$k] = $_POST[$k]; break;
- case 1 : $pref[$k] = intval($_POST[$k]); break;
- }
- $logStr .= "[!br!]{$k} => ".$pref[$k];
- }
-
- e107::getConfig()->setPref($pref)->save(false,true,true);
-
- file_put_contents(e_LOG.LogFlagFile, "\n"); // Logging task uses to see if logging enabled
- e107::getLog()->add('STAT_02',ADSTAT_LAN_82.$logStr,'');
-
-
- }
-
-
- public function prefsPage()
- {
-
- $pref = e107::getPref();
-
- $frm = e107::getForm();
-
- $text = "
-
";
-
- return $text;
- // $ns->tablerender(ADSTAT_LAN_16, $text);
- }
-
-
-
-
- /*
- // optional - a custom page.
- public function customPage()
- {
- $text = 'Hello World!';
- return $text;
-
- }
- */
-
- }
-
-
-
- class logstats_form_ui extends e_admin_form_ui
- {
-
- function log_id($curVal,$mode)
- {
- switch($mode)
- {
- case 'read': // List Page
-
- if($curVal == 'pageTotal')
- {
- return ADSTAT_LAN_45; // All Time.
- }
-
- return $curVal;
- break;
-
- case 'write': // Edit Page
- return '';
- break;
-
- case 'filter':
- case 'batch':
- return array();
- break;
- }
-
- }
-
-
- function parseLogData($type)
- {
- $row = $this->getController()->getListModel()->getData();
- $curVal = $row['log_data'];
-
- if($row['log_id'] == 'pageTotal')
- {
- $tmp = unserialize($curVal);
-
- $ttl = 0;
- $unq = 0;
-
- foreach($tmp as $k=>$v)
- {
- $ttl += $v['ttlv'];
- $unq += $v['unqv'];
- }
-
- if($type == 'total')
- {
- return number_format($ttl);
- }
- elseif($type == 'unique')
- {
- return number_format($unq);
- }
-
- return "
".ADSTAT_L21.": ".number_format($ttl)."
".ADSTAT_L22.": ".number_format($unq)."
Total Pages: ".number_format(count($tmp))."
";
-
-
- // return print_a($tmp,true);
- }
-
- if(!empty($curVal))
- {
- $tmp = explode(chr(1), $curVal, 3);
-
- if($type == 'total')
- {
- return number_format($tmp[0]);
- }
- elseif($type == 'unique')
- {
- return number_format($tmp[1]);
- }
-
- // return "
".ADSTAT_L21.": ".number_format($tmp[0])."
".ADSTAT_L22.": ".number_format($tmp[1])."
";
- }
-
- }
-
- // Total Hits
- function log_data($curVal,$mode)
- {
-
- switch($mode)
- {
- case 'read': // List Page
-
- return $this->parseLogData('total');
- break;
-
- case 'write': // Edit Page
- // return $this->text('log_data',$curVal, 255, 'size=large');
- break;
-
- case 'filter':
- case 'batch':
- return array();
- break;
- }
-
- return null;
- }
-
-
- // unique hits
- function log_data2($curVal,$mode)
- {
-
- switch($mode)
- {
- case 'read': // List Page
-
- return $this->parseLogData('unique');
- break;
-
- case 'write': // Edit Page
- // return $this->text('log_data',$curVal, 255, 'size=large');
- break;
-
- case 'filter':
- case 'batch':
- return array();
- break;
- }
-
- return null;
- }
-
-
-
- function options($curVal,$mode)
- {
- $row = $this->getController()->getListModel()->getData();
- $date = $row['log_id'];
-
- if($date == 'pageTotal')
- {
- return $this->button('rebuildTotal', 1, 'delete', ADSTAT_LAN_89);
- }
-
-
- $unix = strtotime($date);
-
- if(empty($unix))
- {
- return null;
- }
-
- $datestamp = date("Y-m-d", $unix);
-
- $file = e_LOG."log/".$datestamp."_SiteStats.log";
-
- if(is_readable($file))
- {
- return $this->button('rebuild', $datestamp, 'delete', ADSTAT_LAN_89);
- }
- else
- {
- return null;
- }
-
- }
-
- }
-
-
- new log_adminArea();
-
- require_once(e_ADMIN."auth.php");
- e107::getAdminUI()->runPage();
-
- require_once(e_ADMIN."footer.php");
-
-
-
-/*
-function headerjs()
-{
- $script_js = "\n";
- return $script_js;
-}
-
-*/
-
-
diff --git a/e107_plugins/log/consolidate.php b/e107_plugins/log/consolidate.php
deleted file mode 100644
index d71ef6007..000000000
--- a/e107_plugins/log/consolidate.php
+++ /dev/null
@@ -1,857 +0,0 @@
-pathtologs = e_LOG;
- $this->date = date("z.Y", time());
- $this->yesterday = date("z.Y",(time() - 86400)); // This makes sure year wraps round OK
- $this->date2 = date("Y-m-j", (time() -86400)); // Yesterday's date for the database summary
- $this->date3 = date("Y-m", (time() -86400)); // Current month's date for monthly summary (we're working with yesterday's data)
-
- $this->pfileprev = "logp_".$this->yesterday.".php"; // Yesterday's log file
- $this->pfile = "logp_".$this->date.".php"; // Today's log file
- $this->ifileprev = "logi_".$this->yesterday.".php";
- $this->ifile = "logi_".$this->date.".php";
- }
-
-
- function run()
- {
-
- $sql = e107::getDb();
- $pref = e107::pref('core');
-
- $pageInfo = array();
- $domainInfo = array();
- $screenInfo = array();
- $browserInfo = array();
- $osInfo = array();
- $refInfo = array();
- $searchInfo = array();
-
- $monthlyInfo = array();
- $mon_statBrowser = array();
- $mon_statOs = array();
- $mon_statScreen = array();
- $mon_statDomain = array();
- $mon_statQuery = array();
- $statBrowser = array();
- $statOs = array();
- $statScreen = array();
- $statDomain = array();
- $statQuery = array();
- $statReferer = array();
-
- $statTotal = 0;
- $statUnique = 0;
- $siteTotal = 0;
- $siteUnique = 0;
-
- $MonthlyExistsFlag = false;
-
- if(file_exists($this->pathtologs.$this->pfile)) /* log file is up to date, no consolidation required */
- {
- return false;
- }
- else if(!file_exists($this->pathtologs.$this->pfileprev)) // See if any older log files
- {
- if (($retvalue = $this->check_for_old_files($this->pathtologs)) === false) /* no logfile found at all - create - this will only ever happen once ... */
- {
- $this->createLog();
- return false;
- }
-
- list($this->pfileprev,$this->ifileprev,$this->date2,$tstamp) = explode('|',$retvalue); // ... if we've got files
- }
-
- unset($tstamp);
-
- // List of the non-page-based info which is gathered - historically only 'all-time' stats, now we support monthly as well
- $stats_list = array('statBrowser','statOs','statScreen','statDomain','statReferer','statQuery');
-
- $qry = "`log_id` IN ('statTotal','statUnique'";
- foreach ($stats_list as $s)
- {
- $qry .= ",'{$s}'"; // Always read the all-time stats
- if ($pref[$s] == 2) $qry .= ",'{$s}:{$this->date3}'"; // Look for monthlys as well as cumulative
- }
- $qry .= ")";
-
- /* log file is out of date - consolidation required */
-
- /* get existing stats ... */
- //if($sql->select("logstats", "*", "log_id='statBrowser' OR log_id='statOs' OR log_id='statScreen' OR log_id='statDomain' OR log_id='statTotal' OR log_id='statUnique' OR log_id='statReferer' OR log_id='statQuery'"))
- if($sql->select("logstats", "*", $qry))
- { // That's read in all the stats we need to modify
- while($row = $sql->fetch())
- {
- if($row['log_id'] == "statUnique")
- {
- $statUnique = $row['log_data'];
- }
- elseif ($row['log_id'] == "statTotal")
- {
- $statTotal = $row['log_data'];
- }
- elseif (($pos = strpos($row['log_id'],':')) === false)
- { // Its all-time stats
- $$row['log_id'] = unserialize($row['log_data']); // $row['log_id'] is the stats type - save in a variable
- }
- else
- { // Its monthly stats
- $row['log_id'] = 'mon_'.substr($row['log_id'],0,$pos); // Create a generic variable for each monthly stats
- $$row['log_id'] = unserialize($row['log_data']); // $row['log_id'] is the stats type - save in a variable
- }
- }
- }
- else
- {
- // this must be the first time a consolidation has happened - this will only ever happen once ...
- $sql->insert("logstats", "0, 'statBrowser', ''");
- $sql->insert("logstats", "0, 'statOs', ''");
- $sql->insert("logstats", "0, 'statScreen', ''");
- $sql->insert("logstats", "0, 'statDomain', ''");
- $sql->insert("logstats", "0, 'statReferer', ''");
- $sql->insert("logstats", "0, 'statQuery', ''");
- $sql->insert("logstats", "0, 'statTotal', '0'");
- $sql->insert("logstats", "0, 'statUnique', '0'");
-
- $statBrowser =array();
- $statOs =array();
- $statScreen =array();
- $statDomain =array();
- $statReferer =array();
- $statQuery =array();
- }
-
-
- foreach ($stats_list as $s)
- {
- $varname = 'mon_'.$s;
- if (!isset($$varname)) $$varname = array(); // Create monthly arrays if they don't exist
- }
-
- if(file_exists($this->pathtologs.$this->pfileprev))
- {
- require($this->pathtologs.$this->pfileprev); // Yesterday's page accesses - $pageInfo array
- }
-
- if(file_exists($this->pathtologs.$this->ifileprev))
- {
- require($this->pathtologs.$this->ifileprev); // Yesterdays browser accesses etc
- }
-
- foreach($browserInfo as $name => $amount)
- {
- $statBrowser[$name] += $amount;
- $mon_statBrowser[$name] += $amount;
- }
-
- foreach($osInfo as $name => $amount)
- {
- $statOs[$name] += $amount;
- $mon_statOs[$name] += $amount;
- }
-
- foreach($screenInfo as $name => $amount)
- {
- $statScreen[$name] += $amount;
- $mon_statScreen[$name] += $amount;
- }
-
-
- foreach($domainInfo as $name => $amount)
- {
- if(!is_numeric($name))
- {
- $statDomain[$name] += $amount;
- $mon_statDomain[$name] += $amount;
- }
- }
-
- foreach($refInfo as $name => $info)
- {
- $statReferer[$name]['url'] = $info['url'];
- $statReferer[$name]['ttl'] += $info['ttl'];
- $mon_statReferer[$name]['url'] = $info['url'];
- $mon_statReferer[$name]['ttl'] += $info['ttl'];
- }
-
-
- foreach($searchInfo as $name => $amount)
- {
- $statQuery[$name] += $amount;
- $mon_statQuery[$name] += $amount;
- }
-
- $browser = serialize($statBrowser);
- $os = serialize($statOs);
- $screen = serialize($statScreen);
- $domain = serialize($statDomain);
- $refer = serialize($statReferer);
- $squery = serialize($statQuery);
-
- $statTotal += $siteTotal;
- $statUnique += $siteUnique;
-
- // Save cumulative results - always keep track of these, even if the $pref doesn't display them
- $sql->update("logstats", "log_data='{$browser}' WHERE log_id='statBrowser'");
- $sql->update("logstats", "log_data='{$os}' WHERE log_id='statOs'");
- $sql->update("logstats", "log_data='{$screen}' WHERE log_id='statScreen'");
- $sql->update("logstats", "log_data='{$domain}' WHERE log_id='statDomain'");
- $sql->update("logstats", "log_data='{$refer}' WHERE log_id='statReferer'");
- $sql->update("logstats", "log_data='{$squery}' WHERE log_id='statQuery'");
- $sql->update("logstats", "log_data='".intval($statTotal)."' WHERE log_id='statTotal'");
- $sql->update("logstats", "log_data='".intval($statUnique)."' WHERE log_id='statUnique'");
-
-
- // Now save the relevant monthly results - only where enabled
- foreach ($stats_list as $s)
- {
- if (isset($pref[$s]) && ($pref[$s] > 1))
- { // Value 2 requires saving of monthly stats
- $srcvar = 'mon_'.$s;
- $destvar = 'smon_'.$s;
- $$destvar = serialize($$srcvar);
-
- if (!$sql->update("logstats", "log_data='".$$destvar."' WHERE log_id='".$s.":".$this->date3."'"))
- {
- $sql->insert("logstats", "0, '".$s.":".$this->date3."', '".$$destvar."'");
- }
- }
- }
-
-
- /* get page access monthly info from db */
- if($sql->select("logstats", "*", "log_id='{$this->date3}' "))
- {
- $tmp = $sql->fetch();
- $monthlyInfo = unserialize($tmp['log_data']);
- unset($tmp);
- $MonthlyExistsFlag = TRUE;
- }
-
- foreach($pageInfo as $key => $info)
- {
- $monthlyInfo['TOTAL']['ttlv'] += $info['ttl'];
- $monthlyInfo['TOTAL']['unqv'] += $info['unq'];
- $monthlyInfo[$key]['ttlv'] += $info['ttl'];
- $monthlyInfo[$key]['unqv'] += $info['unq'];
- }
-
- $monthlyinfo = serialize($monthlyInfo);
-
- if($MonthlyExistsFlag)
- {
- $sql->update("logstats", "log_data='{$monthlyinfo}' WHERE log_id='{$this->date3}'");
- }
- else
- {
- $sql->insert("logstats", "0, '{$this->date3}', '{$monthlyinfo}'");
- }
-
-
- $this->collatePageTotal($pageInfo);
- $this->collatePageInfo($pageInfo, $this->date2);
- $this->resetLogFiles();
-
- /* and finally, we need to create new logfiles for today ... */
- $this->createLog();
-
- return true;
- }
-
-
-
-
- function createLog()
- {
-
- if(!is_writable($this->pathtologs))
- {
- echo "
Log directory is not writable - please CHMOD ".e_LOG." to 777";
- echo '
Path to logs: '.$this->pathtologs;
- echo "
";
-
- return false;
- }
-
- $varStart = chr(36);
- $quote = chr(34);
-
- $data = chr(60)."?php\n". chr(47)."* e107 website system: Log file: ".date("z:Y", time())." *". chr(47)."\n\n".
- $varStart."refererData = ".$quote.$quote.";\n".
- $varStart."ipAddresses = ".$quote.$quote.";\n".
- $varStart."hosts = ".$quote.$quote.";\n".
- $varStart."siteTotal = ".$quote."0".$quote.";\n".
- $varStart."siteUnique = ".$quote."0".$quote.";\n".
- $varStart."screenInfo = array();\n".
- $varStart."browserInfo = array();\n".
- $varStart."osInfo = array();\n".
- $varStart."pageInfo = array(\n";
-
- $data .= "\n);\n\n?". chr(62);
-
- if(!touch($this->pathtologs.$this->pfile))
- {
- return false;
- }
-
- if(!touch($this->pathtologs.$this->ifile))
- {
- return false;
- }
-
- if(!is_writable($this->pathtologs.$this->pfile))
- {
- $old = umask(0);
- chmod($this->pathtologs.$this->pfile, 0777);
- umask($old);
- // return false;
- }
-
- if(!is_writable($this->pathtologs.$this->ifile))
- {
- $old = umask(0);
- chmod($this->pathtologs.$this->ifile, 0777);
- umask($old);
- // return false;
- }
-
- if ($handle = fopen($this->pathtologs.$this->pfile, 'w'))
- {
- fwrite($handle, $data);
- }
-
- fclose($handle);
-
-
- $data = "";
-
- if ($handle = fopen($this->pathtologs.$this->ifile, 'w'))
- {
- fwrite($handle, $data);
- }
- fclose($handle);
-
- return true;
- }
-
-
-
-
- /**
- * Called if both today's and yesterday's log files missing, to see
- * if there are any older files we could process. Return false if nothing
- * Otherwise return a string of relevant information
- * @param $pathtologs
- * @return bool|string
- */
- function check_for_old_files($pathtologs)
- {
- // $no_files = TRUE;
- if ($dir_handle = opendir($pathtologs))
- {
- while (false !== ($file = readdir($dir_handle)))
- {
- // Do match on #^logp_(\d{1,3})\.php$#i
- if (preg_match('#^logp_(\d{1,3}\.\d{4})\.php$#i',$file,$match) == 1)
- { // got a matching file
- $yesterday = $match[1]; // Day of year - zero is 1st Jan
- $pfileprev = "logp_".$yesterday.".php"; // Yesterday's log file
- $ifileprev = "logi_".$yesterday.".php";
- list($day,$year) = explode('.',$yesterday);
- $tstamp = mktime(0,0,0,1,1,$year) + ($day*86400);
- $date2 = date("Y-m-j", $tstamp); // Yesterday's date for the database summary
- $temp = array($pfileprev,$ifileprev,$date2,$tstamp);
- return implode('|',$temp);
- }
- }
- }
- return false;
- }
-
-
-
-
-
- // for future use.
- private function collate($pfile)
- {
- if(is_readable(e_LOG.$pfile))
- {
- require(e_LOG.$pfile); // contains $pageInfo;
- }
- else
- {
- return false;
- }
-
- return null;
- }
-
-
-
-
- /**
- * @param $url
- * @param bool $logQry
- * @param string $err_code
- * @return bool|mixed|string
- */
- function getPageKey($url,$logQry=false,$err_code='', $lan=null)
- {
- $pageDisallow = "cache|file|eself|admin";
- $tagRemove = "(\\\)|(\s)|(\')|(\")|(eself)|( )|(\.php)|(\.html)";
-
- // preg_match("#/(.*?)(\?|$)(.*)#si", $url, $match);
- // $match[1] = isset($match[1]) ? $match[1] : '';
- // $pageName = substr($match[1], (strrpos($match[1], "/")+1));
-
- if(deftrue('e_DOMAIN'))
- {
- list($discard,$pageName) = explode(e_DOMAIN.'/',$url); // everything after the domain.
- }
- else // eg. local setup.
- {
- $pageName = str_replace(SITEURL,'',$url);
- }
-
- $pageName = urldecode($pageName);
-
- $pageName = preg_replace("/".$tagRemove."/si", "", $pageName);
-
- if($logQry == false)
- {
- $tmp = explode("?",$pageName);
- $pageName = $tmp[0];
- }
-
- if(empty($pageName))
- {
- $pageName = "index";
- }
-
- if(preg_match("/".$pageDisallow."/i", $pageName))
- {
- return false;
- }
-
- // if ($logQry)
- // {
- // $pageName .= '+'.$match[3]; // All queries match
- // }
-
- $pageName = $err_code.$pageName; // Add the error code at the beginning, so its treated uniquely
-
- // filter out any non-utf8 characters which could halt processing.
-
- $pageName = iconv('UTF-8', 'ASCII//IGNORE', $pageName);
-
- $pageName = trim($pageName,' /');
-
-
- if(!empty($lan))
- {
- $pageName .= "|".$lan;
- }
-
- return $pageName;
- }
-
-
- /**
- * Process Raw Backup Log File. e. e_LOG."log/2015-09-24_SiteStats.log
- * This method can be used in the case of a database corruption to restore stats to the database.
- * @param string $file
- * @param bool $savetoDB
- * @return bool
- * @example processRawBackupLog('2015-09-24_SiteStats.log', false);
- */
- function processRawBackupLog($file, $savetoDB=false)
- {
- $path = e_LOG."log/".$file;
-
- $mes = e107::getMessage();
-
- if(!is_readable($path))
- {
- $mes->addError( "File Not Found: ".$path);
- return false;
- }
-
- $handle = fopen($path, "r");
-
- $pageTotal = array();
- $line = 0;
-
-
- if ($handle)
- {
- while (($buffer = fgets($handle, 4096)) !== false)
- {
- if($vars = $this->splitRawBackupLine($buffer))
- {
-
- if(strpos($vars['eself'],'file://') === 0)
- {
- continue;
- }
-
- $lan = varset($vars['lan'],null);
- $key = $this->getPageKey($vars['eself'],false,'',$lan);
-
- if(empty($key))
- {
- continue;
- }
-
- if(!isset($pageTotal[$key]))
- {
- $pageTotal[$key] = array('url'=>'', 'ttl'=>0, 'unq'=>0, 'lan'=>'');
- }
-
- $pageTotal[$key]['url'] = $vars['eself'];
- $pageTotal[$key]['ttl'] += 1;
-
- // echo "\n
line: ".$line." ------- ".$key;
-
- if(isset($vars['unique']))
- {
- if($vars['unique'] == 1)
- {
- $pageTotal[$key]['unq'] += 1;
- }
- }
- else
- {
- $pageTotal[$key]['unq'] += 1;
- }
-
- $lan = varset($vars['lan'],'');
- $pageTotal[$key]['lan'] = $lan;
- }
-
- $line++;
- }
-
- if (!feof($handle))
- {
- $mes->addError( "Error: unexpected fgets() fail.");
- }
-
- fclose($handle);
-
-
- if(e_DEBUG)
- {
- $mes->addDebug("
".$file."
");
- $mes->addDebug(print_a($pageTotal,true));
- }
- }
-
- if($savetoDB === false)
- {
- $mes->addInfo( "Saving mode is off");
- return true;
- }
-
-
- if(!empty($pageTotal))
- {
- list($date,$name) = explode("_", $file, 2);
-
- unset($name);
-
- $unix = strtotime($date);
-
- $datestamp = date("Y-m-j", $unix);
-
- if(!empty($datestamp))
- {
- $sql = e107::getDb();
-
- if($sql->select('logstats','log_id',"log_id='".$datestamp."' ") && !$sql->select('logstats','log_id',"log_id='bak-".$datestamp."' "))
- {
- $sql->update('logstats', "log_id='bak-".$datestamp."' WHERE log_id='".$datestamp."' ");
- }
-
- if($this->collatePageInfo($pageTotal, $datestamp))
- {
- $message = e107::getParser()->lanVars(ADSTAT_LAN_90, array('x'=>$datestamp));
- $mes->addSuccess($message);
- }
- else
- {
- $message = e107::getParser()->lanVars(ADSTAT_LAN_91, array('x'=>$datestamp));
- $mes->addError($message);
- }
- }
-
- }
-
- return true;
- }
-
-
-
-
- private function splitRawBackupLine($line)
- {
- list($datestamp,$bla,$data) = explode("\t",$line, 3);
-
- if(!empty($data))
- {
- parse_str($data,$vars);
- return $vars;
- }
-
- unset($datestamp, $bla); // remove editor warnings.
-
- return false;
- }
-
- /**
- * Fix corrupted page data.
- * Re-calculate all page totals from all existing database information and save to DB as 'pageTotal'. .
- */
- function collatePageTotalDB()
- {
- $sql = e107::getDb();
-
- $qry = "SELECT * FROM `#logstats` WHERE `log_id` REGEXP '^[0-9]' AND LENGTH(log_id) > 7 AND `log_data` LIKE '%http%'";
- $data = $sql->retrieve($qry,true);
-
- $pageTotal = array();
-
- foreach($data as $values)
- {
- $tmp = explode(chr(1),$values['log_data']);
- unset($tmp[0],$tmp[1]);
- $thisTotal = array();
-
- foreach($tmp as $val)
- {
- if(!empty($val))
- {
- list($url,$ttl,$unq,$lan) = explode("|",$val);
- $lan = vartrue($lan,e_LAN);
- $key = $this->getPageKey($url,'','', $lan);
-
- $thisTotal[$key]['url'] = $url;
- $thisTotal[$key]['lan'] = $lan;
- $thisTotal[$key]['ttlv'] += $ttl;
- $thisTotal[$key]['unqv'] += $unq;
-
- $pageTotal[$key]['url'] = $url;
- $pageTotal[$key]['lan'] = $lan;
- $pageTotal[$key]['ttlv'] += $ttl;
- $pageTotal[$key]['unqv'] += $unq;
- }
-
- }
-
- // echo "
".$values['log_id']."
";
- // print_a($thisTotal);
-
- }
-
- if(empty($pageTotal))
- {
- return false;
- }
-
- $id = $sql->retrieve('logstats','log_uniqueid', "log_id='pageTotal'");
-
- $insertData = array(
- 'log_uniqueid' => intval($id),
- 'log_id'=> 'pageTotal',
- 'log_data'=> serialize($pageTotal)
- );
-
- // echo "
Total
";
- // print_a($pageTotal);
-
- return $sql->replace('logstats', $insertData);
-
- }
-
-
- /**
- * collate page total information using today's data and totals stored in DB.
- * @param $pageInfo - from today's file.
- * @return bool
- */
- function collatePageTotal($pageInfo=array())
- {
- $sql = e107::getDb();
-
- if($sql->select("logstats", "*", "log_id='pageTotal' "))
- {
- $tmp = $sql->fetch();
- $pageTotal = unserialize($tmp['log_data']);
- $uniqueID = $tmp['log_uniqueid'];
- unset($tmp);
-
- }
- else
- {
- $pageTotal = array();
- $uniqueID = 0;
- }
-
- // echo "
DB Totals
";
- // print_a($pageTotal);
-
- // echo "
From File
";
- // print_a($pageInfo);
-
- foreach($pageInfo as $key => $info)
- {
- $pageTotal[$key]['url'] = $info['url'];
- $pageTotal[$key]['ttlv'] += $info['ttl'];
- $pageTotal[$key]['unqv'] += $info['unq'];
- }
-
- // echo "
Consilidated
";
- // print_a($pageTotal);
-
- if(empty($pageTotal))
- {
- return false;
- }
-
- $insertData = array(
- 'log_uniqueid' => intval($uniqueID),
- 'log_id' => 'pageTotal',
- 'log_data' => serialize($pageTotal)
- );
-
- return $sql->replace('logstats', $insertData);
-
- }
-
-
- /**
- * Collate individual page information into an array and save to database.
- * @param array $pageInfo
- * @param string $date - the value saved to log_id ie. Y-m-j , 2015-02-1, 2015-02-30
- * @return bool
- */
- function collatePageInfo($pageInfo, $date)
- {
-
- $sql = e107::getDb();
- $tp = e107::getParser();
-
- $data = "";
- $dailytotal = 0;
- $uniquetotal = 0;
-
- foreach($pageInfo as $key => $value)
- {
- $data .= $value['url']."|".$value['ttl']."|".$value['unq'].'|'.varset($value['lan'],e_LAN).chr(1);
- $dailytotal += $value['ttl'];
- $uniquetotal += $value['unq'];
- }
-
- $data = $dailytotal.chr(1).$uniquetotal.chr(1) . $data;
- return $sql->insert("logstats", "0, '$date', '".$tp -> toDB($data, true)."'");
- }
-
-
- /**
- * Reset (empty) yesterday's log files.
- * @return bool
- */
- function resetLogFiles()
- {
-
- if(empty($this->pfileprev) || empty($this->ifileprev))
- {
- return false;
- }
-
- /* ok, we're finished with the log file now, we can empty it ... */
- if(!unlink($this->pathtologs.$this->pfileprev))
- {
- $data = chr(60)."?php\n". chr(47)."* e107 website system: Log file: ".date("z:Y", time())." *". chr(47)."\n\n\n\n".chr(47)."* THE INFORMATION IN THIS LOG FILE HAS BEEN CONSOLIDATED INTO THE DATABASE - YOU CAN SAFELY DELETE IT. *". chr(47)."\n\n\n?". chr(62);
-
- if($handle = fopen($this->pathtologs.$this->pfileprev, 'w'))
- {
- fwrite($handle, $data);
- }
-
- fclose($handle);
- }
-
-
- if(!unlink($this->pathtologs.$this->ifileprev))
- {
- $data = chr(60)."?php\n". chr(47)."* e107 website system: Log file: ".date("z:Y", time())." *". chr(47)."\n\n\n\n".chr(47)."* THE INFORMATION IN THIS LOG INFO FILE HAS BEEN CONSOLIDATED INTO THE DATABASE - YOU CAN SAFELY DELETE IT. *". chr(47)."\n\n\n?". chr(62);
-
- if($handle = fopen($this->pathtologs.$this->ifileprev, 'w'))
- {
- fwrite($handle, $data);
- }
-
- fclose($handle);
- }
-
-
- return true;
- }
-}
-
-
-
-
-
-
-
-
-
diff --git a/e107_plugins/log/e_help.php b/e107_plugins/log/e_help.php
deleted file mode 100644
index d8f197d2e..000000000
--- a/e107_plugins/log/e_help.php
+++ /dev/null
@@ -1,45 +0,0 @@
- tablerender(LAN_STAT_HELP_01, $text);
-unset($text);
diff --git a/e107_plugins/log/e_meta.php b/e107_plugins/log/e_meta.php
deleted file mode 100644
index b8ad8625f..000000000
--- a/e107_plugins/log/e_meta.php
+++ /dev/null
@@ -1,105 +0,0 @@
-run();
-
- $err_flag = '';
- if (defined('ERR_PAGE_ACTIVE'))
- { // We've got an error - set a flag to log it
- $err_flag = "&err_direct=".ERR_PAGE_ACTIVE;
- 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'];
- }
-
- }
-
- if(USER_AREA)
- {
- $logJS = "
-
- $(function() {
-
- function rstr2b64(input)
- {
- var b64pad = \"=\"; /* base-64 pad character. \"=\" for strict RFC compliance */
- var tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";
- var output = \"\";
- var len = input.length;
- for(var i = 0; i < len; i += 3)
- {
- var triplet = (input.charCodeAt(i) << 16)
- | (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)
- | (i + 2 < len ? input.charCodeAt(i+2) : 0);
- for(var j = 0; j < 4; j++)
- {
- if(i * 8 + j * 6 > input.length * 8) output += b64pad;
- else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);
- }
- }
- return output;
- }
-
-
-
-
-
- var ref =\"\"+escape(top.document.referrer);
- var eeself = escape(window.location.href);
-
- var colord = window.screen.colorDepth;
- var res = window.screen.width + \"x\" + window.screen.height;
- var logString = 'referer=' + ref + '&colour=' + colord + '&eself=' + eeself + '&res=' + res + '".$err_flag."';
- logString = rstr2b64(logString);
-
- var url = '".SITEURLBASE.e_PLUGIN_ABS."log/log.php';
- var dataText = 'lv='+logString;
-
- $.ajax({
- type: 'get',
- url: url,
- data: {'lv' :logString},
- success: function(e) {
- if(e)
- {
- // alert(e);
- }
- }
- });
- });
- ";
-
-
-
-
- e107::js('footer-inline', $logJS, 'jquery');
- }
-}
-
-
diff --git a/e107_plugins/log/e_shortcode.php b/e107_plugins/log/e_shortcode.php
deleted file mode 100644
index c9df94041..000000000
--- a/e107_plugins/log/e_shortcode.php
+++ /dev/null
@@ -1,106 +0,0 @@
-lgc = new logConsolidate;
-
- $sql = e107::getDB();
- $logfile = e_LOG.'logp_'.date('z.Y', time()).'.php'; /* get today's logfile ... */
-
- $pageInfo = array();
-
- if(is_readable($logfile)) // populate $pageInfo
- {
- require($logfile);
- }
-
- $logfile = e_LOG.'logi_'.date('z.Y', time()).'.php'; // $logfile = e_PLUGIN.'log/logs/logi_'.date('z.Y', time()).'.php';
-
- if(is_readable($logfile))
- {
- require($logfile);
- // e107::getMessage()->addDebug("Loading Log File: ".$logfile);
- }
-
-
- if($sql->select('logstats', 'log_data', "log_id='pageTotal'")) /* get main stat info from database */
- {
- $row = $sql->fetch();
- $this->dbPageInfo = unserialize($row['log_data']);
- // e107::getMessage()->addDebug("Loading Logstats from DB: ".print_a($this->dbPageInfo,true));
- }
- else
- {
- $this->dbPageInfo = array();
- }
-
- /* temp consolidate today's info (if it exists)... */
- if(is_array($pageInfo))
- {
- foreach($pageInfo as $key => $info)
- {
- $key = preg_replace("/\?.*/", "", $key);
- if(array_key_exists($key, $this -> dbPageInfo))
- {
- $this -> dbPageInfo[$key]['ttlv'] += $info['ttl'];
- $this -> dbPageInfo[$key]['unqv'] += $info['unq'];
- }
- else
- {
- $this -> dbPageInfo[$key]['url'] = $info['url'];
- $this -> dbPageInfo[$key]['ttlv'] = $info['ttl'];
- $this -> dbPageInfo[$key]['unqv'] = $info['unq'];
- }
- }
- }
-
-
- }
-
-
- private function getKey($self)
- {
- return $this->lgc->getPageKey($self, false, '', e_LAN);
- //$base = basename($self);
- // list($url,$qry) = explode(".",$base, 2);
- // return $url;
- }
-
-
- function sc_log_pagecounter($parm=null)
- {
-
- //print_a($this->dbPageInfo);
-
- $url = str_replace("www.", "", e_REQUEST_URL);
- $id = $this->getKey(e_REQUEST_URL);
- // print_a("Checking for: ".$id);
-
- // print_a($this->dbPageInfo);
-
- if(isset($this->dbPageInfo[$id]['url']) && ($this->dbPageInfo[$id]['url'] == e_REQUEST_URL || $this->dbPageInfo[$id]['url'] == $url))
- {
- return ($parm == 'unique') ? number_format($this->dbPageInfo[$id]['unqv']) : number_format($this->dbPageInfo[$id]['ttlv']);
- }
-
- }
-
-}
-
-
-
diff --git a/e107_plugins/log/e_url.php b/e107_plugins/log/e_url.php
deleted file mode 100644
index 0bedd6607..000000000
--- a/e107_plugins/log/e_url.php
+++ /dev/null
@@ -1,49 +0,0 @@
- 'stats',
- 'regex' => '^{alias}/?$', // matched against url, and if true, redirected to 'redirect' below.
- 'sef' => '{alias}', // 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.
-
- );
-
- $config['others'] = array(
- 'alias' => 'stats',
- 'regex' => '^{alias}/\?(.*)$', // matched against url, and if true, redirected to 'redirect' below.
- 'sef' => '{alias}', // 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;
- }
-
-
-
-}
\ No newline at end of file
diff --git a/e107_plugins/log/images/abrowse.png b/e107_plugins/log/images/abrowse.png
deleted file mode 100644
index 0bfd1f4d3..000000000
Binary files a/e107_plugins/log/images/abrowse.png and /dev/null differ
diff --git a/e107_plugins/log/images/amaya.png b/e107_plugins/log/images/amaya.png
deleted file mode 100644
index 4ff2d23c8..000000000
Binary files a/e107_plugins/log/images/amaya.png and /dev/null differ
diff --git a/e107_plugins/log/images/android.png b/e107_plugins/log/images/android.png
deleted file mode 100644
index b8e2e0bf6..000000000
Binary files a/e107_plugins/log/images/android.png and /dev/null differ
diff --git a/e107_plugins/log/images/ant.png b/e107_plugins/log/images/ant.png
deleted file mode 100644
index 6b6a2b5a1..000000000
Binary files a/e107_plugins/log/images/ant.png and /dev/null differ
diff --git a/e107_plugins/log/images/aol.png b/e107_plugins/log/images/aol.png
deleted file mode 100644
index c1db9c709..000000000
Binary files a/e107_plugins/log/images/aol.png and /dev/null differ
diff --git a/e107_plugins/log/images/aol2.png b/e107_plugins/log/images/aol2.png
deleted file mode 100644
index c1db9c709..000000000
Binary files a/e107_plugins/log/images/aol2.png and /dev/null differ
diff --git a/e107_plugins/log/images/avantbrowser.png b/e107_plugins/log/images/avantbrowser.png
deleted file mode 100644
index 4227d6bc2..000000000
Binary files a/e107_plugins/log/images/avantbrowser.png and /dev/null differ
diff --git a/e107_plugins/log/images/avantgo.png b/e107_plugins/log/images/avantgo.png
deleted file mode 100644
index d3d1fd706..000000000
Binary files a/e107_plugins/log/images/avantgo.png and /dev/null differ
diff --git a/e107_plugins/log/images/aweb.png b/e107_plugins/log/images/aweb.png
deleted file mode 100644
index 52e81c733..000000000
Binary files a/e107_plugins/log/images/aweb.png and /dev/null differ
diff --git a/e107_plugins/log/images/bar.png b/e107_plugins/log/images/bar.png
deleted file mode 100644
index 82b53c3da..000000000
Binary files a/e107_plugins/log/images/bar.png and /dev/null differ
diff --git a/e107_plugins/log/images/beonex.png b/e107_plugins/log/images/beonex.png
deleted file mode 100644
index 11da7a809..000000000
Binary files a/e107_plugins/log/images/beonex.png and /dev/null differ
diff --git a/e107_plugins/log/images/beos.png b/e107_plugins/log/images/beos.png
deleted file mode 100644
index bab61ff4a..000000000
Binary files a/e107_plugins/log/images/beos.png and /dev/null differ
diff --git a/e107_plugins/log/images/blazer.png b/e107_plugins/log/images/blazer.png
deleted file mode 100644
index 1af34ea73..000000000
Binary files a/e107_plugins/log/images/blazer.png and /dev/null differ
diff --git a/e107_plugins/log/images/camino.png b/e107_plugins/log/images/camino.png
deleted file mode 100644
index d48b9df1c..000000000
Binary files a/e107_plugins/log/images/camino.png and /dev/null differ
diff --git a/e107_plugins/log/images/chimera.png b/e107_plugins/log/images/chimera.png
deleted file mode 100644
index 1ff66ed90..000000000
Binary files a/e107_plugins/log/images/chimera.png and /dev/null differ
diff --git a/e107_plugins/log/images/chrome.png b/e107_plugins/log/images/chrome.png
deleted file mode 100644
index 1eee7b325..000000000
Binary files a/e107_plugins/log/images/chrome.png and /dev/null differ
diff --git a/e107_plugins/log/images/columbus.png b/e107_plugins/log/images/columbus.png
deleted file mode 100644
index 5663b16ef..000000000
Binary files a/e107_plugins/log/images/columbus.png and /dev/null differ
diff --git a/e107_plugins/log/images/crazybrowser.png b/e107_plugins/log/images/crazybrowser.png
deleted file mode 100644
index 69130deec..000000000
Binary files a/e107_plugins/log/images/crazybrowser.png and /dev/null differ
diff --git a/e107_plugins/log/images/curl.png b/e107_plugins/log/images/curl.png
deleted file mode 100644
index ff2f8dc19..000000000
Binary files a/e107_plugins/log/images/curl.png and /dev/null differ
diff --git a/e107_plugins/log/images/deepnet.png b/e107_plugins/log/images/deepnet.png
deleted file mode 100644
index 6a6ce279b..000000000
Binary files a/e107_plugins/log/images/deepnet.png and /dev/null differ
diff --git a/e107_plugins/log/images/dillo.png b/e107_plugins/log/images/dillo.png
deleted file mode 100644
index f53db608f..000000000
Binary files a/e107_plugins/log/images/dillo.png and /dev/null differ
diff --git a/e107_plugins/log/images/doris.png b/e107_plugins/log/images/doris.png
deleted file mode 100644
index ace3c9b9c..000000000
Binary files a/e107_plugins/log/images/doris.png and /dev/null differ
diff --git a/e107_plugins/log/images/epiphany.png b/e107_plugins/log/images/epiphany.png
deleted file mode 100644
index 1f2bacc36..000000000
Binary files a/e107_plugins/log/images/epiphany.png and /dev/null differ
diff --git a/e107_plugins/log/images/explorer.png b/e107_plugins/log/images/explorer.png
deleted file mode 100644
index f289a21b2..000000000
Binary files a/e107_plugins/log/images/explorer.png and /dev/null differ
diff --git a/e107_plugins/log/images/firebird.png b/e107_plugins/log/images/firebird.png
deleted file mode 100644
index 4e03f451b..000000000
Binary files a/e107_plugins/log/images/firebird.png and /dev/null differ
diff --git a/e107_plugins/log/images/firefox.png b/e107_plugins/log/images/firefox.png
deleted file mode 100644
index 264c08d60..000000000
Binary files a/e107_plugins/log/images/firefox.png and /dev/null differ
diff --git a/e107_plugins/log/images/freebsd.png b/e107_plugins/log/images/freebsd.png
deleted file mode 100644
index ef1e9e74f..000000000
Binary files a/e107_plugins/log/images/freebsd.png and /dev/null differ
diff --git a/e107_plugins/log/images/galeon.png b/e107_plugins/log/images/galeon.png
deleted file mode 100644
index b2d464455..000000000
Binary files a/e107_plugins/log/images/galeon.png and /dev/null differ
diff --git a/e107_plugins/log/images/html.png b/e107_plugins/log/images/html.png
deleted file mode 100644
index 173274770..000000000
Binary files a/e107_plugins/log/images/html.png and /dev/null differ
diff --git a/e107_plugins/log/images/ibrowse.png b/e107_plugins/log/images/ibrowse.png
deleted file mode 100644
index b69d91fe1..000000000
Binary files a/e107_plugins/log/images/ibrowse.png and /dev/null differ
diff --git a/e107_plugins/log/images/icab.png b/e107_plugins/log/images/icab.png
deleted file mode 100644
index 98c18456d..000000000
Binary files a/e107_plugins/log/images/icab.png and /dev/null differ
diff --git a/e107_plugins/log/images/ice.png b/e107_plugins/log/images/ice.png
deleted file mode 100644
index 7a76e3ec6..000000000
Binary files a/e107_plugins/log/images/ice.png and /dev/null differ
diff --git a/e107_plugins/log/images/isilox.png b/e107_plugins/log/images/isilox.png
deleted file mode 100644
index 144b36a1d..000000000
Binary files a/e107_plugins/log/images/isilox.png and /dev/null differ
diff --git a/e107_plugins/log/images/k-meleon.png b/e107_plugins/log/images/k-meleon.png
deleted file mode 100644
index 7ea885ec6..000000000
Binary files a/e107_plugins/log/images/k-meleon.png and /dev/null differ
diff --git a/e107_plugins/log/images/konqueror.png b/e107_plugins/log/images/konqueror.png
deleted file mode 100644
index 2fc9f6e27..000000000
Binary files a/e107_plugins/log/images/konqueror.png and /dev/null differ
diff --git a/e107_plugins/log/images/links.png b/e107_plugins/log/images/links.png
deleted file mode 100644
index 7dbafef2b..000000000
Binary files a/e107_plugins/log/images/links.png and /dev/null differ
diff --git a/e107_plugins/log/images/linux.png b/e107_plugins/log/images/linux.png
deleted file mode 100644
index e55a615df..000000000
Binary files a/e107_plugins/log/images/linux.png and /dev/null differ
diff --git a/e107_plugins/log/images/logo.png b/e107_plugins/log/images/logo.png
deleted file mode 100644
index be7a2ff96..000000000
Binary files a/e107_plugins/log/images/logo.png and /dev/null differ
diff --git a/e107_plugins/log/images/lotus.png b/e107_plugins/log/images/lotus.png
deleted file mode 100644
index b6ead033b..000000000
Binary files a/e107_plugins/log/images/lotus.png and /dev/null differ
diff --git a/e107_plugins/log/images/lunascape.png b/e107_plugins/log/images/lunascape.png
deleted file mode 100644
index 2cfe8641b..000000000
Binary files a/e107_plugins/log/images/lunascape.png and /dev/null differ
diff --git a/e107_plugins/log/images/lynx.png b/e107_plugins/log/images/lynx.png
deleted file mode 100644
index 4f7b59dea..000000000
Binary files a/e107_plugins/log/images/lynx.png and /dev/null differ
diff --git a/e107_plugins/log/images/mac.png b/e107_plugins/log/images/mac.png
deleted file mode 100644
index 03f56f402..000000000
Binary files a/e107_plugins/log/images/mac.png and /dev/null differ
diff --git a/e107_plugins/log/images/maxthon.png b/e107_plugins/log/images/maxthon.png
deleted file mode 100644
index 9b0c6e7b8..000000000
Binary files a/e107_plugins/log/images/maxthon.png and /dev/null differ
diff --git a/e107_plugins/log/images/mbrowser.png b/e107_plugins/log/images/mbrowser.png
deleted file mode 100644
index 0d600ee3c..000000000
Binary files a/e107_plugins/log/images/mbrowser.png and /dev/null differ
diff --git a/e107_plugins/log/images/mosaic.png b/e107_plugins/log/images/mosaic.png
deleted file mode 100644
index b0d97dfe7..000000000
Binary files a/e107_plugins/log/images/mosaic.png and /dev/null differ
diff --git a/e107_plugins/log/images/mozilla.png b/e107_plugins/log/images/mozilla.png
deleted file mode 100644
index 0e7909096..000000000
Binary files a/e107_plugins/log/images/mozilla.png and /dev/null differ
diff --git a/e107_plugins/log/images/mozilla2.png b/e107_plugins/log/images/mozilla2.png
deleted file mode 100644
index 0e7909096..000000000
Binary files a/e107_plugins/log/images/mozilla2.png and /dev/null differ
diff --git a/e107_plugins/log/images/multibrowser.png b/e107_plugins/log/images/multibrowser.png
deleted file mode 100644
index eb4d71b86..000000000
Binary files a/e107_plugins/log/images/multibrowser.png and /dev/null differ
diff --git a/e107_plugins/log/images/nautilus.png b/e107_plugins/log/images/nautilus.png
deleted file mode 100644
index 93ac5c3a8..000000000
Binary files a/e107_plugins/log/images/nautilus.png and /dev/null differ
diff --git a/e107_plugins/log/images/netbsd.png b/e107_plugins/log/images/netbsd.png
deleted file mode 100644
index 3b5986287..000000000
Binary files a/e107_plugins/log/images/netbsd.png and /dev/null differ
diff --git a/e107_plugins/log/images/netcaptor.png b/e107_plugins/log/images/netcaptor.png
deleted file mode 100644
index d4c374420..000000000
Binary files a/e107_plugins/log/images/netcaptor.png and /dev/null differ
diff --git a/e107_plugins/log/images/netfront.png b/e107_plugins/log/images/netfront.png
deleted file mode 100644
index 36fecf681..000000000
Binary files a/e107_plugins/log/images/netfront.png and /dev/null differ
diff --git a/e107_plugins/log/images/netpositive.png b/e107_plugins/log/images/netpositive.png
deleted file mode 100644
index 510326cb9..000000000
Binary files a/e107_plugins/log/images/netpositive.png and /dev/null differ
diff --git a/e107_plugins/log/images/netscape.png b/e107_plugins/log/images/netscape.png
deleted file mode 100644
index 03e90d976..000000000
Binary files a/e107_plugins/log/images/netscape.png and /dev/null differ
diff --git a/e107_plugins/log/images/netscape2.png b/e107_plugins/log/images/netscape2.png
deleted file mode 100644
index 03e90d976..000000000
Binary files a/e107_plugins/log/images/netscape2.png and /dev/null differ
diff --git a/e107_plugins/log/images/nokia.png b/e107_plugins/log/images/nokia.png
deleted file mode 100644
index b0e225821..000000000
Binary files a/e107_plugins/log/images/nokia.png and /dev/null differ
diff --git a/e107_plugins/log/images/omniweb.png b/e107_plugins/log/images/omniweb.png
deleted file mode 100644
index 5a0d5eaef..000000000
Binary files a/e107_plugins/log/images/omniweb.png and /dev/null differ
diff --git a/e107_plugins/log/images/openbsd.png b/e107_plugins/log/images/openbsd.png
deleted file mode 100644
index 7d672e5d8..000000000
Binary files a/e107_plugins/log/images/openbsd.png and /dev/null differ
diff --git a/e107_plugins/log/images/opera.png b/e107_plugins/log/images/opera.png
deleted file mode 100644
index 9b709885e..000000000
Binary files a/e107_plugins/log/images/opera.png and /dev/null differ
diff --git a/e107_plugins/log/images/oregano.png b/e107_plugins/log/images/oregano.png
deleted file mode 100644
index 13fd160c2..000000000
Binary files a/e107_plugins/log/images/oregano.png and /dev/null differ
diff --git a/e107_plugins/log/images/phaseout.png b/e107_plugins/log/images/phaseout.png
deleted file mode 100644
index 80d108864..000000000
Binary files a/e107_plugins/log/images/phaseout.png and /dev/null differ
diff --git a/e107_plugins/log/images/phoenix.png b/e107_plugins/log/images/phoenix.png
deleted file mode 100644
index 758de7d59..000000000
Binary files a/e107_plugins/log/images/phoenix.png and /dev/null differ
diff --git a/e107_plugins/log/images/proxomitron.png b/e107_plugins/log/images/proxomitron.png
deleted file mode 100644
index e353a3f41..000000000
Binary files a/e107_plugins/log/images/proxomitron.png and /dev/null differ
diff --git a/e107_plugins/log/images/remove.png b/e107_plugins/log/images/remove.png
deleted file mode 100644
index e21d71f98..000000000
Binary files a/e107_plugins/log/images/remove.png and /dev/null differ
diff --git a/e107_plugins/log/images/robot.png b/e107_plugins/log/images/robot.png
deleted file mode 100644
index 86048035d..000000000
Binary files a/e107_plugins/log/images/robot.png and /dev/null differ
diff --git a/e107_plugins/log/images/safari.png b/e107_plugins/log/images/safari.png
deleted file mode 100644
index 8cf3be981..000000000
Binary files a/e107_plugins/log/images/safari.png and /dev/null differ
diff --git a/e107_plugins/log/images/screen.png b/e107_plugins/log/images/screen.png
deleted file mode 100644
index 41ef1d054..000000000
Binary files a/e107_plugins/log/images/screen.png and /dev/null differ
diff --git a/e107_plugins/log/images/shiira.png b/e107_plugins/log/images/shiira.png
deleted file mode 100644
index fd08d30bf..000000000
Binary files a/e107_plugins/log/images/shiira.png and /dev/null differ
diff --git a/e107_plugins/log/images/sleipnir.png b/e107_plugins/log/images/sleipnir.png
deleted file mode 100644
index 425bfdd41..000000000
Binary files a/e107_plugins/log/images/sleipnir.png and /dev/null differ
diff --git a/e107_plugins/log/images/slimbrowser.png b/e107_plugins/log/images/slimbrowser.png
deleted file mode 100644
index b2fb5fee5..000000000
Binary files a/e107_plugins/log/images/slimbrowser.png and /dev/null differ
diff --git a/e107_plugins/log/images/spiders.png b/e107_plugins/log/images/spiders.png
deleted file mode 100644
index 9b591b59d..000000000
Binary files a/e107_plugins/log/images/spiders.png and /dev/null differ
diff --git a/e107_plugins/log/images/staroffice.png b/e107_plugins/log/images/staroffice.png
deleted file mode 100644
index 522d73925..000000000
Binary files a/e107_plugins/log/images/staroffice.png and /dev/null differ
diff --git a/e107_plugins/log/images/stats_16.png b/e107_plugins/log/images/stats_16.png
deleted file mode 100644
index 82e15c179..000000000
Binary files a/e107_plugins/log/images/stats_16.png and /dev/null differ
diff --git a/e107_plugins/log/images/stats_32.png b/e107_plugins/log/images/stats_32.png
deleted file mode 100644
index 7460cabfa..000000000
Binary files a/e107_plugins/log/images/stats_32.png and /dev/null differ
diff --git a/e107_plugins/log/images/sunos.png b/e107_plugins/log/images/sunos.png
deleted file mode 100644
index 07961dee9..000000000
Binary files a/e107_plugins/log/images/sunos.png and /dev/null differ
diff --git a/e107_plugins/log/images/sunrise.png b/e107_plugins/log/images/sunrise.png
deleted file mode 100644
index da42fe074..000000000
Binary files a/e107_plugins/log/images/sunrise.png and /dev/null differ
diff --git a/e107_plugins/log/images/unix.png b/e107_plugins/log/images/unix.png
deleted file mode 100644
index e8cd22a4d..000000000
Binary files a/e107_plugins/log/images/unix.png and /dev/null differ
diff --git a/e107_plugins/log/images/unknown.png b/e107_plugins/log/images/unknown.png
deleted file mode 100644
index 58188b93e..000000000
Binary files a/e107_plugins/log/images/unknown.png and /dev/null differ
diff --git a/e107_plugins/log/images/unspecified.png b/e107_plugins/log/images/unspecified.png
deleted file mode 100644
index 58188b93e..000000000
Binary files a/e107_plugins/log/images/unspecified.png and /dev/null differ
diff --git a/e107_plugins/log/images/voyager.png b/e107_plugins/log/images/voyager.png
deleted file mode 100644
index 724c1acc9..000000000
Binary files a/e107_plugins/log/images/voyager.png and /dev/null differ
diff --git a/e107_plugins/log/images/w3m.png b/e107_plugins/log/images/w3m.png
deleted file mode 100644
index ed3e89923..000000000
Binary files a/e107_plugins/log/images/w3m.png and /dev/null differ
diff --git a/e107_plugins/log/images/web%20indexing%20robot.png b/e107_plugins/log/images/web%20indexing%20robot.png
deleted file mode 100644
index 86048035d..000000000
Binary files a/e107_plugins/log/images/web%20indexing%20robot.png and /dev/null differ
diff --git a/e107_plugins/log/images/webtv.png b/e107_plugins/log/images/webtv.png
deleted file mode 100644
index c581a2b0c..000000000
Binary files a/e107_plugins/log/images/webtv.png and /dev/null differ
diff --git a/e107_plugins/log/images/windows.png b/e107_plugins/log/images/windows.png
deleted file mode 100644
index 763396217..000000000
Binary files a/e107_plugins/log/images/windows.png and /dev/null differ
diff --git a/e107_plugins/log/images/xiino.png b/e107_plugins/log/images/xiino.png
deleted file mode 100644
index c787c259c..000000000
Binary files a/e107_plugins/log/images/xiino.png and /dev/null differ
diff --git a/e107_plugins/log/js/awesomechart.js b/e107_plugins/log/js/awesomechart.js
deleted file mode 100644
index 24a34532d..000000000
--- a/e107_plugins/log/js/awesomechart.js
+++ /dev/null
@@ -1,1403 +0,0 @@
-/*
-* Copyright 2011 Georgios Migdos
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-Array.prototype.numericSortReverse = function(data){
- this.sort(function(a, b){
- return data[b] - data[a];
- });
-}
-
-Array.prototype.max = function() {
- var max = this[0];
- var len = this.length;
- for (var i = 1; i < len; i++){
- if (this[i] > max){
- max = this[i];
- }
- }
- return max;
-}
-
-Array.prototype.min = function() {
- var min = this[0];
- var len = this.length;
- for (var i = 1; i < len; i++){
- if (this[i] < min){
- min = this[i];
- }
- }
- return min;
-}
-
-function AwesomeChart(canvasElementId){
- var canvas = (typeof canvasElementId === 'string') ? document.getElementById(canvasElementId) : canvasElementId;
- this.ctx = canvas.getContext('2d');
- this.width = this.ctx.canvas.width;
- this.height = this.ctx.canvas.height;
-
- this.numberOfDecimals = 0;
-
- this.proportionalSizes = true;
- this.widthSizeFactor = this.width/400;
- this.heightSizeFactor = this.height/400;
-
- this.chartType = 'bar';
- this.randomColors = false;
-
- this.animate = false;
- this.animationFrames = 60;
-
- this.marginTop = 10;
- this.marginBottom = 10;
- this.marginLeft = 10;
- this.marginRight = 10;
-
- this.labelMargin = 10;
- this.dataValueMargin = 20;
- this.titleMargin = 10;
- this.yAxisLabelMargin = 5;
-
- this.data = new Array();
- this.labels = new Array();
- this.colors = new Array();
- this.title = null;
-
- this.backgroundFillStyle = 'rgba(255,255,255,0)';
- this.borderStrokeStyle = 'rgba(255,255,255,0)';
- this.borderWidth = 1.0;
-
- this.labelFillStyle = 'rgb(220, 36, 0)';
- this.labelFont = 'sans-serif';
- this.labelFontHeight = 12;
- this.labelFontStyle = '';
-
- this.dataValueFillStyle = '#333';
- this.dataValueFont = 'sans-serif';
- this.dataValueFontHeight = 15;
- this.dataValueFontStyle = '';
-
- this.titleFillStyle = '#333';
- this.titleFont = 'sans-serif';
- this.titleFontHeight = 16;
- this.titleFontStyle = 'bold';
-
- this.yAxisLabelFillStyle = '#333';
- this.yAxisLabelFont = 'sans-serif';
- this.yAxisLabelFontHeight = 10;
- this.yAxisLabelFontStyle = '';
-
- var lingrad = this.ctx.createLinearGradient(0,0,0,this.height);
- lingrad.addColorStop(0.2, '#fdfdfd');
- lingrad.addColorStop(0.8, '#ededed');
-
- this.chartBackgroundFillStyle = lingrad;
- this.chartBorderStrokeStyle = '#999';
- this.chartBorderLineWidth = 1;
- this.chartHorizontalLineStrokeStyle = '#999';
- this.chartHorizontalLineWidth = 1;
- this.chartVerticalLineStrokeStyle = '#999';
- this.chartVerticalLineWidth = 1;
-
- this.chartMarkerSize = 5;
-
- this.chartPointRadius = 4;
- this.chartPointFillStyle = 'rgb(150, 36, 0)';
-
- this.chartLineStrokeStyle = 'rgba(150, 36, 0, 0.5)';
- this.chartLineWidth = 2;
-
- this.barFillStyle = 'rgb(220, 36, 0)';
- this.barStrokeStyle = '#fff';
- this.barBorderWidth = 2.0;
- this.barShadowColor = 'rgba(0, 0, 0, 0.5)';
- this.barShadowBlur = 5;
- this.barShadowOffsetX = 3.0;
- this.barShadowOffsetY = 0.0;
-
- this.barHGap = 20;
- this.barVGap = 20;
-
- this.explosionOffset = 20;
-
- this.pieFillStyle = 'rgb(220, 36, 0)';
- this.pieStrokeStyle = '#fff';
- this.pieBorderWidth = 2.0;
- this.pieShadowColor = 'rgba(0, 0, 0, 0.5)';
- this.pieShadowBlur = 5;
- this.pieShadowOffsetX = 3.0;
- this.pieShadowOffsetY = 0.0;
-
- this.pieStart = 0;
- this.pieTotal = null;
-
- this.generateRandomColor = function(){
- var rgb = new Array();
- for(var i=0; i<3; i++){
- rgb.push(Math.ceil(Math.random()*150 + 50));
- }
- return 'rgb('+rgb.join(",")+')';
- }
-
- /*Set the chart's data in the format:
- *
- * {
- * "label-1": data-value-1,
- * "label-2": data-value-2,
- * "label-3": data-value-3,
- * ....
- * "label-N": data-value-N,
- * }
- *
- */
- this.setChartDataFromJSON = function(jsonObj){
- for(var p in jsonObj){
- this.labels.push(p);
- this.data.push(jsonObj[p]);
- }
- }
-
-
- this.draw = function(){
- var context = this.ctx;
- context.lineCap = 'round';
- var minFactor = Math.min(this.widthSizeFactor, this.heightSizeFactor);
-
- if(this.proportionalSizes){
- this.labelMargin = this.labelMargin * this.heightSizeFactor;
- this.dataValueMargin = this.dataValueMargin * this.heightSizeFactor;
- this.titleMargin = this.titleMargin * this.heightSizeFactor;
- this.yAxisLabelMargin = this.yAxisLabelMargin * this.heightSizeFactor;
-
- this.labelFontHeight = this.labelFontHeight * minFactor;
- this.dataValueFontHeight = this.dataValueFontHeight * minFactor;
- this.titleFontHeight = this.titleFontHeight * minFactor;
- this.yAxisLabelFontHeight = this.yAxisLabelFontHeight * minFactor;
-
- this.barHGap = this.barHGap * this.widthSizeFactor;
- this.barVGap = this.barHGap * this.heightSizeFactor;
- this.explosionOffset = this.explosionOffset * minFactor;
- }
-
- if(this.randomColors){
- for(var i=0; i
=0){
- context.textBaseline = 'bottom';
- context.fillText(this.labels[i], x + barWidth/2, barBottomY - barHeight - this.labelMargin, barWidth);
- }else{
- context.textBaseline = 'top';
- context.fillText(this.labels[i], x + barWidth/2, barBottomY - barHeight + this.labelMargin, barWidth);
- }
- }
-
- //Draw the data value:
-
- context.font = this.dataValueFontStyle + ' ' + this.dataValueFontHeight + 'px '+ this.dataValueFont;
- context.fillStyle = this.dataValueFillStyle;
- context.textAlign = 'center';
- if(di>=0){
- context.textBaseline = 'bottom';
- context.fillText(di, x + barWidth/2, barBottomY - barHeight - this.labelMargin - this.dataValueMargin, barWidth);
- }else{
- context.textBaseline = 'top';
- context.fillText(di, x + barWidth/2, barBottomY - barHeight + this.labelMargin + this.dataValueMargin, barWidth);
- }
-
-
- //Update x:
-
- x = x + barWidth + this.barHGap;
- }
- }
-
-
-
- this.animateBarChart = function() {
- var aw = this,
- numFrames = this.animationFrames,
- currentFrame = 0,
-
- maxData = this.data.max(),
- minData = this.data.min(),
-
- barMaxTopY = this.marginTop + this.labelMargin + this.labelFontHeight + this.dataValueMargin + this.dataValueFontHeight,
- barMinTopY = barBottomY = this.height - this.marginBottom;
-
- if(this.title!=null){
- barMaxTopY += this.titleFontHeight + this.titleMargin;
- }
-
- if(minData<0){
- barMinTopY = this.height - this.marginBottom - this.labelMargin - this.labelFontHeight - this.dataValueMargin - this.dataValueFontHeight;
-
- barBottomY = barMinTopY + ((this.height - this.marginBottom - barMaxTopY - this.labelMargin - this.labelFontHeight - this.dataValueMargin - this.dataValueFontHeight) * minData) / (Math.abs(minData)+maxData);
- }
-
- var chartAreaHeight = barMinTopY - barMaxTopY,
- changeOfMarginBottom = 0,
- changeOfMarginTop = 0;
-
- var belowZeroMaxBarHeight = 0;
- if(minData<0){
- var maxBarHeight = Math.max(Math.abs(barBottomY - barMaxTopY), Math.abs(barBottomY - barMinTopY)),
- maxBarAbsData = Math.max(Math.abs(minData), Math.abs(maxData));
- belowZeroMaxBarHeight = Math.abs(minData * maxBarHeight / maxBarAbsData + this.labelMargin + this.labelFontHeight);
- }
-
- this.marginBottom += belowZeroMaxBarHeight;
- if(this.title!=null){
- this.titleMargin += chartAreaHeight - belowZeroMaxBarHeight;
- }else{
- this.marginTop += chartAreaHeight - belowZeroMaxBarHeight;
- }
- changeOfMarginBottom = belowZeroMaxBarHeight / numFrames;
- changeOfMarginTop = (chartAreaHeight - belowZeroMaxBarHeight) / numFrames;
-
- var updateBarChart = function() {
- if(currentFrame++ < numFrames) {
-
- aw.marginBottom -= changeOfMarginBottom;
-
- if(aw.title!=null){
- aw.titleMargin -= changeOfMarginTop;
- }else{
- aw.marginTop -= changeOfMarginTop;
- }
-
- aw.ctx.clearRect(0, 0, aw.width, aw.height);
- aw.drawBarChart();
- aw.drawTitleAndBorders();
-
- // Standard
- if (typeof(window.requestAnimationFrame) == 'function') {
- window.requestAnimationFrame(updateBarChart);
-
- // IE 10+
- } else if (typeof(window.msRequestAnimationFrame) == 'function') {
- window.msRequestAnimationFrame(updateBarChart);
-
- // Chrome
- } else if (typeof(window.webkitRequestAnimationFrame) == 'function') {
- window.webkitRequestAnimationFrame(updateBarChart);
-
- // Firefox
- } else if (window.mozRequestAnimationFrame) { // Seems rather slow in FF6 - so disabled
- window.mozRequestAnimationFrame(updateBarChart);
-
- // Default fallback to setTimeout
- } else {
- setTimeout(updateBarChart, 16.6666666);
- }
- }
- }
-
- updateBarChart();
-
- }
-
-
-
- this.drawVerticalBarChart = function(){
- var context = this.ctx;
-
- context.save();
- context.translate(this.width/2, this.height/2);
- context.rotate(Math.PI/2);
- context.translate(-this.width/2, -this.height/2);
-
-
-
- //Calculate bar size:
-
- var n = this.data.length;
- var maxData = this.data.max();
- var minData = this.data.min();
-
- var marginLeft = this.marginLeft;
- if(this.title!=null){
- marginLeft += this.titleFontHeight + this.titleMargin;
- }
-
- var barWidth = (this.width - marginLeft - this.marginRight - (n-1) * this.barHGap) / n;
-
- context.font = this.labelFontStyle + ' ' + this.labelFontHeight + 'px '+ this.labelFont;
- var maxLabelWidth = 0;
- var labelWidth = 0;
- for(var i=0; imaxLabelWidth){
- maxLabelWidth = labelWidth;
- }
- }
-
- context.font = this.dataValueFontStyle + ' ' + this.dataValueFontHeight + 'px '+ this.dataValueFont;
- var maxDataValueWidth = 0;
- var dataValueWidth = 0;
- for(var i=0; imaxDataValueWidth){
- maxDataValueWidth = dataValueWidth;
- }
- }
-
- var barMaxTopY = this.marginTop + Math.max( (this.labelMargin + maxLabelWidth), (this.dataValueMargin + maxDataValueWidth) );
-
- var barMinTopY = this.height - this.marginBottom;
-
- var barBottomY = this.height - this.marginBottom;
-
- if(minData<0){
-
- barMinTopY = this.height - this.marginBottom - this.labelMargin - this.labelFontHeight - this.dataValueMargin - this.dataValueFontHeight;
-
- barBottomY = barMinTopY + ((this.height - this.marginBottom - barMaxTopY - this.labelMargin - this.labelFontHeight - this.dataValueMargin - this.dataValueFontHeight) * minData) / (Math.abs(minData)+maxData);
-
- }
-
-
- var maxBarHeight = Math.max(Math.abs(barBottomY - barMaxTopY), Math.abs(barBottomY - barMinTopY));
- var maxBarAbsData = Math.max(Math.abs(minData), Math.abs(maxData));
-
- var x = marginLeft;
- var y = barBottomY;
- var barHeight = 0;
-
- var di = 0;
-
- for(var i=0; i=0){
- context.textAlign = 'left';
- context.fillText(this.labels[i], this.labelMargin, 0);
- }else{
- context.textAlign = 'right';
- context.fillText(this.labels[i], -this.labelMargin, 0);
- }
- }
-
- //Draw the data value:
-
- context.font = this.dataValueFontStyle + ' ' + this.dataValueFontHeight + 'px '+ this.dataValueFont;
- context.fillStyle = this.dataValueFillStyle;
- context.textBaseline = 'bottom';
- if(di>=0){
- context.textAlign = 'left';
- context.fillText(di, this.labelMargin, 0);
- }else{
- context.textAlign = 'right';
- context.fillText(di, -this.labelMargin, 0);
- }
-
- context.restore();
-
- //Update x:
-
- x = x + barWidth + this.barHGap;
- }
-
-
-
- context.restore();
-
- }
-
-
-
- this.animateVerticalBarChart = function() {
- var aw = this,
- numFrames = this.animationFrames,
- currentFrame = 0,
-
- maxData = this.data.max(),
- minData = this.data.min(),
- dataLen = this.data.length,
-
- context = this.ctx,
-
- marginLeft = this.marginLeft
- marginTop = this.marginTop
- marginTopCurrent = 0;
-
-
- if(this.title!=null){
- marginLeft += this.titleFontHeight + this.titleMargin;
- }
-
- var barWidth = (this.width - marginLeft - this.marginRight - (dataLen-1) * this.barHGap) / dataLen;
-
- context.font = this.labelFontStyle + ' ' + this.labelFontHeight + 'px '+ this.labelFont;
- var maxLabelWidth = 0;
- var labelWidth = 0;
- for(var i=0; imaxLabelWidth){
- maxLabelWidth = labelWidth;
- }
- }
-
- context.font = this.dataValueFontStyle + ' ' + this.dataValueFontHeight + 'px '+ this.dataValueFont;
- var maxDataValueWidth = 0;
- var dataValueWidth = 0;
- for(var i=0; imaxDataValueWidth){
- maxDataValueWidth = dataValueWidth;
- }
- }
-
- var barMaxTopY = this.marginTop + Math.max( (this.labelMargin + maxLabelWidth), (this.dataValueMargin + maxDataValueWidth) );
-
- var barMinTopY = this.height - this.marginBottom;
-
- var barBottomY = this.height - this.marginBottom;
-
- if(minData<0){
-
- barMinTopY = this.height - this.marginBottom - this.labelMargin - this.labelFontHeight - this.dataValueMargin - this.dataValueFontHeight;
-
- barBottomY = barMinTopY + ((this.height - this.marginBottom - barMaxTopY - this.labelMargin - this.labelFontHeight - this.dataValueMargin - this.dataValueFontHeight) * minData) / (Math.abs(minData)+maxData);
-
- }
-
-
- var maxBarHeight = Math.max(Math.abs(barBottomY - barMaxTopY), Math.abs(barBottomY - barMinTopY));
- var maxBarAbsData = Math.max(Math.abs(minData), Math.abs(maxData));
-
-
- var belowZeroMaxBarHeight = 0;
- if(minData<0){
- belowZeroMaxBarHeight = Math.abs(minData * maxBarHeight / maxBarAbsData);
- }
-
- var chartAreaHeight = maxData * maxBarHeight / maxBarAbsData + belowZeroMaxBarHeight,
- changeOfMarginBottom = 0,
- changeOfMarginTop = 0;
-
- this.marginBottom += belowZeroMaxBarHeight;
- this.marginTop += chartAreaHeight - belowZeroMaxBarHeight;
- changeOfMarginBottom = belowZeroMaxBarHeight / numFrames;
- changeOfMarginTop = (chartAreaHeight - belowZeroMaxBarHeight) / numFrames;
-
-
-
-
- var updateVerticalBarChart = function() {
- if(currentFrame++ < numFrames) {
-
- aw.marginBottom -= changeOfMarginBottom;
- aw.marginTop -= changeOfMarginTop;
-
- aw.ctx.clearRect(0, 0, aw.width, aw.height);
- aw.drawVerticalBarChart();
-
- marginTopCurrent = aw.marginTop;
- aw.marginTop = marginTop;
- aw.drawTitleAndBorders();
- aw.marginTop = marginTopCurrent;
-
- // Standard
- if (typeof(window.requestAnimationFrame) == 'function') {
- window.requestAnimationFrame(updateVerticalBarChart);
-
- // IE 10+
- } else if (typeof(window.msRequestAnimationFrame) == 'function') {
- window.msRequestAnimationFrame(updateVerticalBarChart);
-
- // Chrome
- } else if (typeof(window.webkitRequestAnimationFrame) == 'function') {
- window.webkitRequestAnimationFrame(updateVerticalBarChart);
-
- // Firefox
- } else if (window.mozRequestAnimationFrame) { // Seems rather slow in FF6 - so disabled
- window.mozRequestAnimationFrame(updateVerticalBarChart);
-
- // Default fallback to setTimeout
- } else {
- setTimeout(updateVerticalBarChart, 16.6666666);
- }
- }
- }
-
-
-
-
- updateVerticalBarChart();
-
- }
-
-
-
- this.drawPieChart = function(ring){
- var context = this.ctx;
- context.lineWidth = this.pieBorderWidth;
-
- var dataSum = 0,
- dataSumForStartAngle = 0,
- dataLen = this.data.length;
-
- for (var i=0; imaxLabelWidth){
- maxLabelWidth = labelWidth;
- }
- }
-
- radius = radius - maxLabelWidth - this.labelMargin;
-
- var startAngle = this.pieStart* doublePI / dataSumForStartAngle;
- var currentAngle = startAngle;
- var endAngle = 0;
- var incAngleBy = 0;
-
- for(var i=0; iMath.PI/2) && (mAngle<=3*(Math.PI/2)) ){
- var translateXBy = radius + this.labelMargin + context.measureText(this.labels[i]).width / 2;
- context.translate(translateXBy, 0);
- context.rotate(Math.PI);
- context.translate(-translateXBy, 0);
- }
- context.textBaseline = 'middle';
- context.fillText(this.labels[i], radius+this.labelMargin, 0);
- }
-
- context.restore();
- currentAngle = endAngle;
- }
- }
-
-
-
- this.drawExplodedPieChart = function(){
- var context = this.ctx;
- context.lineWidth = this.pieBorderWidth;
-
- var dataSum = 0,
- dataSumForStartAngle = 0,
- dataLen = this.data.length;
-
- for (var i=0; imaxLabelWidth){
- maxLabelWidth = labelWidth;
- }
- }
-
- radius = radius - maxLabelWidth - this.labelMargin;
-
- var currentAngle = this.pieStart* doublePI / dataSumForStartAngle;
- var endAngle = 0;
- var incAngleBy = 0;
- var halfAngle = 0;
- var mAngle = 0;
- for(var i=0; iMath.PI/2) && (mAngle<=3*(Math.PI/2)) ){
- var translateXBy = radius + this.labelMargin + context.measureText(this.labels[i]).width / 2;
- context.translate(translateXBy, 0);
- context.rotate(Math.PI);
- context.translate(-translateXBy, 0);
- }
- context.textBaseline = 'middle';
- context.fillText(this.labels[i], radius+this.labelMargin, 0);
- }
-
-
- // Restore the context:
-
- context.restore();
- currentAngle = endAngle;
-
- }
-
- }
-
-
-
- this.animatePieChart = function(pieType){
- var dataSum = 0,
- pieTotalReal = this.pieTotal,
- aw = this,
- numFrames = this.animationFrames,
- currentFrame = 0,
- pieAreaWidth = this.width - this.marginLeft - this.marginRight,
- pieAreaHeight = this.height - this.marginTop - this.marginBottom,
- marginTop = this.marginTop,
- marginLeft = this.marginLeft;
-
- if(this.title){
- pieAreaHeight = pieAreaHeight - this.titleFontHeight - this.titleMargin;
- marginTop += this.titleFontHeight + this.titleMargin;
- }
-
- for(var i=0; imaxYAxisLabelWidth){
- maxYAxisLabelWidth = yAxisLabelWidth;
- }
- }
-
- var perCentMaxWidth = context.measureText("100%").width;
-
- // Calculate the chart size and position:
-
- var chartWidth = this.width - this.marginLeft - this.marginRight - 2*this.chartMarkerSize - maxYAxisLabelWidth - perCentMaxWidth - 2*this.yAxisLabelMargin;
- var chartHeight = this.height - this.marginTop - this.marginBottom;
-
- var chartTopLeftX = this.marginLeft + this.chartMarkerSize + maxYAxisLabelWidth + this.yAxisLabelMargin;
- var chartTopLeftY = this.marginTop;
-
-
- if(this.title){
- chartHeight -= this.titleFontHeight + this.titleMargin;
- chartTopLeftY += this.titleFontHeight + this.titleMargin;
- }
-
-
- // Draw the chart's background:
-
- context.save();
-
- context.translate(chartTopLeftX, chartTopLeftY);
-
- context.fillStyle = this.chartBackgroundFillStyle;
- context.fillRect(0,0,chartWidth,chartHeight);
-
-
- // Draw the markers, horizontal lines, and axis' labels:
-
- var yStep = chartHeight / 10;
- var lineY = 0;
-
- context.lineWidth = this.chartHorizontalLineWidth;
- context.font = this.yAxisLabelFontStyle + ' ' + this.yAxisLabelFontHeight + 'px '+ this.yAxisLabelFont;
-
- for(var i=0; i<=10; i++){
- lineY = i*yStep;
-
- if( i>0 && i<10){
-
- context.strokeStyle = this.chartHorizontalLineStrokeStyle;
- context.beginPath();
- context.moveTo(0,lineY);
- context.lineTo(chartWidth,lineY);
- context.stroke();
-
- }
-
- context.strokeStyle = this.chartBorderStrokeStyle;
- context.beginPath();
- context.moveTo(-this.chartMarkerSize,lineY);
- context.lineTo(0,lineY);
- context.stroke();
-
- context.beginPath();
- context.moveTo(chartWidth,lineY);
- context.lineTo(chartWidth+this.chartMarkerSize,lineY);
- context.stroke();
-
- context.fillStyle = this.yAxisLabelFillStyle;
- context.textAlign = 'right';
- context.textBaseline = 'middle';
- context.fillText(yAxisValues[10-i], -this.chartMarkerSize-this.yAxisLabelMargin, lineY);
-
- context.textAlign = 'left';
- context.fillText( ((10-i)*10)+'%', chartWidth+this.chartMarkerSize+this.yAxisLabelMargin, lineY);
- }
-
- // Draw the bars:
-
- context.save();
-
- context.translate(0, chartHeight);
-
- var barWidth = (chartWidth-2*this.barHGap) / n;
- var barHeight = 0;
-
- var halfBarWidth = barWidth/2;
-
- var y = 0;
- var x = this.barHGap;
- var x1 = x;
- var y1 = 0;
- var x2 = 0;
- var y2 = 0;
-
- for(var i=0; i=0){
- context.textBaseline = 'bottom';
- context.fillText(this.labels[indices[i]], x + halfBarWidth, - barHeight - this.labelMargin, barWidth);
- }else{
- context.textBaseline = 'top';
- context.fillText(this.labels[indices[i]], x + halfBarWidth, - barHeight + this.labelMargin, barWidth);
- }
- }
-
- // Draw the data value:
-
- context.font = this.dataValueFontStyle + ' ' + this.dataValueFontHeight + 'px '+ this.dataValueFont;
- context.fillStyle = this.dataValueFillStyle;
- context.textAlign = 'center';
- if(this.data[indices[i]]>=0){
- context.textBaseline = 'bottom';
- context.fillText(this.data[indices[i]], x + halfBarWidth, - barHeight - this.labelMargin - this.dataValueMargin, barWidth);
- }else{
- context.textBaseline = 'top';
- context.fillText(this.data[indices[i]], x + halfBarWidth, - barHeight + this.labelMargin + this.dataValueMargin, barWidth);
- }
-
-
- // Update x:
-
- x = x + barWidth;
-
- }
-
- // Draw the points:
-
- x = this.barHGap;
- x1 = x;
- y1 = 0;
- x2 = 0;
- y2 = 0;
-
- context.fillStyle = this.chartPointFillStyle;
- context.beginPath();
- context.arc(x1, y1, this.chartPointRadius, 0, 2*Math.PI, false);
- context.fill();
-
- for(var i=0; iclick here to run update routine.");
-define("ADSTAT_L3", "Statistic Logging");
-define("ADSTAT_L4", "You do not have permission to view this page.");
-define("ADSTAT_L5", "The features on this page have been disabled.");
-define("ADSTAT_L6", "Site Statistics");
-define("ADSTAT_L7", "Statistics for this type are not being gathered.");
-define("ADSTAT_L8", "Today's Stats");
-define("ADSTAT_L9", "All-time Stats");
-define("ADSTAT_L10", "Daily Stats");
-define("ADSTAT_L11", "Monthly Stats");
-define("ADSTAT_L12", "Browser Stats");
-define("ADSTAT_L13", "Operating System Stats");
-define("ADSTAT_L14", "Domain Stats");
-define("ADSTAT_L15", "Screen Resolution / Color Depth Stats");
-define("ADSTAT_L16", "Referral Stats");
-define("ADSTAT_L17", "Search String Stats");
-define("ADSTAT_L18", "Recent Visitors");
-define("ADSTAT_L19", "Page");
-define("ADSTAT_L20", "Visits Today");
-define("ADSTAT_L21", "Total");
-define("ADSTAT_L22", "Unique");
-define("ADSTAT_L23", "Total Visits");
-define("ADSTAT_L24", "Total Unique Visits");
-define("ADSTAT_L25", "No statistics available.");
-define("ADSTAT_L26", "Browser");
-define("ADSTAT_L27", "Operating System");
-define("ADSTAT_L28", "Countries / Domains");
-define("ADSTAT_L29", "Screen Resolution");
-define("ADSTAT_L30", "Site Referrals");
-define("ADSTAT_L31", "Search Engine Query Strings");
-define("ADSTAT_L32", "Referred from");
-define("ADSTAT_L33", "Visits in last");
-define("ADSTAT_L34", "Visits"); // Used for page display
-define("ADSTAT_L35", "Unique visits in last");
-define("ADSTAT_L36", "days by page");
-define("ADSTAT_L37", "Visits by month");
-define("ADSTAT_L38", "Unique visits by month");
-define("ADSTAT_L39", "remove this entry");
-define("ADSTAT_L40", "days");
-//define("ADSTAT_L41", "Error"); // FIXME GENERIC
-define("ADSTAT_L42", "No monthly stats yet.");
-
-define("ADSTAT_L43", "Today's page errors");
-define("ADSTAT_L44", "All-time page errors");
-define("ADSTAT_L45", "Stats deleted for: ");
-define("ADSTAT_L46", "Note: any stats for today will not be deleted");
-define("ADSTAT_L47", "No stats found for: ");
-define("ADSTAT_L48", "sort by total");
-define("ADSTAT_L49", "sort alphabetically");
-define("ADSTAT_L50", "All-time stats");
-define("ADSTAT_L51", "Current month stats");
-define("ADSTAT_L52", "Previous month stats");
-define("ADSTAT_L53", "Information");
-// define("ADSTAT_L54", "");
-// define("ADSTAT_L55", "");
-// define("ADSTAT_L56", "");
-// define("ADSTAT_L57", "");
-// define("ADSTAT_L58", "");
-// define("ADSTAT_L59", "");
-// define("ADSTAT_L60", "");
-
-
diff --git a/e107_plugins/log/languages/English_admin.php b/e107_plugins/log/languages/English_admin.php
deleted file mode 100644
index 90c7c020c..000000000
--- a/e107_plugins/log/languages/English_admin.php
+++ /dev/null
@@ -1,105 +0,0 @@
-You must set the permissions of the e107_plugins/log/logs folder to 777 (chmod 777)");
-define("ADSTAT_LAN_3", "Statistic Logging");
-define("ADSTAT_LAN_4", "Activate statistic logging");
-define("ADSTAT_LAN_5", "Statistic types");
-define("ADSTAT_LAN_6", "Browsers");
-define("ADSTAT_LAN_7", "Operating Systems");
-define("ADSTAT_LAN_8", "Screen resolutions / depths");
-define("ADSTAT_LAN_9", "Countries/domains visited from");
-define("ADSTAT_LAN_10", "Referrers");
-define("ADSTAT_LAN_11", "Search queries");
-define("ADSTAT_LAN_12", "Reset stats");
-define("ADSTAT_LAN_13", "This will erase the all-time stats - careful! Deletes stats to the end of yesterday. There is a separate menu option to delete selected historical data"); // TODO: Condense this help field (minimize)
-define("ADSTAT_LAN_14", "Page counts");
-//define("ADSTAT_LAN_15", "Update Statistic Settings");
-define("ADSTAT_LAN_16", "Site Statistic Settings");
-//define("ADSTAT_LAN_17", "Statistic settings updated");
-define("ADSTAT_LAN_18", "Allow access to main statistics page to ...");
-define("ADSTAT_LAN_19", "Recent visitors");
-define("ADSTAT_LAN_20", "Count admin visits");
-define("ADSTAT_LAN_21", "Maximum records to display on stats page");
-define("ADSTAT_LAN_22", "Run update routine");
-define("ADSTAT_LAN_23", "logs from a previous version of e107 have been detected, update them here");
-define("ADSTAT_LAN_24", "Go to update script");
-//define("ADSTAT_LAN_25", "Selected stats reset");
-define("ADSTAT_LAN_26", "Remove page entries");
-define("ADSTAT_LAN_27", "If your stats have incorrect pages, you can remove them here");
-define("ADSTAT_LAN_28", "Open page");
-define("ADSTAT_LAN_29", "Page Name");
-define("ADSTAT_LAN_30", "Check to remove");
-define("ADSTAT_LAN_31", "Remove selected pages");
-define("ADSTAT_LAN_32", "Page Tidy");
-// define("ADSTAT_LAN_33", "Configure Statistics Logging"); see English_global.php
-// define("ADSTAT_LAN_34", "Site Stats");
-define ('ADSTAT_LAN_35', 'Options');
-define ('ADSTAT_LAN_36', 'Data Export');
-//define ('ADSTAT_LAN_37', 'Create export file');
-define ('ADSTAT_LAN_38', "You must set the e107_plugins/log/logs folder to be writable");
-define ('ADSTAT_LAN_39', 'Stats Logging Functions');
-define ('ADSTAT_LAN_40', 'Export log data');
-define ('ADSTAT_LAN_41', 'Date selection');
-define ('ADSTAT_LAN_42', 'Single Day');
-define ('ADSTAT_LAN_43', 'Daily for a month');
-define ('ADSTAT_LAN_44', 'Monthly for a year');
-define ('ADSTAT_LAN_45', 'All-time');
-define ('ADSTAT_LAN_46', 'Date:');
-define ('ADSTAT_LAN_47', 'Invalid date chosen');
-define ('ADSTAT_LAN_48', 'Monthly and All-time');
-define ('ADSTAT_LAN_49', 'All-time Only');
-define ('ADSTAT_LAN_50', 'None');
-define ('ADSTAT_LAN_51', 'Output Data');
-define ('ADSTAT_LAN_52', 'Page Data');
-define ('ADSTAT_LAN_53', 'No selection possible');
-define ('ADSTAT_LAN_54', 'Invalid type selection');
-define ('ADSTAT_LAN_55', 'Single quote');
-define ('ADSTAT_LAN_56', 'Double quote');
-define ('ADSTAT_LAN_57', 'Comma');
-define ('ADSTAT_LAN_58', 'Pipe (|)');
-define ('ADSTAT_LAN_59', 'CSV separator, quotes');
-define ('ADSTAT_LAN_60', 'Strip site address from URLs');
-define ('ADSTAT_LAN_61', '(if checked, just gives page reference)');
-define ('ADSTAT_LAN_62', 'All-time (detailed)');
-define ('ADSTAT_LAN_63', 'Available Datasets');
-define ('ADSTAT_LAN_64', 'Database records found:');
-define ('ADSTAT_LAN_65', 'DB filter string:');
-define ('ADSTAT_LAN_66', 'Show Datasets');
-define ('ADSTAT_LAN_67', 'Generate a CSV (Comma Separated Variable) file of historical statistics which meets the specified criteria');
-define ('ADSTAT_LAN_68', 'Show the statistics database entries which actually exist and meet the selection criteria');
-define ('ADSTAT_LAN_69', 'Delete historical data');
-define ('ADSTAT_LAN_70', 'Delete data older than:');
-define ('ADSTAT_LAN_71', 'Delete Data');
-define ('ADSTAT_LAN_72', 'Confirm deletion of data older than first day of:');
-//define ('ADSTAT_LAN_73', 'Confirm');
-define ('ADSTAT_LAN_74', '(List of data entries which will be deleted below)');
-define ('ADSTAT_LAN_75', 'Records for deletion');
-define ('ADSTAT_LAN_76', 'Caution! Once deleted, the data cannot be recovered. Backup or export your database first');
-define ('ADSTAT_LAN_77', 'Records deleted:');
-define ('ADSTAT_LAN_78', 'Show previous month as well as current month for non-page access stats');
-define ('ADSTAT_LAN_79', 'Only used if monthly stats collected');
-define ('ADSTAT_LAN_80', 'The following pages were deleted:');
-define ('ADSTAT_LAN_81', 'Statistics cleared:');
-define ('ADSTAT_LAN_82', 'Following values now set:');
-define ('ADSTAT_LAN_83', 'Following log ID entries removed:');
-define ('ADSTAT_LAN_84', 'This proceedure will overwrite the log statistic summaries in your database. (raw log files are left unchanged) Once replaced, the data cannot be recovered. Please backup or export your database first');
-define ('ADSTAT_LAN_85', '[x] log files have been found. Click the button below to process these files.');
-define ('ADSTAT_LAN_86', 'Total Hits');
-define ('ADSTAT_LAN_87', 'Rebuild Statistic Summaries');
-define ('ADSTAT_LAN_88', 'Rebuild Stats');
-define ('ADSTAT_LAN_89', 'Rebuild');
-define ('ADSTAT_LAN_90', "Data saved to database with id: [x]");
-define ('ADSTAT_LAN_91', "Couldn't save data to database with id: [x]");
-
-
diff --git a/e107_plugins/log/languages/English_admin_log.php b/e107_plugins/log/languages/English_admin_log.php
deleted file mode 100644
index 2e5ff840d..000000000
--- a/e107_plugins/log/languages/English_admin_log.php
+++ /dev/null
@@ -1,100 +0,0 @@
-You must set the permissions of the e107_plugins/log/logs folder to 777 (chmod 777)");
-define("ADSTAT_L3", "Statistic Logging");
-define("ADSTAT_L4", "Activate statistic logging");
-define("ADSTAT_L5", "Statistic types");
-define("ADSTAT_L6", "Browsers");
-define("ADSTAT_L7", "Operating Systems");
-define("ADSTAT_L8", "Screen resolutions / depths");
-define("ADSTAT_L9", "Countries/domains visited from");
-define("ADSTAT_L10", "Referrers");
-define("ADSTAT_L11", "Search queries");
-define("ADSTAT_L12", "Reset stats");
-define("ADSTAT_L13", "This will erase the all-time stats - careful! Deletes stats to the end of yesterday. There is a separate menu option to delete selected historical data"); // TODO: Condense this help field (minimize)
-define("ADSTAT_L14", "Page counts");
-//define("ADSTAT_L15", "Update Statistic Settings");
-define("ADSTAT_L16", "Site Statistic Settings");
-//define("ADSTAT_L17", "Statistic settings updated");
-define("ADSTAT_L18", "Allow access to main statistics page to ...");
-define("ADSTAT_L19", "Recent visitors");
-define("ADSTAT_L20", "Count admin visits");
-define("ADSTAT_L21", "Maximum records to display on stats page");
-define("ADSTAT_L22", "Run update routine");
-define("ADSTAT_L23", "logs from a previous version of e107 have been detected, update them here");
-define("ADSTAT_L24", "Go to update script");
-//define("ADSTAT_L25", "Selected stats reset");
-define("ADSTAT_L26", "Remove page entries");
-define("ADSTAT_L27", "If your stats have incorrect pages, you can remove them here");
-define("ADSTAT_L28", "Open page");
-define("ADSTAT_L29", "Page Name");
-define("ADSTAT_L30", "Check to remove");
-define("ADSTAT_L31", "Remove selected pages");
-define("ADSTAT_L32", "Page Tidy");
-// define("ADSTAT_L33", "Configure Statistics Logging"); see English_global.php
-// define("ADSTAT_L34", "Site Stats");
-define ('ADSTAT_L35', 'Options');
-define ('ADSTAT_L36', 'Data Export');
-//define ('ADSTAT_L37', 'Create export file');
-define ('ADSTAT_L38', "You must set the e107_plugins/log/logs folder to be writable");
-define ('ADSTAT_L39', 'Stats Logging Functions');
-define ('ADSTAT_L40', 'Export log data');
-define ('ADSTAT_L41', 'Date selection');
-define ('ADSTAT_L42', 'Single Day');
-define ('ADSTAT_L43', 'Daily for a month');
-define ('ADSTAT_L44', 'Monthly for a year');
-define ('ADSTAT_L45', 'All-time');
-define ('ADSTAT_L46', 'Date:');
-define ('ADSTAT_L47', 'Invalid date chosen');
-define ('ADSTAT_L48', 'Monthly and All-time');
-define ('ADSTAT_L49', 'All-time Only');
-define ('ADSTAT_L50', 'None');
-define ('ADSTAT_L51', 'Output Data');
-define ('ADSTAT_L52', 'Page Data');
-define ('ADSTAT_L53', 'No selection possible');
-define ('ADSTAT_L54', 'Invalid type selection');
-define ('ADSTAT_L55', 'Single quote');
-define ('ADSTAT_L56', 'Double quote');
-define ('ADSTAT_L57', 'Comma');
-define ('ADSTAT_L58', 'Pipe (|)');
-define ('ADSTAT_L59', 'CSV separator, quotes');
-define ('ADSTAT_L60', 'Strip site address from URLs');
-define ('ADSTAT_L61', '(if checked, just gives page reference)');
-define ('ADSTAT_L62', 'All-time (detailed)');
-define ('ADSTAT_L63', 'Available Datasets');
-define ('ADSTAT_L64', 'Database records found:');
-define ('ADSTAT_L65', 'DB filter string:');
-define ('ADSTAT_L66', 'Show Datasets');
-define ('ADSTAT_L67', 'Generate a CSV (Comma Separated Variable) file of historical statistics which meets the specified criteria');
-define ('ADSTAT_L68', 'Show the statistics database entries which actually exist and meet the selection criteria');
-define ('ADSTAT_L69', 'Delete historical data');
-define ('ADSTAT_L70', 'Delete data older than:');
-define ('ADSTAT_L71', 'Delete Data');
-define ('ADSTAT_L72', 'Confirm deletion of data older than first day of:');
-//define ('ADSTAT_L73', 'Confirm');
-define ('ADSTAT_L74', '(List of data entries which will be deleted below)');
-define ('ADSTAT_L75', 'Records for deletion');
-define ('ADSTAT_L76', 'Caution! Once deleted, the data cannot be recovered. Backup or export your database first');
-define ('ADSTAT_L77', 'Records deleted:');
-define ('ADSTAT_L78', 'Show previous month as well as current month for non-page access stats');
-define ('ADSTAT_L79', 'Only used if monthly stats collected');
-define ('ADSTAT_L80', 'The following pages were deleted:');
-define ('ADSTAT_L81', 'Statistics cleared:');
-define ('ADSTAT_L82', 'Following values now set:');
-define ('ADSTAT_L83', 'Following log ID entries removed:');
-define ('ADSTAT_L84', '');
-define ('ADSTAT_L85', '');
-
-
-
diff --git a/e107_plugins/log/languages/English_global.php b/e107_plugins/log/languages/English_global.php
deleted file mode 100644
index 7c1ce3b3d..000000000
--- a/e107_plugins/log/languages/English_global.php
+++ /dev/null
@@ -1,9 +0,0 @@
-
-Caution! Once deleted, this data cannot be recovered. Back up and/or export the data you may require first.");
-define("LAN_STAT_HELP_03","This option allows you to delete the data relating to a specific site page.");
-define("LAN_STAT_HELP_04","This option allows export of statistics data in CSV format. This can be imported into many other applications for
-detailed analysis. Refer to the wiki page on the stats logging plugin for more detail on file formats etc");
-define("LAN_STAT_HELP_05","Enable Stats Logging
No logging takes place if disabled
-Stats Page Access
-Determines who can see the site statistics
-Count Admin Visits
-Frequent visits by the admins can distort site statistics, so you can exclude them
-Maximum records to display...
-Sets the number of \"recent visitors\" retained
-Statistic Types
-Determines which information is logged. Recording monthly data will take up more database space, and gives better visibility.
-If monthly statistics are being collected, you can set whether just the current month, or current month and previous month, are displayed
-Reset Stats
-Clears the selected all-time data (up to the end of yesterday) to zero. To delete today\"s data as well, delete the log*.php files in the log/logs plugin directory
-");
-define("LAN_STAT_HELP_06","");
-
diff --git a/e107_plugins/log/log.php b/e107_plugins/log/log.php
deleted file mode 100644
index 0df20f66a..000000000
--- a/e107_plugins/log/log.php
+++ /dev/null
@@ -1,310 +0,0 @@
-' );)";
- referer= ref
- color= colord
- eself= eself
- res= res
- err_direct - optional error flag
- err_referer - referrer if came via error page
- qry = 1 to log query part as well
-
-// Normally the file is 'silent' - if any errors occur, any error message appears in the page header.
-*/
-//error_reporting(0);
-// error_reporting(E_ALL);
-define('e_MINIMAL',true);
-require_once(__DIR__.'/../../class2.php'); // More secure to include it.
-header('Cache-Control: no-cache, must-revalidate'); // See if this discourages browser caching
-header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
-
-define('LOGSTATS_DEBUG', false);
-
-// @example url: e107_plugins/log/log.php?lv=cmVmZXJlcj1odHRwJTNBLy9sb2NhbGhvc3QlM0E4MDgwL2UxMDdfMi4wL3N0YXRzJmNvbG91cj0yNCZlc2VsZj1odHRwJTNBLy9sb2NhbGhvc3QlM0E4MDgwL2UxMDdfMi4wL2UxMDdfcGx1Z2lucy9sb2cvc3RhdHMucGhwJTNGMiZyZXM9MTkyMHgxMjAw
-
-if(LOGSTATS_DEBUG === true)
-{
- echo "Debug is Active";
-}
-
-if (!vartrue($pref['statActivate']))
-{
- if(LOGSTATS_DEBUG === true)
- {
- echo "Stats log is inactive";
- }
-
- exit();
-}
-
-
-
-//print_r(base64_decode($_GET['lv']));
-define('LOGSTATS_INIT', true);
-
-// Array of page names which should have individual query values recorded.
-// The top level array index is the page name.
-// If the top level value is an array, it must be an array of query string beginnings to match.
-$pageUnique = array('page' => 1, 'content' => array('content'));
-
-//$logVals = urldecode(base64_decode($_SERVER['QUERY_STRING']));
-//$logVals = urldecode(base64_decode($_GET['lv']));
-
-
-// --------------- Reworked for v2.x ------------------------
-
-
-$logVals = base64_decode($_GET['lv']);
-$logVals = filter_var($logVals, FILTER_SANITIZE_URL);
-
-$logVals .= "&ip=".USERIP;
-$logVals .= "&iphost=". @gethostbyaddr(USERIP);
-$logVals .= "&lan=".e_LAN;
-$logVals .= "&agent=".filter_var($_SERVER['HTTP_USER_AGENT'],FILTER_SANITIZE_STRING);
-
-parse_str($logVals, $vals);
-
-$vals['referer'] = urldecode($vals['referer']);
-$vals['eself'] = urldecode($vals['eself']);
-
-if(empty($_SESSION['log_userLoggedPages']) || !in_array($vals['eself'],$_SESSION['log_userLoggedPages']))
-{
- $_SESSION['log_userLoggedPages'][] = $vals['eself'];
- $logVals .= "&unique=1";
-}
-else
-{
- $logVals .= "&unique=0";
-}
-
-
-$logVals = str_replace('%3A',':',$logVals); // make the URLs a bit cleaner, while keeping any urlqueries encoded.
-
-$lg = e107::getLog();
-$lg->addDebug(print_r($logVals, true));
-$lg->toFile('SiteStats','Statistics Log', true);
-
-e107::getEvent()->trigger('user_log_stats',$vals);
-
-
-// ------------------------------------ ---------------------
-
-// We MUST have a timezone set in PHP >= 5.3. This should work for PHP >= 5.1:
-// @todo may be able to remove this check once minimum PHP version finalised
-if (function_exists('date_default_timezone_get'))
-{
- date_default_timezone_set(@date_default_timezone_get()); // Just set a default - it should default to UTC if no timezone set
-}
-
-
-//$logfp = fopen(e_LOG.'rcvstring.txt', 'a+'); fwrite($logfp, $logVals."\n"); fclose($logfp);
-//$logfp = fopen(e_LOG.'rcvstring.txt', 'a+'); fwrite($logfp, print_r($vals, TRUE)."\n"); fclose($logfp);
-
-$colour = strip_tags((isset($vals['colour']) ? $vals['colour'] : ''));
-$res = strip_tags((isset($vals['res']) ? $vals['res'] : ''));
-$self = strip_tags((isset($vals['eself']) ? $vals['eself'] : ''));
-$ref = addslashes(strip_tags((isset($vals['referer']) ? $vals['referer'] : '')));
-$logQry = isset($vals['qry']) && $vals['qry'];
-$date = date('z.Y', time());
-$logPfile = e_LOG.'logp_'.$date.'.php';
-
-//$logString = "Colour: {$colour} Res: {$res} Self: {$self} Referrer: {$ref} ErrCode: {$vals['err_direct']}\n";
-//$logfp = fopen(e_LOG.'rcvstring.txt', 'a+'); fwrite($logfp, $logString); fclose($logfp);
-
-
-// vet resolution and colour depth some more - avoid dud values
-if ($res && preg_match("#.*?((\d+)\w+?(\d+))#", $res, $match))
-{
- $res = $match[2].'x'.$match[3];
-}
-else
-{
- $res = '??'; // Can't decode resolution
-}
-
-if ($colour && preg_match("#.*?(\d+)#",$colour,$match))
-{
- $colour = intval($match[1]);
-}
-else
-{
- $colour='??';
-}
-
-
-if ($err_code = strip_tags((isset($vals['err_direct']) ? $vals['err_direct'] : '')))
-{
- $ref = addslashes(strip_tags(isset($vals['err_referer']) ? $vals['err_referer'] : ''));
-// Uncomment the next two lines to create a separate CSV format log of invalid accesses - error code, entered URL, referrer
-// $log_string = $err_code.",".$self.",".$ref;
-// $logfp = fopen(e_LOG."errpages.csv", 'a+'); fwrite($logfp, $log_string."\n\r"); fclose($logfp);
- $err_code .= ':';
-}
-
-if(strpos($ref, 'admin') !== false)
-{
- $ref = FALSE;
-}
-
-$screenstats = $res.'@'.$colour;
-$agent = $_SERVER['HTTP_USER_AGENT'];
-$ip = e107::getIPHandler()->ipDecode(USERIP);
-
-$oldref = $ref; // backup for search string being stripped off for referer
-if($ref && strpos($ref, $_SERVER['HTTP_HOST']) === false)
-{
- if(preg_match("#http://(.*?)($|/)#is", $ref, $match))
- {
- $ref = $match[0];
- }
-}
-
-
-$pageDisallow = "cache|file|eself|admin";
-$tagRemove = "(\\\)|(\s)|(\')|(\")|(eself)|( )|(\.php)|(\.html)";
-$tagRemove2 = "(\\\)|(\s)|(\')|(\")|(eself)|( )";
-
-/*
-function logGetPageKey($url,$logQry=false,$err_code='')
-{
- global $pageDisallow, $tagRemove;
-
- preg_match("#/(.*?)(\?|$)(.*)#si", $url, $match);
- $match[1] = isset($match[1]) ? $match[1] : '';
- $pageName = substr($match[1], (strrpos($match[1], "/")+1));
-
- $pageName = preg_replace("/".$tagRemove."/si", "", $pageName);
- if($pageName == "")
- {
- return "index";
- }
-
- if(preg_match("/".$pageDisallow."/i", $pageName))
- {
- return false;
- }
-
- if ($logQry)
- {
- $pageName .= '+'.$match[3]; // All queries match
- }
-
- $pageName = $err_code.$pageName; // Add the error code at the beginning, so its treated uniquely
-
-
- return $pageName;
-}*/
-
-require_once(e_PLUGIN."log/consolidate.php");
-$lgc = new logConsolidate;
-
-
-if(!$pageName = $lgc->getPageKey($self,false,$err_code,e_LAN))
-{
- if(LOGSTATS_DEBUG == true)
- {
- echo 'pageName was empty';
- }
- return;
-}
-
-if(LOGSTATS_DEBUG == true)
-{
- echo "
File: ".$logPfile;
-}
-
-//$logfp = fopen(e_LOG.'rcvstring.txt', 'a+'); fwrite($logfp, $pageName."\n"); fclose($logfp);
-
-$p_handle = fopen($logPfile, 'r+');
-if($p_handle && flock( $p_handle, LOCK_EX ) )
-{
- $log_file_contents = '';
- while (!feof($p_handle)) // Assemble a string of data
- {
- $log_file_contents.= fgets($p_handle,1000);
- }
- $log_file_contents = str_replace(array('<'.'?php','?'.'>'),'',$log_file_contents);
- if (eval($log_file_contents) === FALSE && getperms('0'))
- {
- echo "Error in log file contents: ".$logPfile;
- }
-}
-elseif(getperms('0'))
-{
- echo "Couldn't log data to: ".$logPfile; // returned to js popup.
- exit;
-}
-
-
-$flag = FALSE;
-if(array_key_exists($pageName, $pageInfo))
-{ // Existing page - just increment stats
- $pageInfo[$pageName]['ttl'] ++;
-}
-else
-{ // First access of page
- $url = preg_replace("/".$tagRemove2."/si", "", $self);
- if(preg_match("/".$pageDisallow."/i", $url)) return;
- $pageInfo[$pageName] = array('url' => $url, 'ttl' => 1, 'unq' => 1);
- $flag = TRUE;
-}
-
-
-
-if(strpos($ipAddresses, $ip) === false)
-{ /* unique visit */
- if(!$flag)
- {
- $pageInfo[$pageName]['unq'] ++;
- }
- $siteUnique ++;
- $ipAddresses .= $ip."."; // IP address is stored as hex string
- require_once('loginfo.php');
-}
-
-
-
-
-
-
-$siteTotal ++;
-$info_data = var_export($pageInfo, true);
-//$date_stamp = date("z:Y", time()); // Same as '$date' variable
-
-$data = "";
-
-if ($p_handle)
-{
- ftruncate($p_handle, 0 );
- fseek( $p_handle, 0 );
- fwrite($p_handle, $data);
- fclose($p_handle);
-}
-
-if(LOGSTATS_DEBUG == true)
-{
- echo '
Script Completed';
-}
-
-
diff --git a/e107_plugins/log/log_sql.php b/e107_plugins/log/log_sql.php
deleted file mode 100644
index a067bb225..000000000
--- a/e107_plugins/log/log_sql.php
+++ /dev/null
@@ -1,7 +0,0 @@
-CREATE TABLE logstats (
- log_uniqueid int(11) NOT NULL auto_increment,
- log_id varchar(50) NOT NULL default '',
- log_data longtext NOT NULL,
- PRIMARY KEY (log_uniqueid),
- UNIQUE KEY log_id (log_id)
-) ENGINE=MyISAM;
\ No newline at end of file
diff --git a/e107_plugins/log/loginfo.php b/e107_plugins/log/loginfo.php
deleted file mode 100644
index e8bc866db..000000000
--- a/e107_plugins/log/loginfo.php
+++ /dev/null
@@ -1,317 +0,0 @@
-'),'',$log_file_contents);
- if (eval($log_file_contents) === FALSE) echo "error in log file contents
";
-}
-else
-{
- echo "Couldn't log data
";
- exit;
-}
-
-$browser = getBrowser($agent);
-$os = getOs($agent);
-
-if($screenstats && $screenstats != "@")
-{
- if(array_key_exists($screenstats, $screenInfo))
- {
- $screenInfo[$screenstats] ++;
- }
- else
- {
- $screenInfo[$screenstats] = 1;
- }
-}
-
-if(array_key_exists($browser, $browserInfo))
-{
- $browserInfo[$browser] ++;
-}
-else
-{
- $browserInfo[$browser] = 1;
-}
-
-if(array_key_exists($os, $osInfo))
-{
- $osInfo[$os] ++;
-}
-else
-{
- $osInfo[$os] =1;
-}
-
-/* referer data ... */
-if($ref && strpos($ref, $_SERVER['HTTP_HOST']) === false)
-{
- if(preg_match("#http://(.*?)($|/)#is", $ref, $match))
- {
- $refdom = $match[0];
- if(array_key_exists($refdom, $refInfo))
- {
- $refInfo[$refdom]['ttl'] ++;
- }
- else
- {
- $refInfo[$refdom] = array('url' => $ref, 'ttl' => 1);
- }
- }
-}
-
-/* is the referal from Google? If so get search string ... */
-if(preg_match("#q=(.*?)($|&)#is", $oldref, $match))
-{
- $schstr = trim($match[1]);
- $schstr = htmlentities(urldecode($schstr));
- if(array_key_exists($schstr, $searchInfo) && $schstr)
- {
- $searchInfo[$schstr] ++;
- }
- else
- {
- $searchInfo[$schstr] = 1;
- }
-}
-
-if ($tmp = gethostbyaddr(getenv('REMOTE_ADDR')))
-{
- $host = trim(strtolower(substr($tmp, strrpos($tmp, ".")+1)));
- if(!is_numeric($host) && strpos($host, "calhost") === false)
- {
- if(array_key_exists($host, $domainInfo))
- {
- $domainInfo[$host] ++;
- }
- else
- {
- $domainInfo[$host] =1;
- }
- }
-}
-
-/* last 20 visitors */
-if(count($visitInfo) >= 20)
-{
- $length = 20;
- $offset = count($visitInfo)-$length;
- $visitInfo = array_slice($visitInfo, $offset, $length);
-}
-
-$visitInfo[$tmp] = array(
- 'host' => trim($tmp),
- 'date' => time(),
- 'os' => trim($os),
- 'browser' => trim($browser),
- 'screen' => trim($screenstats),
- 'referer' => substr(trim($ref), 0, 255),
-);
-
-$data = "';
-
-
-if ($i_handle)
-{
- ftruncate($i_handle, 0);
- fseek( $i_handle, 0 );
- fwrite($i_handle, $data);
- fclose($i_handle);
-}
-
-
-function getBrowser($agent)
-{
- //
- // All "root" browsers must come at the end of the list, unfortunately.
- // Otherwise, browsers based on them will never be seen.
- //(But #1997)
- // http://www.zytrax.com/tech/web/browser_ids.htm
- $browsers = array(
- "netcaptor" => array('name' => 'Netcaptor', 'rule' => 'netcaptor[ /]([0-9.]{1,10})'),
- "opera" => array('name' => 'Opera Mini', 'rule' => 'Opera[ /]([0-9.]{1,10})(.*)Opera Mini'),
- "opera1" => array('name' => 'Opera Mobile', 'rule' => 'Opera[ /]([0-9.]{1,10})(.*)Opera Mobi'),
- "opera2" => array('name' => 'Opera', 'rule' => 'opera[ /]([0-9.]{1,10})'),
- "chrome" => array('name' => 'Chrome', 'rule' => 'Chrome[ /]([0-9.+]{1,10})'),
- "nokia" => array('name' => 'Nokia Browser', 'rule' => 'Nokia([^/]+)/([^ SP]+)'),
- "nokia1" => array('name' => 'Nokia Browser', 'rule' => 'Series60|S60/([0-9.]{1,10})'),
- "nokia2" => array('name' => 'Nokia Browser', 'rule' => 'Mozilla(.*)SymbianOS(.*)AppleWebKit'), // catch it or it'll become a safari hit!
- "aol" => array('name' => 'AOL', 'rule' => 'aol[ /\-]([0-9.]{1,10})'),
- "aol2" => array('name' => 'AOL', 'rule' => 'aol[ /\-]?browser'),
- "mosaic" => array('name' => 'Mosaic', 'rule' => 'mosaic[ /]([0-9.]{1,10})'),
- "k-meleon" => array('name' => 'K-Meleon', 'rule' => 'K-Meleon[ /]([0-9.]{1,10})'),
- "konqueror" => array('name' => 'Konqueror', 'rule' => 'konqueror/([0-9.]{1,10})'),
- "avantbrowser" => array('name' => 'Avant Browser', 'rule' => 'Avant[ ]?Browser'),
- "avantgo" => array('name' => 'AvantGo', 'rule' => 'AvantGo[ /]([0-9.]{1,10})'),
- // "proxomitron" => array('name' => 'Proxomitron', 'rule' => 'Space[ ]?Bison/[0-9.]{1,10}'),
- "lynx" => array('name' => 'Lynx', 'rule' => 'lynx/([0-9a-z.]{1,10})'),
- "links" => array('name' => 'Links', 'rule' => 'Links[ /]\(([0-9.]{1,10})'),
- "galeon" => array('name' => 'Galeon', 'rule' => 'galeon/([0-9.]{1,10})'),
- "abrowse" => array('name' => 'ABrowse', 'rule' => 'abrowse/([0-9.]{1,10})'),
- "amaya" => array('name' => 'Amaya', 'rule' => 'amaya/([0-9.]{1,10})'),
- "ant" => array('name' => 'ANTFresco', 'rule' => 'ANTFresco[ /]([0-9.]{1,10})'),
- "aweb" => array('name' => 'Aweb', 'rule' => 'Aweb[/ ]([0-9.]{1,10})'),
- "beonex" => array('name' => 'Beonex', 'rule' => 'beonex/([0-9.]{1,10})'),
- "blazer" => array('name' => 'Blazer', 'rule' => 'Blazer[/ ]([0-9.]{1,10})'),
- "camino" => array('name' => 'Camino', 'rule' => 'camino/([0-9.+]{1,10})'),
- "chimera" => array('name' => 'Chimera', 'rule' => 'chimera/([0-9.+]{1,10})'),
- "columbus" => array('name' => 'Columbus', 'rule' => 'columbus[ /]([0-9.]{1,10})'),
- "crazybrowser" => array('name' => 'Crazy Browser', 'rule' => 'Crazy Browser[ /]([0-9.]{1,10})'),
- "curl" => array('name' => 'Curl', 'rule' => 'curl[ /]([0-9.]{1,10})'),
- "deepnet" => array('name' => 'Deepnet Explorer', 'rule' => 'Deepnet Explorer[/ ]([0-9.]{1,10})'),
- "dillo" => array('name' => 'Dillo', 'rule' => 'dillo/([0-9.]{1,10})'),
- "doris" => array('name' => 'Doris', 'rule' => 'Doris/([0-9.]{1,10})'),
- "elinks" => array('name' => 'ELinks', 'rule' => 'ELinks[ /][(]*([0-9.]{1,10})'),
- "epiphany" => array('name' => 'Epiphany', 'rule' => 'Epiphany/([0-9.]{1,10})'),
- "ibrowse" => array('name' => 'IBrowse', 'rule' => 'ibrowse[ /]([0-9.]{1,10})'),
- "icab" => array('name' => 'iCab', 'rule' => 'icab[/ ]([0-9.]{1,10})'),
- "ice" => array('name' => 'ICEbrowser', 'rule' => 'ICEbrowser/v?([0-9._]{1,10})'),
- "isilox" => array('name' => 'iSiloX', 'rule' => 'iSilox/([0-9.]{1,10})'),
- "lotus" => array('name' => 'Lotus Notes', 'rule' => 'Lotus[ -]?Notes[ /]([0-9.]{1,10})'),
- "lunascape" => array('name' => 'Lunascape', 'rule' => 'Lunascape[ /]([0-9.]{1,10})'),
- "maxthon" => array('name' => 'Maxthon', 'rule' => ' Maxthon[);]'),
- "mbrowser" => array('name' => 'mBrowser', 'rule' => 'mBrowser[ /]([0-9.]{1,10})'),
- "multibrowser" => array('name' => 'Multi-Browser', 'rule' => 'Multi-Browser[ /]([0-9.]{1,10})'),
- "nautilus" => array('name' => 'Nautilus', 'rule' => '(gnome[ -]?vfs|nautilus)/([0-9.]{1,10})'),
- "netfront" => array('name' => 'NetFront', 'rule' => 'NetFront[ /]([0-9.]{1,10})$'),
- "netpositive" => array('name' => 'NetPositive', 'rule' => 'netpositive[ /]([0-9.]{1,10})'),
- "omniweb" => array('name' => 'OmniWeb', 'rule' => 'omniweb/[ a-z]?([0-9.]{1,10})$'),
- "oregano" => array('name' => 'Oregano', 'rule' => 'Oregano[0-9]?[ /]([0-9.]{1,10})$'),
- "phaseout" => array('name' => 'PhaseOut', 'rule' => 'www.phaseout.net'),
- "plink" => array('name' => 'PLink', 'rule' => 'PLink[ /]([0-9a-z.]{1,10})'),
- "phoenix" => array('name' => 'Phoenix', 'rule' => 'Phoenix/([0-9.+]{1,10})'),
- "proxomitron" => array('name' => 'Proxomitron', 'rule' => 'Space[ ]?Bison/[0-9.]{1,10}'),
- "shiira" => array('name' => 'Shiira', 'rule' => 'Shiira/([0-9.]{1,10})'),
- "sleipnir" => array('name' => 'Sleipnir', 'rule' => 'Sleipnir( Version)?[ /]([0-9.]{1,10})'),
- "slimbrowser" => array('name' => 'SlimBrowser', 'rule' => 'Slimbrowser'),
- "staroffice" => array('name' => 'StarOffice', 'rule' => 'staroffice[ /]([0-9.]{1,10})'),
- "sunrise" => array('name' => 'Sunrise', 'rule' => 'SunriseBrowser[ /]([0-9.]{1,10})'),
- "voyager" => array('name' => 'Voyager', 'rule' => 'voyager[ /]([0-9.]{1,10})'),
- "w3m" => array('name' => 'w3m', 'rule' => 'w3m/([0-9.]{1,10})'),
- "webtv" => array('name' => 'Webtv', 'rule' => 'webtv[ /]([0-9.]{1,10})'),
- "xiino" => array('name' => 'Xiino', 'rule' => '^Xiino[ /]([0-9a-z.]{1,10})'),
- "explorer" => array('name' => 'Internet Explorer', 'rule' => '\(compatible; MSIE[ /]([0-9.]{1,10})'),
- "safari" => array('name' => 'Safari', 'rule' => 'safari/([0-9.]{1,10})'),
- "firefox" => array('name' => 'Firefox', 'rule' => 'Firefox/([0-9.+]{1,10})'),
- "netscape" => array('name' => 'Netscape', 'rule' => 'netscape[0-9]?/([0-9.]{1,10})'),
- "netscape2" => array('name' => 'Netscape', 'rule' => '^mozilla/([0-4]\.[0-9.]{1,10})'),
- "mozilla" => array('name' => 'Mozilla', 'rule' => '^mozilla/[5-9]\.[0-9.]{1,10}.+rv:([0-9a-z.+]{1,10})'),
- "mozilla2" => array('name' => 'Mozilla', 'rule' => '^mozilla/([5-9]\.[0-9a-z.]{1,10})'),
- "firebird" => array('name' => 'Firebird', 'rule' => 'Firebird/([0-9.+]{1,10})'),
- );
- $browser = "";
- foreach($browsers as $key => $info)
- {
- if (preg_match("#".$info['rule']."#i", $agent, $results))
- {
- switch ($key)
- {
- case 'nokia':
- case 'nokia1':
- case 'nokia2':
- if(strpos(strtolower($agent), 'series60') !== false || strpos($agent, 'S60') !== false )
- {
- $info['name'] = 'Nokia S60 OSS Browser';
- }
- return ($info['name'].(isset($results[2]) && $results[2] ? ' v'.$results[2] : ''));
- break;
-
- default:
- return ($info['name'].(isset($results[1]) && $results[1] ? ' v'.$results[1] : ''));
- break;
- }
- }
- }
- return ('Unknown');
-}
-
-function getOs($agent)
-{
- // http://www.zytrax.com/tech/web/browser_ids.htm
- $os = array(
- // mobile come first - latest rules could break the check
- "android" => array('name' => 'Android', 'rule' => 'Android\s([0-9.]{1,10})'),
- "symbian" => array('name' => 'Symbian', 'rule' => 'symbianOS[ /]?([0-9.]{1,10})'),
- "symbian1" => array('name' => 'Symbian', 'rule' => 'series60[ /]'),
- "symbian2" => array('name' => 'Symbian', 'rule' => 'Symbian OS Series'),
- "windows7" => array('name' => 'Windows 7', 'rule' => 'wi(n|ndows)[ \-]?nt[ /]?6\.1'),
- "windowsvista" => array('name' => 'Windows Vista', 'rule' => 'wi(n|ndows)[ \-]?nt[ /]?6\.0'),
- "windows2003" => array('name' => 'Windows 2003', 'rule' => 'wi(n|ndows)[ \-]?(2003|nt[ /]?5\.2)'),
- "windowsxp" => array('name' => 'Windows XP', 'rule' => 'Windows XP'),
- "windowsxp2" => array('name' => 'Windows XP', 'rule' => 'wi(n|ndows)[ \-]?nt[ /]?5\.1'),
- "windows2k" => array('name' => 'Windows 2000', 'rule' => 'wi(n|ndows)[ \-]?(2000|nt[ /]?5\.0)'),
- "windows95" => array('name' => 'Windows 95', 'rule' => 'wi(n|ndows)[ \-]?95'),
- "windowsce" => array('name' => 'Windows CE', 'rule' => 'wi(n|ndows)[ \-]?ce'),
- "windowsme" => array('name' => 'Windows ME', 'rule' => 'win 9x 4\.90'),
- "windowsme2" => array('name' => 'Windows ME', 'rule' => 'wi(n|ndows)[ \-]?me'),
- "windowsnt" => array('name' => 'Windows NT', 'rule' => 'wi(n|ndows)[ \-]?nt[ /]?([0-4][0-9.]{1,10})'),
- "windowsnt2" => array('name' => 'Windows NT', 'rule' => 'wi(n|ndows)[ \-]?nt'),
- "windows98" => array('name' => 'Windows 98', 'rule' => 'wi(n|ndows)[ \-]?98'),
- "windows" => array('name' => 'Windows', 'rule' => 'wi(n|n32|ndows)'),
- "linux" => array('name' => 'Linux', 'rule' => 'mdk for ([0-9.]{1,10})'),
- "linux2" => array('name' => 'Linux', 'rule' => 'linux[ /\-]([a-z0-9.]{1,10})'),
- "linux3" => array('name' => 'Linux', 'rule' => 'linux'),
- "macosx" => array('name' => 'MacOS X', 'rule' => 'Mac[ ]?OS[ ]?X'),
- "macppc" => array('name' => 'MacOS PPC', 'rule' => 'Mac(_Power|intosh.+P)PC'),
- "mac" => array('name' => 'MacOS', 'rule' => 'mac[^hk]'),
- "amiga" => array('name' => 'Amiga', 'rule' => 'Amiga[ ]?OS[ /]([0-9.]{1,10})'),
- "beos" => array('name' => 'BeOS', 'rule' => 'beos[ a-z]*([0-9.]{1,10})'),
- "freebsd" => array('name' => 'FreeBSD', 'rule' => 'free[ \-]?bsd[ /]([a-z0-9.]{1,10})'),
- "freebsd2" => array('name' => 'FreeBSD', 'rule' => 'free[ \-]?bsd'),
- "irix" => array('name' => 'Irix', 'rule' => 'irix[0-9]*[ /]([0-9.]{1,10})'),
- "netbsd" => array('name' => 'NetBSD', 'rule' => 'net[ \-]?bsd[ /]([a-z0-9.]{1,10})'),
- "netbsd2" => array('name' => 'NetBSD', 'rule' => 'net[ \-]?bsd'),
- "os2" => array('name' => 'OS/2 Warp', 'rule' => 'warp[ /]?([0-9.]{1,10})'),
- "os22" => array('name' => 'OS/2 Warp', 'rule' => 'os[ /]?2'),
- "openbsd" => array('name' => 'OpenBSD', 'rule' => 'open[ \-]?bsd[ /]([a-z0-9.]{1,10})'),
- "openbsd2" => array('name' => 'OpenBSD', 'rule' => 'open[ \-]?bsd'),
- "palm" => array('name' => 'PalmOS', 'rule' => 'Palm[ \-]?(Source|OS)[ /]?([0-9.]{1,10})'),
- "palm2" => array('name' => 'PalmOS', 'rule' => 'Palm[ \-]?(Source|OS)')
- );
- foreach($os as $key => $info)
- {
- if (preg_match("#".$info['rule']."#i", $agent, $results))
- {
- if(strpos($key, "win") !== false)
- {
- return ($info['name']);
- }
- else
- {
- return ($info['name']." ".$results[1]);
- }
- }
- }
- return ('Unspecified');
-}
diff --git a/e107_plugins/log/logs/null.txt b/e107_plugins/log/logs/null.txt
deleted file mode 100644
index e69de29bb..000000000
diff --git a/e107_plugins/log/plugin.xml b/e107_plugins/log/plugin.xml
deleted file mode 100644
index f394cc3c3..000000000
--- a/e107_plugins/log/plugin.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
- This plugin will log all visits to your site, and build detailed statistic screens based on the information gathered.
-
- LAN_PLUGIN_LOG_CONFIGURE
-
-
- LAN_PLUGIN_LOG_LINK
-
-
- 0
-
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 0
-
-
\ No newline at end of file
diff --git a/e107_plugins/log/stats.php b/e107_plugins/log/stats.php
deleted file mode 100644
index ab4a530c8..000000000
--- a/e107_plugins/log/stats.php
+++ /dev/null
@@ -1,2074 +0,0 @@
-addError(ADSTAT_L4);
- $ns->tablerender(ADSTAT_L6, $mes->render());
- require_once(FOOTERF);
- exit;
-}
-
-
-if (!e107::getPref('statActivate'))
-{
- $text = (ADMIN ? "".ADSTAT_L41."
" : "".ADSTAT_L5."
");
- $ns->tablerender(ADSTAT_L6, $text);
- require_once(FOOTERF);
- exit;
-}
-
-
-$qs = explode('.', e_QUERY, 3);
-$action = varset($qs[0],1);
-$sec_action = varset($qs[1],FALSE);
-$order = varset($qs[1],0); // Sort order
-
-$toremove = varset($qs[2],'');
-$order = intval($order);
-
-$stat = new siteStats($order);
-
-if($stat->error)
-{
- $ns->tablerender(ADSTAT_L6, $stat->error);
- require_once(FOOTERF);
- exit;
-}
-
-/* stats displayed will depend on the query string. For example, ?1.2.4 will render today's stats, all time stats and browser stats */
-/*
-1: today's stats
-2: all time total and unique
-3: browsers
-4: operating systems
-5: domains
-6: screen resolution/colour depth
-7: referers
-8: search engine strings
-9: Recent visitors
-10: Daily visitors
-11: Monthly visitors
-12: Error pages today
-13: Error pages all-time
-14: Browsers consolidated
-15: OSs consolidated
-*/
-
-function display_pars($rec_pars, $disp_pars = '*')
-{
- switch ($rec_pars)
- {
- case 1 : return array(1);
- case 2 : if (e107::getPref('statPrevMonth')) return array(2,3,1); else return array(2,1);
- case 3 : return array(2,3,1);
- default : return array();
- }
-}
-
-
-$text = '';
-if ((ADMIN == TRUE) && ($sec_action == 'rem'))
-{
- $toremove = rawurldecode($toremove);
- if ($stat -> remove_entry($toremove))
- {
- $text .= "".ADSTAT_L45.$toremove."
".ADSTAT_L46."
";
- }
- else
- {
- $text .= "".ADSTAT_L47.$toremove."
";
- }
-}
-
-
-$action = intval($action);
-
-switch($action)
-{
- case 1:
- $text .= $stat -> renderTodaysVisits(FALSE);
- break;
- case 2:
- $text .= $stat -> renderAlltimeVisits($action, FALSE);
- break;
- case 12:
- if (ADMIN == TRUE)
- {
- $text .= $stat -> renderTodaysVisits(TRUE);
- }
- break;
- case 13:
- if (ADMIN == TRUE)
- {
- $text .= $stat -> renderAlltimeVisits($action, TRUE);
- }
- break;
- case 3 : // 'Normal' render
- case 14 : // 'Consolidated' render
- if(e107::getPref('statBrowser'))
- {
- $text .= $stat -> renderBrowsers(display_pars(e107::getPref('statBrowser')), $action==3);
- }
- else
- {
- $text .= ADSTAT_L7;
- }
- break;
- case 4: // 'Normal' render
- case 15 : // 'Consolidated' render
- if(e107::getPref('statOs'))
- {
- $text .= $stat -> renderOses(display_pars(e107::getPref('statOs')), $action==4);
- }
- else
- {
- $text .= ADSTAT_L7;
- }
- break;
- case 5:
- if(e107::getPref('statDomain'))
- {
- $text .= $stat -> renderDomains(display_pars(e107::getPref('statDomain')));
- }
- else
- {
- $text .= ADSTAT_L7;
- }
- break;
- case 6:
- if(e107::getPref('statScreen'))
- {
- $text .= $stat -> renderScreens(display_pars(e107::getPref('statScreen')));
- }
- else
- {
- $text .= ADSTAT_L7;
- }
- break;
- case 7:
- if (e107::getPref('statRefer'))
- {
- $text .= $stat -> renderRefers(display_pars(e107::getPref('statRefer')));
- }
- else
- {
- $text .= ADSTAT_L7;
- }
- break;
- case 8:
- if (e107::getPref('statQuery'))
- {
- $text .= $stat -> renderQueries(display_pars(e107::getPref('statQuery')));
- }
- else
- {
- $text .= ADSTAT_L7;
- }
- break;
- case 9:
- if (e107::getPref('statRecent'))
- {
- $text .= $stat -> recentVisitors();
- }
- else
- {
- $text .= ADSTAT_L7;
- }
- break;
- case 10:
- $text .= $stat -> renderDaily();
- break;
- case 11:
- $text .= $stat -> renderMonthly();
- break;
- default :
- $text .= $stat -> renderTodaysVisits(FALSE);
-}
-
-
-
-/* render links
- 1 - Todays visits
- 2 - All-time
- 3 - Browser stats
- 4 - OS Stats
- 5 - Domain Stats
- 6 - Screen resolution
- 7 - Referral stats
- 8 - Search strings
- 9 - Recent visitors
-10 - Daily Stats
-11 - Monthly stats
-12 - Today's error page visits
-13 - All-time error page visits
-14 - Consolidated browser view (not listed as a menu option)
-15 - Consolidated OS view (not listed as a menu option)
-*/
-
-$path = e_PLUGIN_ABS.'log/stats.php';
-
-
-
-
-
-
-
-$links = "
-".
-($action != 1 ? "
".ADSTAT_L8."" : "
".ADSTAT_L8."")." | ".
-($action != 2 ? "
".ADSTAT_L9."" : "
".ADSTAT_L9."")." | ".
-($action != 10 ? "
".ADSTAT_L10."" : "
".ADSTAT_L10."")." | ".
-($action != 11 ? "
".ADSTAT_L11."" : "
".ADSTAT_L11."")." | ".
-($action != 3 && e107::getPref('statBrowser') ? "
".ADSTAT_L12." | " : (e107::getPref('statBrowser') ? "
".ADSTAT_L12." | " : "")).
-($action != 4 && e107::getPref('statOs') ? "
".ADSTAT_L13." | " : (e107::getPref('statOs') ? "
".ADSTAT_L13." | " : "")).
-($action != 5 && e107::getPref('statDomain') ? "
".ADSTAT_L14." | " : (e107::getPref('statDomain') ? "
".ADSTAT_L14." | " : "")).
-($action != 6 && e107::getPref('statScreen') ? "
".ADSTAT_L15." | " : (e107::getPref('statScreen') ? "
".ADSTAT_L15." | " : "")).
-($action != 7 && e107::getPref('statRefer') ? "
".ADSTAT_L16." | " : (e107::getPref('statRefer') ? "
".ADSTAT_L16." | " : "")).
-($action != 8 && e107::getPref('statQuery') ? "
".ADSTAT_L17." | " : (e107::getPref('statQuery') ? "
".ADSTAT_L17." | " : "")).
-($action != 9 && e107::getPref('statRecent') ? "
".ADSTAT_L18." | " : (e107::getPref('statRecent') ? "
".ADSTAT_L18." | " : ""));
-if (ADMIN == TRUE)
-{
- $links .=
- ($action != 12 ? "
".ADSTAT_L43."" : "
".ADSTAT_L43."")." | ".
- ($action != 13 ? "
".ADSTAT_L44."" : "
".ADSTAT_L44."");
-}
-$links .= "
";
-
-
-
-
-
-// $links = statNav($action)."
";
-
-$nav = $stat->renderNav($action)."
";
-
-$ns->tablerender(ADSTAT_L6, $nav.$text);
-require_once(FOOTERF);
-
-
-function make_bits($prefix, $act)
-{
- $ret = array();
- $now = getdate();
- $ret['hdg_extra'] = '';
- switch ($act)
- {
- case 1 :
- $ret['query'] = "log_id='{$prefix}'";
- break;
- case 2 :
- $ret['query'] = "log_id='{$prefix}:".date("Y-m")."'";
- $ret['hdg_extra'] = " (".$now['mon']."-".$now['year'].")";
- break;
- case 3 :
- $now['mon']--;
- if ($now['mon']==0)
- {
- $now['mon'] = 12;
- $now['year']--;
- }
- $ret['query'] = "log_id='{$prefix}:".sprintf("%04d-%02d",$now['year'],$now['mon'])."'";
- $ret['hdg_extra'] = " (".$now['mon']."-".$now['year'].")";
- break;
- default: $ret = "Invalid selection: {$act}
";
- }
- return $ret;
-}
-
-
-
-
-class siteStats
-{
- protected $browser_headings = array(1 => ADSTAT_L50, 2 => ADSTAT_L51, 3 => ADSTAT_L52);
-
- protected $dbPageInfo;
- protected $fileInfo;
- protected $fileBrowserInfo;
- protected $fileOsInfo;
- protected $fileScreenInfo;
- protected $fileDomainInfo;
- protected $fileReferInfo;
- protected $fileQueryInfo;
- protected $fileRecent;
-
- protected $order;
- protected $bar;
- protected $plugFolder;
-
- protected $filesiteTotal;
- protected $filesiteUnique;
-
- public $error; // Set if error
-
-
-
- protected $oses_map = array (
- "Windows" => "windows",
- "Mac" => "mac",
- "Linux" => "linux",
- "BeOS" => "beos",
- "FreeBSD" => "freebsd",
- "NetBSD" => "netbsd",
- "Unspecified"=> "unspecified",
- "OpenBSD" => "openbsd",
- "Unix" => "unix",
- "Spiders" => "spiders",
- "Android" => "android",
- "Symbian" => "symbian",
- );
-
- protected $browser_map = array (
- 'Netcaptor' => "netcaptor",
- 'Internet Explorer' => "explorer",
- 'Firefox' => "firefox",
- 'Opera' => "opera",
- 'AOL' => "aol",
- 'Netscape' => "netscape",
- 'Mozilla' => "mozilla",
- 'Mosaic' => "mosaic",
- 'K-Meleon' => "k-meleon",
- 'Konqueror' => "konqueror",
- 'Avant Browser' => "avantbrowser",
- 'AvantGo' => "avantgo",
- // 'Proxomitron' => "proxomitron",
- 'Safari' => "safari",
- 'Lynx' => "lynx",
- 'Links' => "links",
- 'Galeon' => "galeon",
- 'ABrowse' => "abrowse",
- 'Amaya' => "amaya",
- 'ANTFresco' => "ant",
- 'Aweb' => "aweb",
- 'Beonex' => "beonex",
- 'Blazer' => "blazer",
- 'Camino' => "camino",
- 'Chimera' => "chimera",
- 'Columbus' => "columbus",
- 'Crazy Browser' => "crazybrowser",
- 'Curl' => "curl",
- 'Deepnet Explorer' => "deepnet",
- 'Dillo' => "dillo",
- 'Doris' => "doris",
- 'ELinks' => "elinks",
- 'Epiphany' => "epiphany",
- 'Firebird' => "firebird",
- 'IBrowse' => "ibrowse",
- 'iCab' => "icab",
- 'ICEbrowser' => "ice",
- 'iSiloX' => "isilox",
- 'Lotus Notes' => "lotus",
- 'Lunascape' => "lunascape",
- 'Maxthon' => "maxthon",
- 'mBrowser' => "mbrowser",
- 'Multi-Browser' => "multibrowser",
- 'Nautilus' => "nautilus",
- 'NetFront' => "netfront",
- 'NetPositive' => "netpositive",
- 'OmniWeb' => "omniweb",
- 'Oregano' => "oregano",
- 'PhaseOut' => "phaseout",
- 'PLink' => "plink",
- 'Phoenix' => "phoenix",
- 'Proxomitron' => "proxomitron",
- 'Shiira' => "shiira",
- 'Sleipnir' => "sleipnir",
- 'SlimBrowser' => "slimbrowser",
- 'StarOffice' => "staroffice",
- 'Sunrise' => "sunrise",
- 'Voyager' => "voyager",
- 'w3m' => "w3m",
- 'Webtv' => "webtv",
- 'Xiino' => "xiino",
- 'Nokia S60 OSS Browser' => "nokia",
- 'Nokia Browser' => "nokia",
- );
-
-
- protected $country = array(
- 'arpa' => 'ARPANet',
- 'com' => 'Commercial Users',
- 'edu' => 'Education',
- 'gov' => 'Government',
- 'int' => 'Organisation established by an International Treaty',
- 'mil' => 'Military',
- 'net' => 'Network',
- 'org' => 'Organisation',
- 'ad' => 'Andorra',
- 'ae' => 'United Arab Emirates',
- 'af' => 'Afghanistan',
- 'ag' => 'Antigua & Barbuda',
- 'ai' => 'Anguilla',
- 'al' => 'Albania',
- 'am' => 'Armenia',
- 'an' => 'Netherland Antilles',
- 'ao' => 'Angola',
- 'aq' => 'Antarctica',
- 'ar' => 'Argentina',
- 'as' => 'American Samoa',
- 'at' => 'Austria',
- 'au' => 'Australia',
- 'aw' => 'Aruba',
- 'az' => 'Azerbaijan',
- 'ba' => 'Bosnia-Herzegovina',
- 'bb' => 'Barbados',
- 'bd' => 'Bangladesh',
- 'be' => 'Belgium',
- 'bf' => 'Burkina Faso',
- 'bg' => 'Bulgaria',
- 'bh' => 'Bahrain',
- 'bi' => 'Burundi',
- 'bj' => 'Benin',
- 'bm' => 'Bermuda',
- 'bn' => 'Brunei Darussalam',
- 'bo' => 'Bolivia',
- 'br' => 'Brasil',
- 'bs' => 'Bahamas',
- 'bt' => 'Bhutan',
- 'bv' => 'Bouvet Island',
- 'bw' => 'Botswana',
- 'by' => 'Belarus',
- 'bz' => 'Belize',
- 'ca' => 'Canada',
- 'cc' => 'Cocos (Keeling) Islands',
- 'cf' => 'Central African Republic',
- 'cg' => 'Congo',
- 'ch' => 'Switzerland',
- 'ci' => 'Ivory Coast',
- 'ck' => 'Cook Islands',
- 'cl' => 'Chile',
- 'cm' => 'Cameroon',
- 'cn' => 'China',
- 'co' => 'Colombia',
- 'cr' => 'Costa Rica',
- 'cs' => 'Czechoslovakia',
- 'cu' => 'Cuba',
- 'cv' => 'Cape Verde',
- 'cx' => 'Christmas Island',
- 'cy' => 'Cyprus',
- 'cz' => 'Czech Republic',
- 'de' => 'Germany',
- 'dj' => 'Djibouti',
- 'dk' => 'Denmark',
- 'dm' => 'Dominica',
- 'do' => 'Dominican Republic',
- 'dz' => 'Algeria',
- 'ec' => 'Ecuador',
- 'ee' => 'Estonia',
- 'eg' => 'Egypt',
- 'eh' => 'Western Sahara',
- 'er' => 'Eritrea',
- 'es' => 'Spain',
- 'et' => 'Ethiopia',
- 'fi' => 'Finland',
- 'fj' => 'Fiji',
- 'fk' => 'Falkland Islands (Malvibas)',
- 'fm' => 'Micronesia',
- 'fo' => 'Faroe Islands',
- 'fr' => 'France',
- 'fx' => 'France (European Territory)',
- 'ga' => 'Gabon',
- 'gb' => 'Great Britain',
- 'gd' => 'Grenada',
- 'ge' => 'Georgia',
- 'gf' => 'Guyana (French)',
- 'gh' => 'Ghana',
- 'gi' => 'Gibralta',
- 'gl' => 'Greenland',
- 'gm' => 'Gambia',
- 'gn' => 'Guinea',
- 'gp' => 'Guadeloupe (French)',
- 'gq' => 'Equatorial Guinea',
- 'gr' => 'Greece',
- 'gs' => 'South Georgia & South Sandwich Islands',
- 'gt' => 'Guatemala',
- 'gu' => 'Guam (US)',
- 'gw' => 'Guinea Bissau',
- 'gy' => 'Guyana',
- 'hk' => 'Hong Kong',
- 'hm' => 'Heard & McDonald Islands',
- 'hn' => 'Honduras',
- 'hr' => 'Croatia',
- 'ht' => 'Haiti',
- 'hu' => 'Hungary',
- 'id' => 'Indonesia',
- 'ie' => 'Ireland',
- 'il' => 'Israel',
- 'in' => 'India',
- 'io' => 'British Indian Ocean Territories',
- 'iq' => 'Iraq',
- 'ir' => 'Iran',
- 'is' => 'Iceland',
- 'it' => 'Italy',
- 'jm' => 'Jamaica',
- 'jo' => 'Jordan',
- 'jp' => 'Japan',
- 'ke' => 'Kenya',
- 'kg' => 'Kyrgyz Republic',
- 'kh' => 'Cambodia',
- 'ki' => 'Kiribati',
- 'km' => 'Comoros',
- 'kn' => 'Saint Kitts Nevis Anguilla',
- 'kp' => 'Korea (North)',
- 'kr' => 'Korea (South)',
- 'kw' => 'Kuwait',
- 'ky' => 'Cayman Islands',
- 'kz' => 'Kazachstan',
- 'la' => 'Laos',
- 'lb' => 'Lebanon',
- 'lc' => 'Saint Lucia',
- 'li' => 'Liechtenstein',
- 'lk' => 'Sri Lanka',
- 'lr' => 'Liberia',
- 'ls' => 'Lesotho',
- 'lt' => 'Lithuania',
- 'lu' => 'Luxembourg',
- 'lv' => 'Latvia',
- 'ly' => 'Libya',
- 'ma' => 'Morocco',
- 'mc' => 'Monaco',
- 'md' => 'Moldova',
- 'mg' => 'Madagascar',
- 'mh' => 'Marshall Islands',
- 'mk' => 'Macedonia',
- 'ml' => 'Mali',
- 'mm' => 'Myanmar',
- 'mn' => 'Mongolia',
- 'mo' => 'Macau',
- 'mp' => 'Northern Mariana Islands',
- 'mq' => 'Martinique (French)',
- 'mr' => 'Mauretania',
- 'ms' => 'Montserrat',
- 'mt' => 'Malta',
- 'mu' => 'Mauritius',
- 'mv' => 'Maldives',
- 'mw' => 'Malawi',
- 'mx' => 'Mexico',
- 'my' => 'Malaysia',
- 'mz' => 'Mozambique',
- 'na' => 'Namibia',
- 'nc' => 'New Caledonia (French)',
- 'ne' => 'Niger',
- 'nf' => 'Norfolk Island',
- 'ng' => 'Nigeria',
- 'ni' => 'Nicaragua',
- 'nl' => 'Netherlands',
- 'no' => 'Norway',
- 'np' => 'Nepal',
- 'nr' => 'Nauru',
- 'nt' => 'Saudiarab. Irak)',
- 'nu' => 'Niue',
- 'nz' => 'New Zealand',
- 'om' => 'Oman',
- 'pa' => 'Panama',
- 'pe' => 'Peru',
- 'pf' => 'Polynesia (French)',
- 'pg' => 'Papua New Guinea',
- 'ph' => 'Philippines',
- 'pk' => 'Pakistan',
- 'pl' => 'Poland',
- 'pm' => 'Saint Pierre & Miquelon',
- 'pn' => 'Pitcairn',
- 'pr' => 'Puerto Rico (US)',
- 'pt' => 'Portugal',
- 'pw' => 'Palau',
- 'py' => 'Paraguay',
- 'qa' => 'Qatar',
- 're' => 'Reunion (French)',
- 'ro' => 'Romania',
- 'ru' => 'Russian Federation',
- 'rw' => 'Rwanda',
- 'sa' => 'Saudi Arabia',
- 'sb' => 'Salomon Islands',
- 'sc' => 'Seychelles',
- 'sd' => 'Sudan',
- 'se' => 'Sweden',
- 'sg' => 'Singapore',
- 'sh' => 'Saint Helena',
- 'si' => 'Slovenia',
- 'sj' => 'Svalbard & Jan Mayen',
- 'sk' => 'Slovakia',
- 'sl' => 'Sierra Leone',
- 'sm' => 'San Marino',
- 'sn' => 'Senegal',
- 'so' => 'Somalia',
- 'sr' => 'Suriname',
- 'st' => 'Sao Tome & Principe',
- 'su' => 'Soviet Union',
- 'sv' => 'El Salvador',
- 'sy' => 'Syria',
- 'sz' => 'Swaziland',
- 'tc' => 'Turks & Caicos Islands',
- 'td' => 'Chad',
- 'tf' => 'French Southern Territories',
- 'tg' => 'Togo',
- 'th' => 'Thailand',
- 'tj' => 'Tadjikistan',
- 'tk' => 'Tokelau',
- 'tm' => 'Turkmenistan',
- 'tn' => 'Tunisia',
- 'to' => 'Tonga',
- 'tp' => 'East Timor',
- 'tr' => 'Turkey',
- 'tt' => 'Trinidad & Tobago',
- 'tv' => 'Tuvalu',
- 'tw' => 'Taiwan',
- 'tz' => 'Tanzania',
- 'ua' => 'Ukraine',
- 'ug' => 'Uganda',
- 'uk' => 'United Kingdom',
- 'um' => 'US Minor outlying Islands',
- 'us' => 'United States',
- 'uy' => 'Uruguay',
- 'uz' => 'Uzbekistan',
- 'va' => 'Vatican City State',
- 'vc' => 'St Vincent & Grenadines',
- 've' => 'Venezuela',
- 'vg' => 'Virgin Islands (British)',
- 'vi' => 'Virgin Islands (US)',
- 'vn' => 'Vietnam',
- 'vu' => 'Vanuatu',
- 'wf' => 'Wallis & Futuna Islands',
- 'ws' => 'Samoa',
- 'ye' => 'Yemen',
- 'yt' => 'Mayotte',
- 'yu' => 'Yugoslavia',
- 'za' => 'South Africa',
- 'zm' => 'Zambia',
- 'zr' => 'Zaire',
- 'zw' => 'Zimbabwe'
- );
-
-
- function __construct($order)
- {
- /* constructor */
- $sql = e107::getDB();
-
- /* get today's logfile ... */
- $logfile = e_LOG.'logp_'.date('z.Y', time()).'.php';
- // $logfile = e_PLUGIN.'log/logs/logp_'.date('z.Y', time()).'.php';
- if(is_readable($logfile))
- {
- require($logfile);
- }
- // $logfile = e_PLUGIN.'log/logs/logi_'.date('z.Y', time()).'.php';
- $logfile = e_LOG.'logi_'.date('z.Y', time()).'.php';
- if(is_readable($logfile))
- {
- require($logfile);
- }
-
- $this -> filesiteTotal = vartrue($siteTotal);
- $this -> filesiteUnique = vartrue($siteUnique);
-
- /* set order var */
- $this -> order = $order;
-
- $this -> fileInfo = vartrue($pageInfo);
- $this -> fileBrowserInfo = vartrue($browserInfo);
- $this -> fileOsInfo = vartrue($osInfo);
- $this -> fileScreenInfo = vartrue($screenInfo);
- $this -> fileDomainInfo = vartrue($domainInfo);
- $this -> fileReferInfo = vartrue($refInfo);
- $this -> fileQueryInfo = vartrue($searchInfo);
- $this -> fileRecent = vartrue($visitInfo);
-
- /* get main stat info from database */
- if($sql->select('logstats', 'log_data', "log_id='pageTotal'"))
- {
- $row = $sql ->fetch();
- $this -> dbPageInfo = unserialize($row['log_data']);
- }
- else
- {
- $this -> dbPageInfo = array();
- }
-
- /* temp consolidate today's info (if it exists)... */
- if(is_array($pageInfo))
- {
- foreach($pageInfo as $key => $info)
- {
- $key = preg_replace("/\?.*/", "", $key);
- if(array_key_exists($key, $this -> dbPageInfo))
- {
- $this -> dbPageInfo[$key]['ttlv'] += $info['ttl'];
- $this -> dbPageInfo[$key]['unqv'] += $info['unq'];
- }
- else
- {
- $this -> dbPageInfo[$key]['url'] = $info['url'];
- $this -> dbPageInfo[$key]['ttlv'] = $info['ttl'];
- $this -> dbPageInfo[$key]['unqv'] = $info['unq'];
- }
- }
- }
-
- $this -> bar = (file_exists(THEME.'images/bar.png') ? THEME.'images/bar.png' : e_IMAGE.'generic/bar.png');
-
-
- $this->plugFolder = e107::getFolder('plugins');
-
- /* end constructor */
- }
-
- function renderNav($action)
- {
- // $path = e_PLUGIN_ABS.'log/stats.php';
- $path = e_REQUEST_SELF;
-
- $links = array(
- 1 => array('label' => ADSTAT_L8, 'pref' => null),
- 2 => array('label' => ADSTAT_L9, 'pref' => null),
- 10 => array('label' => ADSTAT_L10, 'pref' => null),
- 11 => array('label' => ADSTAT_L11, 'pref' => null),
- 3 => array('label' => ADSTAT_L12, 'pref' => 'statBrowser'),
- 4 => array('label' => ADSTAT_L13, 'pref' => 'statOs'),
- 5 => array('label' => ADSTAT_L14, 'pref' => 'statDomain'),
- 6 => array('label' => ADSTAT_L15, 'pref' => 'statScreen'),
- 7 => array('label' => ADSTAT_L16, 'pref' => 'statRefer'),
- 8 => array('label' => ADSTAT_L17, 'pref' => 'statQuery'),
- 9 => array('label' => ADSTAT_L18, 'pref' => 'statRecent'),
- );
-
- if(ADMIN == true)
- {
- $links[12] = array('label' => ADSTAT_L43, 'pref' => null);
- $links[13] = array('label' => ADSTAT_L44, 'pref' => null);
- }
-
- $lk = array();
-
- foreach($links as $id => $val)
- {
- if($val['pref'] == null || e107::getPref($val['pref']))
- {
- $selected = ($id === $action) ? "class='active'" : "";
- $lk[] = "".$val['label']."";
- }
- }
-
- if(deftrue('BOOTSTRAP'))
- {
- return "".e107::getForm()->button('statNav',$lk,'dropdown',$links[$action]['label'], array('align'=>'right','class'=>'btn-primary'))."
";
- }
-
- return "".implode(" | ", $lk)."
";
- }
-
- /**
- * sorts multi-dimentional array based on which field is passed
- *
- * @param array $array - the array to sort
- * @param string $column - name of column to sort by
- * @param string $order SORT_DESC|SORT_ASC - sort order
- */
- function arraySort($array, $column, $order = SORT_DESC)
- {
- $i=0;
- $sortarr = array();
- foreach($array as $info)
- {
- $sortarr[]=$info[$column];
- $i++;
- }
- array_multisort($sortarr, $order, $array, $order);
- return($array);
- /* end method */
- }
-
-
- function getLabel($key,$truncate=false)
- {
- list($url,$language) = explode("|",$key);
-
- $url = str_replace($this->plugFolder,'',$url);
-
-
-
- if($truncate)
- {
- $result = e107::getParser()->text_truncate($url,50);
-
- return $result;
- }
-
- return trim($url);
- }
-
-
-
-
- /**
- * renders information for today only
- *
- * @param boolean $do_errors - FALSE to show 'normal' accesses, TRUE to show error accesses (i.e. invalid pages)
- *
- * @return string text for display
- */
- function renderTodaysVisits($do_errors = FALSE)
- {
- $tp = e107::getParser();
- $template = e107::getTemplate('log', 'log', 'todaysvisits', true, true);
-
- $do_errors = $do_errors && ADMIN && getperms('P'); // Only admins can see page errors
-
- // Now run through and keep either the non-error pages, or the error pages, according to $do_errors
- $totalArray = array();
- $totalv = 0;
- $totalu = 0;
- $total = 0;
- foreach ($this -> fileInfo as $k => $v)
- {
- $found = (strpos($k,'error/') === 0);
- if ($do_errors XOR !$found)
- {
- $totalArray[$k] = $v;
- $total += (int) vartrue($v['ttlv']);
- }
- }
- $totalArray = $this -> arraySort($totalArray, "ttl");
-
- foreach($totalArray as $key => $info)
- {
- $totalv += $info['ttl'];
- $totalu += $info['unq'];
- }
-
- $text = $template['start'];
-
- foreach($totalArray as $key => $info)
- {
- if($info['ttl'])
- {
- $percentage = round(($info['ttl']/$totalv) * 100, 2);
-
- $var = array('ITEM_URL' => $info['url'],
- 'ITEM_IMAGE' => ($image ? "
" : ""),
- 'ITEM_KEY' => $this->getLabel($key),
- 'ITEM_BAR' => $this -> bar($percentage, $info['ttl']." [".$info['unq']."]"),
- 'ITEM_PERC'=> $percentage,
- );
-
- $text .= $tp->simpleParse($template['item'], $var);
-
- }
- }
- $var = array('TOTALV' => $totalv,
- 'TOTALU' => $totalu,
- );
- $text .= $tp->simpleParse($template['end'], $var);
-
- return $text;
- }
-
-
-
-
- /**
- * Renders information for alltime, total and unique
- *
- * @param string $action - value to incorporate in query part of clickable links
- * @param boolean $do_errors - FALSE to show 'normal' accesses, TRUE to show error accesses (i.e. invalid pages)
- *
- * @return string text for display
- */
- function renderAlltimeVisits($action, $do_errors = FALSE)
- {
- $sql = e107::getDB();
- $tp = e107::getParser();
- $template = e107::getTemplate('log', 'log', 'alltimevisits_total', true, true);
-
- $text = '';
- $sql->select("logstats", "*", "log_id='pageTotal' ");
- $row = $sql->fetch();
- $pageTotal = unserialize($row['log_data']);
- $total = 0;
-
- $can_delete = ADMIN && getperms("P");
- $do_errors = $do_errors && $can_delete;
-
- foreach($this -> fileInfo as $url => $tmpcon)
- {
- $pageTotal[$url]['url'] = $tmpcon['url'];
- $pageTotal[$url]['ttlv'] += $tmpcon['ttl'];
- $pageTotal[$url]['unqv'] += $tmpcon['unq'];
- }
-
- // Now run through and keep either the non-error pages, or the error pages, according to $do_errors
- $totalArray = array();
- foreach ($pageTotal as $k => $v)
- {
- $found = (strpos($k,'error/') === 0);
- if ($do_errors XOR !$found)
- {
- $totalArray[$k] = $v;
- $total += $v['ttlv'];
- }
- }
-
- $totalArray = $this -> arraySort($totalArray, "ttlv");
-
- $text .= $template['start'];
-
-
- foreach($totalArray as $key => $info)
- {
- if($info['ttlv'])
- {
- if (!$info['url'] && (($key == 'index') || (strpos($key,':index') !== FALSE))) $info['url'] = e_HTTP.'index.php'; // Avoids empty link
- $percentage = round(($info['ttlv']/$total) * 100, 2);
-
- $var = array('ITEM_URL' => $info['url'],
- 'ITEM_IMAGE' => ($image ? "
" : ""),
- 'ITEM_KEY' => $this->getLabel($key,true),
- 'ITEM_TITLE' => $this->getLabel($key),
- 'ITEM_BAR' => $this->bar($percentage, $info['ttlv']),
- 'ITEM_PERC'=> $percentage,
- 'ITEM_DELETE'=> ($can_delete ? "
-
" : ""),
- );
- $text .= $tp->simpleParse($template['item'], $var);
- }
- }
-
- $var = array('TOTAL' => number_format($total),
- );
- $text .= $tp->simpleParse($template['end'], $var);
-
- $template = e107::getTemplate('log', 'log', 'alltimevisits_unique', true, true);
-
- $uniqueArray = array();
- $totalv = 0;
- foreach ($this -> dbPageInfo as $k => $v)
- {
- $found = (strpos($k,'error/') === 0);
- if ($do_errors XOR !$found)
- {
- $uniqueArray[$k] = $v;
- $totalv += $v['unqv'];
- }
- }
- $uniqueArray = $this -> arraySort($uniqueArray, "unqv");
-
- $text .= $template['start'];
-
- foreach($uniqueArray as $key => $info)
- {
- if ($info['ttlv'])
- {
- 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);
-
- $var = array('ITEM_URL' => $info['url'],
- 'ITEM_KEY' => $tp->text_truncate($key, 50),
- 'ITEM_BAR' => $this -> bar($percentage, $info['unqv']),
- 'ITEM_PERC'=> $percentage,
- );
- $text .= $tp->simpleParse($template['item'], $var);
- }
- }
- $var = array('TOTAL' => number_format($totalv),
- );
- $text .= $tp->simpleParse($template['end'], $var);
- return $text;
- }
-
-
-
- /**
- * List browsers.
- * @param integer $selection is an array of the info required - '2' = current month's stats, '1' = all-time stats (default)
- * @param boolean $show_version - if FALSE, browsers are consolidated across versions - e.g. 1 line for Firefox using info from $browser_map
- *
- * @return string text for display
- */
- function renderBrowsers($selection = FALSE, $show_version=TRUE)
- {
- $sql = e107::getDB();
- $tp = e107::getParser();
- $template = e107::getTemplate('log', 'log', 'browsers', true, true);
-
-
- if (!$selection) $selection = array(1);
- if (!is_array($selection)) $selection = array(1);
- $text = '';
-
-
-
- foreach ($selection as $act)
- {
- unset($statBrowser);
- $statBrowser = array();
-
- $pars = make_bits('statBrowser',$act); // Get the query, plus maybe date for heading
- if (!is_array($pars)) return $pars; // Return error if necessary
-
- if ($entries = $sql->select('logstats', 'log_data', $pars['query']))
- {
- $row = $sql->fetch();
- $statBrowser = unserialize($row['log_data']);
- }
- else
- {
- continue; // No data - terminate this loop
- }
-
- /* temp consolidate today's data ... */
- if (($act == 1) || ($act == 2))
- {
- foreach($this->fileBrowserInfo as $name => $count)
- {
- $statBrowser[$name] += $count;
- }
- }
-
- if ($show_version == FALSE)
- {
- $temp_array = array();
- foreach ($statBrowser as $b_full=>$v)
- {
- $b_type = '';
- foreach ($this->browser_map as $name => $file)
- {
- if(stripos($b_full, $name) === 0)
- { // Match here
- $b_type = $name;
- break;
- }
- }
- if (!$b_type) $b_type = $b_full; // Default is an unsupported browser - use the whole name
-
- if (array_key_exists($b_type,$temp_array))
- {
- $temp_array[$b_type] += $v;
- }
- else
- {
- $temp_array[$b_type] = $v; // New browser found
- }
- }
- $statBrowser = $temp_array;
- unset($temp_array);
- }
-
-
- if ($this -> order)
- {
- ksort($statBrowser);
- reset ($statBrowser);
- $browserArray = $statBrowser;
- }
- else
- {
- $browserArray = $this -> arraySort($statBrowser, 0);
- }
-
- $total = array_sum($browserArray);
-
- $var = array('START_CAPTION' => $this->browser_headings[$act].$pars['hdg_extra'],
- 'START_TITLE' => ($this -> order ? ADSTAT_L48 : ADSTAT_L49),
- 'START_URL' => e_SELF."?".($show_version ? "3" : "14").($this -> order ? "" : ".1" ),
- );
- $text .= $tp->simpleParse($template['start'], $var);
-
- if (count($browserArray))
- {
- foreach($browserArray as $key => $info)
- {
- $image = "";
- foreach ($this->browser_map as $name => $file)
- {
- if(strpos($key, $name) !== false)
- {
- $image = "{$file}.png";
- break;
- }
- }
- if(empty($image))
- {
- $image = "unknown.png";
- }
- $percentage = round(($info/$total) * 100, 2);
- $var = array(
- 'ITEM_IMAGE' => ($image ? "
" : ""),
- 'ITEM_KEY' => $key,
- 'ITEM_BAR' => $this -> bar($percentage, $info),
- 'ITEM_PERC'=> $percentage,
- );
- $text .= $tp->simpleParse($template['item'], $var);
-
- $text .= "";
- }
-
- $var = array('TOTAL' => number_format($total),
- );
- $text .= $tp->simpleParse($template['end'], $var);
- }
- else
- {
- $text .= $tp->simpleParse($template['nostatistic'], null);
- }
- }
- return $text;
- }
-
-
-
-
- /**
- * Show operating systems.
- *
- * @param integer $selection is an array of the info required - '2' = current month's stats, '1' = all-time stats (default)
- * @param $show_version boolean - show different versions of the operating system if TRUE
- *
- * @return string text for display
- */
- function renderOses($selection = FALSE, $show_version=TRUE)
- {
- $sql = e107::getDB();
- $tp = e107::getParser();
- $template = e107::getTemplate('log', 'log', 'oses', true, true);
- if (!$selection) $selection = array(1);
- if (!is_array($selection)) $selection = array(1);
- $text = '';
-
-
- $statOs = array();
- foreach ($selection as $act)
- {
- $pars = make_bits('statOs',$act); // Get the query, plus maybe date for heading
- if (!is_array($pars)) return $pars; // Return error if necessary
-
- if ($entries = $sql->select("logstats", "*", $pars['query']))
- {
- $row = $sql -> fetch();
- $statOs = unserialize($row['log_data']);
- }
- else
- {
- continue; // No data - terminate this loop
- }
-
- /* temp consolidate today's data ... */
- if (($act == 1) || ($act == 2))
- {
- foreach($this -> fileOsInfo as $name => $count)
- {
- $statOs[$name] += $count;
- }
- }
-
-
- if ($show_version == FALSE)
- {
- $temp_array = array();
- foreach ($statOs as $b_full=>$v)
- {
- $b_type = '';
- foreach ($this->oses_map as $name => $file)
- {
- if(stripos($b_full, $name) === 0)
- { // Match here
- $b_type = $name;
- break;
- }
- }
- if (!$b_type) $b_type = $b_full; // Default is an unsupported browser - use the whole name
-
- if (array_key_exists($b_type,$temp_array))
- {
- $temp_array[$b_type] += $v;
- }
- else
- {
- $temp_array[$b_type] = $v; // New browser found
- }
- }
- $statOs = $temp_array;
- unset($temp_array);
- }
-
-
-
- if($this -> order)
- {
- ksort($statOs);
- reset ($statOs);
- $osArray = $statOs;
- }
- else
- {
- $osArray = $this->arraySort($statOs, 0);
- }
-
- $total = array_sum($osArray);
- $var = array('START_CAPTION' => $this->browser_headings[$act].$pars['hdg_extra'],
- 'START_TITLE' => ($this -> order ? "sort by total" : "sort alphabetically"),
- 'START_URL' => e_SELF."?".($show_version ? "4" : "15").($this -> order ? "" : ".1" ),
- );
- $text .= $tp->simpleParse($template['start'], $var);
-
-
- if (count($osArray))
- {
- foreach($osArray as $key => $info)
- {
- $image = "";
- if(strpos($key, "Windows") !== false) { $image = "windows.png"; }
- elseif(strpos($key, "Mac") !== false) { $image = "mac.png"; }
- elseif(strpos($key, "Linux") !== false) { $image = "linux.png"; }
- elseif(strpos($key, "BeOS") !== false) { $image = "beos.png"; }
- elseif(strpos($key, "FreeBSD") !== false) { $image = "freebsd.png"; }
- elseif(strpos($key, "NetBSD") !== false) { $image = "netbsd.png"; }
- elseif(strpos($key, "Unspecified") !== false) { $image = "unspecified.png"; }
- elseif(strpos($key, "OpenBSD") !== false) { $image = "openbsd.png"; }
- elseif(strpos($key, "Unix") !== false) { $image = "unix.png"; }
- elseif(strpos($key, "Spiders") !== false) { $image = "spiders.png"; }
- elseif(stripos($key, "Android") !== false) { $image = "android.png"; }
-
- $percentage = round(($info/$total) * 100, 2);
- $var = array(
- 'ITEM_IMAGE' => ($image ? "
" : ""),
- 'ITEM_KEY' => $key,
- 'ITEM_BAR' => $this -> bar($percentage, $info),
- 'ITEM_PERC'=> $percentage,
- );
- $text .= $tp->simpleParse($template['item'], $var);
- }
- $var = array('TOTAL' => number_format($total));
-
- $text .= $tp->simpleParse($template['end'], $var);
- }
- else
- {
- $text .= $tp->simpleParse($template['nostatistic'], null);
- }
- }
- return $text;
- }
-
-
-
- /**
- * Show domains of users
- *
- * @param integer $selection is an array of the info required - '2' = current month's stats, '1' = all-time stats (default)
- *
- * @return string text for display
- */
- function renderDomains($selection = FALSE)
- {
- $sql = e107::getDB();
- $tp = e107::getParser();
- $template = e107::getTemplate('log', 'log', 'domains', true, true);
-
- if (!$selection) $selection = array(1);
- if (!is_array($selection)) $selection = array(1);
- $text = '';
-
- $statDom = array();
- foreach ($selection as $act)
- {
- $pars = make_bits('statDomain',$act); // Get the query, plus maybe date for heading
- if (!is_array($pars)) return $pars; // Return error if necessary
-
- if ($entries = $sql->select('logstats', 'log_data', $pars['query']))
- {
- $row = $sql -> fetch();
- $statDom = unserialize($row['log_data']);
- }
- else
- {
- continue; // No data - terminate this loop
- }
-
- /* temp consolidate today's data ... */
- if (($act == 1) || ($act == 2))
- {
- foreach($this -> fileDomainInfo as $name => $count)
- {
- $statDom[$name] += $count;
- }
- }
-
- if($this -> order)
- {
- ksort($statDom);
- reset ($statDom);
- $domArray = $statDom;
- }
- else
- {
- $domArray = $this -> arraySort($statDom, 0);
- }
-
- $total = array_sum($domArray);
- $var = array('START_CAPTION' => $this->browser_headings[$act].$pars['hdg_extra'],
- 'START_TITLE' => ($this -> order ? "sort by total" : "sort alphabetically"),
- 'START_URL' => e_SELF."?5".($this -> order ? "" : ".1" ),
- );
- $text .= $tp->simpleParse($template['start'], $var);
-
- if (count($domArray))
- {
- foreach($domArray as $key => $info)
- {
- if($key = $this -> getcountry($key))
- {
- $percentage = round(($info/$total) * 100, 2);
- $var = array(
- 'ITEM_KEY' => $key,
- 'ITEM_BAR' => $this -> bar($percentage, $info),
- 'ITEM_PERC'=> $percentage,
- );
- $text .= $tp->simpleParse($template['item'], $var);
- }
- }
- //before: $var = array('TOTAL' => $total,
- $var = array('TOTAL' => number_format($total));
- $text .= $tp->simpleParse($template['end'], $var);
- }
- else
- {
- $text .= $tp->simpleParse($template['nostatistic'], null);
- }
- }
- return $text;
- }
-
-
-
-
- /**
- * Show screen resolutions
- *
- * @param integer $selection is an array of the info required - '2' = current month's stats, '1' = all-time stats (default)
- *
- * @return string text for display
- */
- function renderScreens($selection = FALSE)
- {
- $sql = e107::getDB();
- $tp = e107::getParser();
- $template = e107::getTemplate('log', 'log', 'screens', true, true);
-
- if (!$selection) $selection = array(1);
- if (!is_array($selection)) $selection = array(1);
- $text = '';
-
- $statScreen = array();
- foreach ($selection as $act)
- {
- $pars = make_bits('statScreen',$act); // Get the query, plus maybe date for heading
- if (!is_array($pars)) return $pars; // Return error if necessary
-
- if ($entries = $sql->select('logstats', 'log_data', $pars['query']))
- {
- $row = $sql -> fetch();
- $statScreen = unserialize($row['log_data']);
- }
- else
- {
- continue; // No data - terminate this loop
- }
-
- /* temp consolidate today's data ... */
- if (($act == 1) || ($act == 2))
- {
- foreach($this -> fileScreenInfo as $name => $count)
- {
- $statScreen[$name] += $count;
- }
- }
-
-
- if($this -> order)
- {
- $nsarray = array();
- foreach($statScreen as $key => $info)
- {
- if(preg_match("/(\d+)x/", $key, $match))
- {
- $nsarray[$key] = array('width' => $match[1], 'info' => $info);
- }
- }
- $nsarray = $this -> arraySort($nsarray, 'width', SORT_ASC);
- reset($nsarray);
- $screenArray = array();
- foreach($nsarray as $key => $info)
- {
- $screenArray[$key] = $info['info'];
- }
- }
- else
- {
- $screenArray = $this -> arraySort($statScreen, 0);
- }
-
- $total = array_sum($screenArray);
- $var = array('START_CAPTION' => $this->browser_headings[$act].$pars['hdg_extra'],
- 'START_TITLE' => ($this -> order ? "sort by total" : "sort alphabetically"),
- 'START_URL' => e_SELF."?6".($this -> order ? "" : ".1" ),
- );
- $text .= $tp->simpleParse($template['start'], $var);
-
- if (count($screenArray))
- {
- foreach($screenArray as $key => $info)
- {
- if(strpos($key, "@") !== false && strpos($key, "undefined") === false && preg_match("/(\d+)x(\d+)@(\d+)/", $key))
- {
- $percentage = round(($info/$total) * 100, 2);
- $var = array(
- 'ITEM_IMAGE' => ($image ? "
" : ""),
- 'ITEM_KEY' => $key,
- 'ITEM_BAR' => $this -> bar($percentage, $info),
- 'ITEM_PERC'=> $percentage,
- );
- $text .= $tp->simpleParse($template['item'], $var);
- }
- }
- //before: $var = array('TOTAL' => $total,
- $var = array('TOTAL' => number_format($total));
- $text .= $tp->simpleParse($template['end'], $var);
- }
- else
- {
- $text .= $tp->simpleParse($template['nostatistic'], null);
- }
-
- }
- return $text;
- }
-
-
-
- /**
- * Show referrers
- *
- * @param integer $selection is an array of the info required - '2' = current month's stats, '1' = all-time stats (default)
- *
- * @return string text for display
- */
- function renderRefers($selection = FALSE)
- {
- $sql = e107::getDB();
- $tp = e107::getParser();
- $template = e107::getTemplate('log', 'log', 'refers', true, true);
-
- if (!$selection) $selection = array(1);
- if (!is_array($selection)) $selection = array(1);
- $text = '';
-
- $statRefer = array();
- foreach ($selection as $act)
- {
- $pars = make_bits('statReferer',$act); // Get the query, plus maybe date for heading
- if (!is_array($pars)) return $pars; // Return error if necessary
-
- if ($entries = $sql->select('logstats', 'log_data', $pars['query']))
- {
- $row = $sql -> fetch();
- $statRefer = unserialize($row['log_data']);
- }
- else
- {
- continue; // No data - terminate this loop
- }
-
- /* temp consolidate today's data ... */
- if (($act == 1) || ($act == 2))
- {
- foreach($this -> fileReferInfo as $name => $count)
- {
- $statRefer[$name]['url'] = $count['url'];
- $statRefer[$name]['ttl'] += $count['ttl'];
- }
- }
-
- $statArray = $this -> arraySort($statRefer, 'ttl');
- $total = 0;
- foreach ($statArray as $key => $info)
- {
- $total += $info['ttl'];
- }
- $var = array('START_CAPTION' => $this->browser_headings[$act].$pars['hdg_extra'],
- 'START_TITLE' => $this -> order ? "show cropped url" : "show full url",
- 'START_URL' => e_SELF."?7".($this -> order ? "" : ".1" ),
- );
- $text .= $tp->simpleParse($template['start'], $var);
-
-
- $count = 0;
- if (count($statArray))
- {
- foreach($statArray as $key => $info)
- {
- $percentage = round(($info['ttl']/$total) * 100, 2);
- if (!$this -> order && strlen($key) > 50)
- {
- $key = substr($key, 0, 50)." ...";
- }
-
- $var = array(
- 'ITEM_IMAGE' => ($image ? "
" : ""),
- 'ITEM_URL' => $info['url'],
- 'ITEM_KEY' => $key,
- 'ITEM_BAR' => $this -> bar($percentage, $info['ttl']),
- 'ITEM_PERC'=> $percentage,
- );
- $text .= $tp->simpleParse($template['item'], $var);
-
- $count++;
- if($count == e107::getPref('statDisplayNumber'))
- {
- break;
- }
- }
- //before: $var = array('TOTAL' => $total,
- $var = array('TOTAL' => number_format($total));
- $text .= $tp->simpleParse($template['end'], $var);
- }
- else
- {
- $text .= $tp->simpleParse($template['nostatistic'], null);
- }
- }
- return $text;
- }
-
-
-
-
- /**
- * Show search queries
- *
- * @param integer $selection is an array of the info required - '2' = current month's stats, '1' = all-time stats (default)
- *
- * @return string - text for display
- */
- function renderQueries($selection = FALSE)
- {
- $sql = e107::getDB();
- $tp = e107::getParser();
- $template = e107::getTemplate('log', 'log', 'queries', true, true);
-
- if (!$selection) $selection = array(1);
- if (!is_array($selection)) $selection = array(1);
- $text = '';
-
- $statQuery = array();
- foreach ($selection as $act)
- {
- $pars = make_bits('statQuery',$act); // Get the query, plus maybe date for heading
- if (!is_array($pars)) return $pars; // Return error if necessary
-
- if ($entries = $sql->select("logstats", "*", $pars['query']))
- {
- $row = $sql -> fetch();
- $statQuery = unserialize($row['log_data']);
- }
- else
- {
- continue; // No data - terminate this loop
- }
-
- /* temp consolidate today's data ... */
- if (($act == 1) || ($act == 2))
- {
- foreach ($this -> fileQueryInfo as $name => $count)
- {
- $statQuery[$name] += $count;
- }
- }
-
-
- $queryArray = $this -> arraySort($statQuery, 0);
- $total = array_sum($queryArray);
- $text .= "
- \n
-
- ".$this->browser_headings[$act].$pars['hdg_extra']." |
-
-
- ".ADSTAT_L31." |
- ".ADSTAT_L21." |
- % |
-
\n";
-
- $count = 1;
- if (count($queryArray))
- {
- foreach ($queryArray as $key => $info)
- {
- $percentage = round(($info/$total) * 100, 2);
- $key = str_replace("%20", " ", $key);
- $text .= "
-
-
-
-
\n";
- $count ++;
- if($count == e107::getPref('statDisplayNumber'))
- {
- break;
- }
- }
- $text .= "
\n";
- }
- else
- {
- $text .= "".ADSTAT_L25." |
\n";
- }
- $text .= "
";
- }
- return $text;
- }
-
-
-
- /**
- * Display list of recent visitors to site - essentially up to (currently 20) of the entries from today's stats
- *
- * @return string - text for display
- */
- function recentVisitors()
- {
-
- $tp = e107::getParser();
- $template = e107::getTemplate('log', 'log', 'visitors', true, true);
-
- if(!is_array($this -> fileRecent) || !count($this -> fileRecent))
- {
- return "".ADSTAT_L25.".
";
- }
-
- $gen = new convert;
- $recentArray = array_reverse($this -> fileRecent, TRUE);
- $text = "
-
-
- ".ADSTAT_L18." |
- ".ADSTAT_L53." |
-
\n";
-
- foreach($recentArray as $key => $info)
- {
- if(is_array($info))
- {
- $host = $info['host'];
- $datestamp = $info['date'];
- $os = $info['os'];
- $browser = $info['browser'];
- $screen = $info['screen'];
- $referer = $info['referer'];
- }
- else
- {
- list($host, $datestamp, $os, $browser, $screen, $referer) = explode(chr(1), $info);
- }
- $datestamp = $gen -> convert_date($datestamp, "long");
-
- $text .= "
-
-
-
\n";
- }
-
- $text .= "
";
- return $text;
- }
-
-
-
- /**
- * Show the daily stats - total visits and unique visits
- *
- * @return string - text for display
- */
- function renderDaily()
- {
- $sql = e107::getDB();
- $tp = e107::getParser();
- $template = e107::getTemplate('log', 'log', 'daily', true, true);
-
- $td = date("Y-m-j", time());
- $dayarray[$td] = array();
- $pagearray = array();
-
- $qry = "
- SELECT * from #logstats WHERE log_id REGEXP('[[:digit:]]+\-[[:digit:]]+\-[[:digit:]]+')
- ORDER BY CONCAT(LEFT(log_id,4), SUBSTRING(log_id, 6, 2), LPAD(SUBSTRING(log_id, 9), 2, '0'))
- DESC LIMIT 0,14
- ";
-
- if($amount = $sql->gen($qry))
- {
- $array = $sql -> db_getList();
-
- $ttotal = 0;
- $utotal = 0;
-
- foreach($array as $key => $value)
- {
- extract($value);
- if(is_array($log_data)) {
- $entries[0] = $log_data['host'];
- $entries[1] = $log_data['date'];
- $entries[2] = $log_data['os'];
- $entries[3] = $log_data['browser'];
- $entries[4] = $log_data['screen'];
- $entries[5] = $log_data['referer'];
- }
- else
- {
- $entries = explode(chr(1), $log_data);
- }
-
- $dayarray[$log_id]['daytotal'] = $entries[0];
- $dayarray[$log_id]['dayunique'] = $entries[1];
-
- unset($entries[0]);
- unset($entries[1]);
-
- foreach($entries as $entry)
- {
- if($entry)
- {
- list($url, $total, $unique) = explode("|", $entry);
- if(strpos($url, "/") !== false)
- {
- $urlname = preg_replace("/\.php|\?.*/", "", substr($url, (strrpos($url, "/")+1)));
- }
- else
- {
- $urlname = preg_replace("/\.php|\?.*/", "", $url);
- }
- $dayarray[$log_id][$urlname] = array('url' => $url, 'total' => $total, 'unique' => $unique);
- if (!isset($pagearray[$urlname]['total'])) $pagearray[$urlname]['total'] = 0;
- if (!isset($pagearray[$urlname]['unique'])) $pagearray[$urlname]['unique'] = 0;
- $pagearray[$urlname]['total'] += $total;
- $pagearray[$urlname]['unique'] += $unique;
- $ttotal += $total;
- $utotal += $unique;
- }
- }
- }
- }
-
- foreach($this -> fileInfo as $fkey => $fvalue)
- {
- $dayarray[$td][$fkey]['total'] += $fvalue['ttl'];
- $dayarray[$td][$fkey]['unique'] += $fvalue['unq'];
- $dayarray[$td]['daytotal'] += $fvalue['ttl'];
- $dayarray[$td]['dayunique'] += $fvalue['unq'];
- $pagearray[$fkey]['total'] += $fvalue['ttl'];
- $pagearray[$fkey]['unique'] += $fvalue['unq'];
- $ttotal += $fvalue['ttl'];
- $utotal += $fvalue['unq'];
- }
-
- // print_a($dayarray);;
-
- $text = "
-
-
- ".ADSTAT_L33." ".($amount+1)." ".ADSTAT_L40." |
- ".ADSTAT_L34." |
-
\n";
-
- foreach($dayarray as $date => $total)
- {
- if (!isset($total['daytotal'])) $total['daytotal'] = 0;
- list($year, $month, $day) = explode("-", $date);
- $date = strftime ("%A, %B %d", mktime (0,0,0,$month,$day,$year));
- $barWidth = round(($total['daytotal']/$ttotal) * 100, 2);
- $text .= "
-
-
-
\n";
- }
-
- $text .= "
";
- $text .= "
-
-
- ".ADSTAT_L35." ".($amount+1)." ".ADSTAT_L40." |
- ".ADSTAT_L34." |
-
\n";
-
-
- if (!isset($total['dayunique'])) $total['dayunique'] = 0;
- if (!isset($total['total'])) $total['total']= 0;
-
- foreach($dayarray as $date => $total)
- {
- if (!isset($total['dayunique'])) $total['dayunique'] = 0;
- list($year, $month, $day) = explode("-", $date);
- $date = strftime ("%A, %B %d", mktime (0,0,0,$month,$day,$year));
- $barWidth = round(($total['dayunique']/$utotal) * 100, 2);
- $text .= "
-
-
-
\n";
- }
- $text .= "
";
-
- $text .= "
-
-
- ".ADSTAT_L33." ".($amount+1)." ".ADSTAT_L36." |
- ".ADSTAT_L34." |
-
\n";
-
- $newArray = $this -> arraySort($pagearray, "total");
- foreach($newArray as $key => $total)
- {
- $barWidth = round(($total['total']/$ttotal) * 100, 2);
- $text .= "
-
-
-
\n";
-
- }
- $text .= "
";
- $text .= "
-
-
-
- ".ADSTAT_L35." ".($amount+1)." ".ADSTAT_L36." |
- ".ADSTAT_L34." |
-
\n";
-
- $newArray = $this -> arraySort($pagearray, "unique");
-
- foreach($newArray as $key => $total) {
- $barWidth = round(($total['unique']/$utotal) * 100, 2);
- $text .= "
-
-
-
\n";
- }
- $text .= "
";
- return $text;
- }
-
-
-
-
- /**
- * Show monthly stats
- *
- * @return string text for display
- */
- function renderMonthly()
- {
- $sql = e107::getDB();
- $tp = e107::getParser();
- $template = e107::getTemplate('log', 'log', 'monthly', true, true);
-
- // Month format entries have log_id = yyyy-mm
- if(!$entries = $sql->select("logstats", "*", "log_id REGEXP('^[[:digit:]]+\-[[:digit:]]+$') ORDER BY CONCAT(LEFT(log_id,4), RIGHT(log_id,2)) DESC"))
- {
- return ADSTAT_L42;
- }
-
- $text = '';
- $array = $sql -> db_getList();
-
- $monthTotal = array(); // Array of totals, one per month, with 'totalv', 'uniquev' sub-indices
- $mtotal = 0;
- $utotal = 0;
-
- foreach($array as $info)
- {
- $date = $info['log_id'];
- $stats = unserialize($info['log_data']);
-
- /*
- Used to have to calculate monthly stats by adding the individual page access fields
- foreach($stats as $key => $total)
- {
- if (!isset($monthTotal[$date]['totalv'])) $monthTotal[$date]['totalv'] = 0;
- if (!isset($monthTotal[$date]['uniquev'])) $monthTotal[$date]['uniquev'] = 0;
- $monthTotal[$date]['totalv'] += $total['ttlv'];
- $monthTotal[$date]['uniquev'] += $total['unqv'];
- $mtotal += $total['ttlv'];
- $utotal += $total['unqv'];
- }
- */
- // Now we store a total, so just use that
- $monthTotal[$date]['totalv'] = varset($stats['TOTAL']['ttlv'], 0);
- $monthTotal[$date]['uniquev'] = varset($stats['TOTAL']['unqv'], 0);
- $mtotal += $monthTotal[$date]['totalv'];
- $utotal += $monthTotal[$date]['uniquev'];
- }
-
- $tmpArray = $this -> arraySort($monthTotal, "totalv");
-
- $text .= "
-
-
- ".ADSTAT_L37." |
- ".ADSTAT_L34." |
-
\n";
-
- foreach($monthTotal as $date => $total)
- {
- list($year, $month) = explode("-", $date);
- $date = strftime ("%B %Y", mktime (0,0,0,$month,1,$year));
- $barWidth = round(($total['totalv']/$mtotal) * 100, 2);
- $text .= "
- ".
- ($entries == 1 ? "" : "")."
-
\n";
- }
- $text .= "
";
-
- $text .= "
-
-
- ".ADSTAT_L38." |
- ".ADSTAT_L34." |
-
\n";
-
- foreach($monthTotal as $date => $total)
- {
- $barWidth = round(($total['uniquev']/$utotal) * 100, 2);
- list($year, $month) = explode("-", $date);
- $date = strftime ("%B %Y", mktime (0,0,0,$month,1,$year));
- $text .= "
- ".
- ($entries == 1 ? "" : "")."
-
\n";
- }
- $text .= "
";
-
-
- return $text;
- }
-
-
-
-
- function getWidthRatio ($array, $column)
- {
- $tmpArray = $this -> arraySort($array, $column);
- // $data = each($tmpArray);
- $data = key($tmpArray);
- $maxValue = $data[1]['totalv'];
- echo "maxValue ".$maxValue."
";
- $ratio = 0;
- while($maxValue > 100)
- {
- $maxValue = ($maxValue / 2);
- $ratio ++;
- }
- if(!$ratio)
- {
- return 1;
- }
- echo "ratio ".$ratio."
";
- return $ratio;
- }
-
-
-
- function getcountry($dom)
- {
- return $this->country[$dom];
- }
-
-
-
- /**
- * Generate value including a bar of width (horizontal 'length') as specified
- *
- * @param float $percen - percentage of full width for the bar
- * @param float $val - value to be displayed
- *
- * @return string text to be displayed
- */
- function bar($percen, $val,$name='')
- {
- if(deftrue('BOOTSTRAP'))
- {
- $text = e107::getForm()->progressBar($name,$percen);
- }
- else
- {
- $text = "";
- }
-
-
-
- $text .= "
-
- ".ADSTAT_L25." |
";
-
-$LOG_TEMPLATE['oses']['start'] = "
-