mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
Notice removal, general tidy
This commit is contained in:
@@ -6,27 +6,37 @@
|
|||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
|
* Stats logging plugin - admin functions
|
||||||
*
|
*
|
||||||
*
|
* $URL$
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/log/admin_config.php,v $
|
* $Id$
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once("../../class2.php");
|
/**
|
||||||
if (!getperms("P") || !plugInstalled('log'))
|
* e107 Stats logging plugin
|
||||||
|
*
|
||||||
|
* @package e107_plugins
|
||||||
|
* @subpackage log
|
||||||
|
* @version $Id$;
|
||||||
|
*
|
||||||
|
* @todo Change log directory to use new system log directory
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once('../../class2.php');
|
||||||
|
if (!getperms('P') || !e107::isInstalled('log'))
|
||||||
{
|
{
|
||||||
header("Location: ".e_BASE."index.php");
|
header('Location: '.e_BASE.'index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once(e_ADMIN."auth.php");
|
|
||||||
require_once(e_HANDLER."userclass_class.php");
|
require_once(e_ADMIN.'auth.php');
|
||||||
|
require_once(e_HANDLER.'userclass_class.php');
|
||||||
|
|
||||||
|
|
||||||
define('LOGPATH', e_PLUGIN.'log/');
|
define('LOGPATH', e_PLUGIN.'log/');
|
||||||
|
|
||||||
include_lan(LOGPATH.'languages/'.e_LANGUAGE.'_admin_log.php');
|
include_lan(e_PLUGIN.'log/languages/'.e_LANGUAGE.'_admin_log.php');
|
||||||
|
|
||||||
if (e_QUERY)
|
if (e_QUERY)
|
||||||
{
|
{
|
||||||
@@ -61,67 +71,67 @@ $export_stripurl = varset($_POST['export_stripurl'], 0);
|
|||||||
|
|
||||||
if (isset($_POST['create_export']) && (($action == 'export') || ($action == 'datasets')))
|
if (isset($_POST['create_export']) && (($action == 'export') || ($action == 'datasets')))
|
||||||
{
|
{
|
||||||
$first_date = 0;
|
$first_date = 0;
|
||||||
$last_date = 0;
|
$last_date = 0;
|
||||||
$date_error = FALSE;
|
$date_error = FALSE;
|
||||||
if ($export_type == 'page')
|
if ($export_type == 'page')
|
||||||
{
|
|
||||||
switch ($export_date)
|
|
||||||
{
|
|
||||||
case '1' : // Single day
|
|
||||||
$first_date = gmmktime(0,0,0,$export_month,$export_day,$export_year);
|
|
||||||
$last_date = $first_date+86399;
|
|
||||||
$export_filter = " `log_id`='".date("Y-m-j",$first_date)."'";
|
|
||||||
break;
|
|
||||||
case '2' : // Daily for a month
|
|
||||||
$first_date = gmmktime(0,0,0,$export_month,1,$export_year);
|
|
||||||
$last_date = gmmktime(0,0,0,$export_month+1,1,$export_year) - 1;
|
|
||||||
$export_filter = " LEFT(`log_id`,8)='".gmstrftime("%Y-%m-",$first_date)."'";
|
|
||||||
break;
|
|
||||||
case '3' : // Monthly for a Year
|
|
||||||
$first_date = gmmktime(0,0,0,1,1,$export_year);
|
|
||||||
$last_date = gmmktime(0,0,0,1,1,$export_year+1) - 1;
|
|
||||||
$export_filter = " LENGTH(`log_id`)=7 AND LEFT(`log_id`,5)='".gmstrftime("%Y-",$first_date)."'";
|
|
||||||
break;
|
|
||||||
case '4' : // Accumulated
|
|
||||||
case '5' :
|
|
||||||
$export_filter = "`log_id`='pageTotal'";
|
|
||||||
$date_error = 'ignore';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // Calculate strings for non-page sources
|
|
||||||
$prefix_len = 0;
|
|
||||||
$export_date = $export2_date;
|
|
||||||
if (isset($stats_list[$export_type]))
|
|
||||||
{
|
{
|
||||||
$prefix_len = strlen($export_type) + 1;
|
switch ($export_date)
|
||||||
switch ($export2_date)
|
|
||||||
{
|
|
||||||
case '3' : // Monthly for a Year
|
|
||||||
if ($prefix_len > 0)
|
|
||||||
{
|
{
|
||||||
$first_date = gmmktime(0,0,0,1,1,$export_year);
|
case '1' : // Single day
|
||||||
$last_date = gmmktime(0,0,0,1,1,$export_year+1) - 1;
|
$first_date = gmmktime(0,0,0,$export_month,$export_day,$export_year);
|
||||||
$export_filter = " LENGTH(`log_id`)='".($prefix_len + 7)."' AND LEFT(`log_id`,".($prefix_len + 5).")='".$export_type.":".gmstrftime("%Y-",$first_date)."'";
|
$last_date = $first_date+86399;
|
||||||
|
$export_filter = " `log_id`='".date("Y-m-j",$first_date)."'";
|
||||||
|
break;
|
||||||
|
case '2' : // Daily for a month
|
||||||
|
$first_date = gmmktime(0,0,0,$export_month,1,$export_year);
|
||||||
|
$last_date = gmmktime(0,0,0,$export_month+1,1,$export_year) - 1;
|
||||||
|
$export_filter = " LEFT(`log_id`,8)='".gmstrftime("%Y-%m-",$first_date)."'";
|
||||||
|
break;
|
||||||
|
case '3' : // Monthly for a Year
|
||||||
|
$first_date = gmmktime(0,0,0,1,1,$export_year);
|
||||||
|
$last_date = gmmktime(0,0,0,1,1,$export_year+1) - 1;
|
||||||
|
$export_filter = " LENGTH(`log_id`)=7 AND LEFT(`log_id`,5)='".gmstrftime("%Y-",$first_date)."'";
|
||||||
|
break;
|
||||||
|
case '4' : // Accumulated
|
||||||
|
case '5' :
|
||||||
|
$export_filter = "`log_id`='pageTotal'";
|
||||||
|
$date_error = 'ignore';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case '4' : // Accumulated
|
|
||||||
$export_filter = " `log_id`='".$export_type."'";
|
|
||||||
$date_error = 'ignore';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{ // Calculate strings for non-page sources
|
||||||
$message = ADSTAT_L54;
|
$prefix_len = 0;
|
||||||
|
$export_date = $export2_date;
|
||||||
|
if (isset($stats_list[$export_type]))
|
||||||
|
{
|
||||||
|
$prefix_len = strlen($export_type) + 1;
|
||||||
|
switch ($export2_date)
|
||||||
|
{
|
||||||
|
case '3' : // Monthly for a Year
|
||||||
|
if ($prefix_len > 0)
|
||||||
|
{
|
||||||
|
$first_date = gmmktime(0,0,0,1,1,$export_year);
|
||||||
|
$last_date = gmmktime(0,0,0,1,1,$export_year+1) - 1;
|
||||||
|
$export_filter = " LENGTH(`log_id`)='".($prefix_len + 7)."' AND LEFT(`log_id`,".($prefix_len + 5).")='".$export_type.":".gmstrftime("%Y-",$first_date)."'";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case '4' : // Accumulated
|
||||||
|
$export_filter = " `log_id`='".$export_type."'";
|
||||||
|
$date_error = 'ignore';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$message = ADSTAT_L54;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (($date_error != 'ignore') && (($first_date == 0) || ($last_date == 0) || $date_error))
|
||||||
|
{
|
||||||
|
$message = ADSTAT_L47;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (($date_error != 'ignore') && (($first_date == 0) || ($last_date == 0) || $date_error))
|
|
||||||
{
|
|
||||||
$message = ADSTAT_L47;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -2,38 +2,44 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2008-2010 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
|
* Stats logging plugin - admin help text
|
||||||
*
|
*
|
||||||
|
* $URL$
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* e107 Stats logging plugin
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/log/e_help.php,v $
|
* @package e107_plugins
|
||||||
* $Revision$
|
* @subpackage log
|
||||||
* $Date$
|
* @version $Id$;
|
||||||
* $Author$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
define("LOGPATH", e_PLUGIN."log/");
|
include_lan(e_PLUGIN.'log/languages/'.e_LANGUAGE."_log_help.php");
|
||||||
include_lan(LOGPATH."languages/".e_LANGUAGE."_log_help.php");
|
|
||||||
|
|
||||||
if (e_QUERY) list($action,$junk) = explode('.',e_QUERY); else $action = 'list';
|
if (e_QUERY) list($action,$junk) = explode('.',e_QUERY); else $action = 'list';
|
||||||
|
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
case 'export' :
|
case 'export' :
|
||||||
$text = LAN_STAT_HELP_04;
|
$text = LAN_STAT_HELP_04;
|
||||||
break;
|
break;
|
||||||
case 'rempage' :
|
case 'rempage' :
|
||||||
$text = LAN_STAT_HELP_03;
|
$text = LAN_STAT_HELP_03;
|
||||||
break;
|
break;
|
||||||
case 'history' :
|
case 'history' :
|
||||||
$text = LAN_STAT_HELP_02;
|
$text = LAN_STAT_HELP_02;
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
$text = LAN_STAT_HELP_05;
|
$text = LAN_STAT_HELP_05;
|
||||||
}
|
}
|
||||||
$ns -> tablerender(LAN_STAT_HELP_01, $text);
|
$ns -> tablerender(LAN_STAT_HELP_01, $text);
|
||||||
unset($text);
|
unset($text);
|
||||||
|
Reference in New Issue
Block a user