1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

moved counter_menu to the siteinfo_menu folder

This commit is contained in:
lia
2007-03-24 11:54:46 +00:00
parent 2e80b06926
commit fcb5971ce2
5 changed files with 35 additions and 38 deletions

View File

@@ -0,0 +1,81 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/siteinfo_menu/counter_menu.php,v $
| $Revision: 1.1 $
| $Date: 2007-03-24 11:54:46 $
| $Author: lisa_ $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
$text = "";
if (isset($pref['statActivate']) && $pref['statActivate'] == true) {
$pageName = preg_replace("/(\?.*)|(\_.*)|(\.php)/", "", basename (e_SELF));
$logfile = e_PLUGIN."log/logs/logp_".date("z.Y", time()).".php";
if(!is_readable($logfile))
{
if(ADMIN && !$pref['statCountAdmin'])
{
$text = COUNTER_L1;
}
$total = 1;
$unique = 1;
$siteTotal = 1;
$siteUnique = 1;
$totalever = 1;
$uniqueever = 1;
} else {
$text = "";
require($logfile);
if($sql -> db_Select("logstats", "*", "log_id='statTotal' OR log_id='statUnique' OR log_id='pageTotal'"))
{
while($row = $sql -> db_Fetch())
{
if($row['log_id'] == "statTotal")
{
$siteTotal += $row['log_data'];
}
else if($row['log_id'] == "statUnique")
{
$siteUnique += $row['log_data'];
}
else
{
$dbPageInfo = unserialize($row['log_data']);
$totalPageEver = ($dbPageInfo[$pageName]['ttlv'] ? $dbPageInfo[$pageName]['ttlv'] : 0);
$uniquePageEver = ($dbPageInfo[$pageName]['unqv'] ? $dbPageInfo[$pageName]['unqv'] : 0);
}
}
}
$pageName = preg_replace("/(\?.*)|(\_.*)|(\.php)/", "", basename (e_SELF));
$total = ($pageInfo[$pageName]['ttl'] ? $pageInfo[$pageName]['ttl'] : 0);
$unique = ($pageInfo[$pageName]['unq'] ? $pageInfo[$pageName]['unq'] : 0);
$totalever = ($pageInfo[$pageName]['ttlv'] ? $pageInfo[$pageName]['ttlv'] : 0) + $totalPageEver + $total;
$uniqueever = ($pageInfo[$pageName]['unqv'] ? $pageInfo[$pageName]['unqv'] : 0) + $uniquePageEver + $unique;
}
$text .= "<b>".COUNTER_L2."</b><br />".COUNTER_L3.": $total<br />".COUNTER_L5.": $unique<br /><br />
<b>".COUNTER_L4."</b><br />".COUNTER_L3.": $totalever<br />".COUNTER_L5.": $uniqueever<br /><br />
<b>".COUNTER_L6."</b><br />".COUNTER_L3.": $siteTotal<br />".COUNTER_L5.": $siteUnique";
$ns->tablerender(COUNTER_L7, $text, 'counter');
unset($dbPageInfo);
}
else
{
if(ADMIN)
{
$text .= "<span class='smalltext'>".COUNTER_L8."</span>";
$ns->tablerender(COUNTER_L7, $text, 'counter');
}
}
?>

View File

@@ -4,8 +4,8 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/siteinfo_menu/languages/English.php,v $
| $Revision: 1.1 $
| $Date: 2007-03-23 22:42:40 $
| $Revision: 1.2 $
| $Date: 2007-03-24 11:54:46 $
| $Author: lisa_ $
+----------------------------------------------------------------------------+
*/
@@ -14,4 +14,13 @@ define("COMPLIANCE_L1", "W3C Compliance");
define("SITEBUTTON_MENU_L1", "Link to us");
define("POWEREDBY_L1", "Powered by");
define("COUNTER_L1", "Admin visits aren't being counted.");
define("COUNTER_L2", "This page today ...");
define("COUNTER_L3", "total");
define("COUNTER_L4", "This page ever ...");
define("COUNTER_L5", "unique");
define("COUNTER_L6", "Site ...");
define("COUNTER_L7", "Counter");
define("COUNTER_L8", "Admin message: <b>Stat logging is disabled.</b><br />To activate, you need to install the Statistic Logging plugin from your <a href='".e_ADMIN."plugin.php'>plugin manager</a>, then activate it from the <a href='".e_PLUGIN."log/admin_config.php'>configuration screen</a>.");
?>