mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
Add option to create daily text file of page accesses
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/prefs.php,v $
|
||||
| $Revision: 1.16 $
|
||||
| $Date: 2008-08-17 15:18:05 $
|
||||
| $Revision: 1.17 $
|
||||
| $Date: 2008-11-23 22:49:42 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -1031,36 +1031,44 @@ $text .= "</table></div>";
|
||||
//Advanced Features
|
||||
$text .= "<div id='advanced' style='display:none; text-align:center'>
|
||||
<table style='width:100%' class='fborder'>
|
||||
<colgroup>
|
||||
<col style='width:50%' />
|
||||
<col style='width:50%' />
|
||||
</colgroup>
|
||||
<tr>
|
||||
<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_149."</td>
|
||||
</tr>";
|
||||
|
||||
$text .= "<tr>
|
||||
<td style='width:50%' class='forumheader3'>".PRFLAN_147.":<br /><span class='smalltext'>".PRFLAN_148."</span></td>
|
||||
<td style='width:50%; text-align:right' class='forumheader3'>
|
||||
<input type='radio' name='developer' value='1'".($pref['developer'] ? " checked='checked'" : "")." /> ".PRFLAN_112."
|
||||
<input type='radio' name='developer' value='0'".(!$pref['developer'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
|
||||
<td class='forumheader3'>".PRFLAN_147.":<br /><span class='smalltext'>".PRFLAN_148."</span></td>
|
||||
<td style='text-align:right' class='forumheader3'>".
|
||||
multi_radio('developer',array('1' => PRFLAN_112, '0' => PRFLAN_113),$pref['developer'])."
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style='width:50%' class='forumheader3'>".PRFLAN_17."<br /><span class='smalltext'> </span></td>
|
||||
<td style='width:50%; text-align:right' class='forumheader3'>
|
||||
<input type='radio' name='compress_output' value='1'".($pref['compress_output'] ? " checked='checked'" : "")." /> ".PRFLAN_112."
|
||||
<input type='radio' name='compress_output' value='0'".(!$pref['compress_output'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
|
||||
<td class='forumheader3'>".PRFLAN_196."<br /><span class='smalltext'> </span></td>
|
||||
<td style='text-align:right' class='forumheader3'>".
|
||||
multi_radio('log_page_accesses',array('1' => PRFLAN_112, '0' => PRFLAN_113),$pref['log_page_accesses'])."
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style='width:50%' class='forumheader3'>".PRFLAN_150."<br /><span class='smalltext'> </span></td>
|
||||
<td style='width:50%; text-align:right' class='forumheader3'>{$auth_dropdown}</td>
|
||||
<td class='forumheader3'>".PRFLAN_17."<br /><span class='smalltext'> </span></td>
|
||||
<td style='text-align:right' class='forumheader3'>".
|
||||
multi_radio('compress_output',array('1' => PRFLAN_112, '0' => PRFLAN_113),$pref['compress_output'])."
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style='width:50%' class='forumheader3'>".PRFLAN_173."<br /><span class='smalltext'> </span></td>
|
||||
<td style='width:50%; text-align:right' class='forumheader3'>
|
||||
<input type='radio' name='check_updates' value='1'".($pref['check_updates'] ? " checked='checked'" : "")." /> ".PRFLAN_112."
|
||||
<input type='radio' name='check_updates' value='0'".(!$pref['check_updates'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
|
||||
<td class='forumheader3'>".PRFLAN_150."<br /><span class='smalltext'> </span></td>
|
||||
<td style='text-align:right' class='forumheader3'>{$auth_dropdown}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class='forumheader3'>".PRFLAN_173."<br /><span class='smalltext'> </span></td>
|
||||
<td style='text-align:right' class='forumheader3'>".
|
||||
multi_radio('check_updates',array('1' => PRFLAN_112, '0' => PRFLAN_113),$pref['check_updates'])."
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_files/def_e107_prefs.php,v $
|
||||
| $Revision: 1.16 $
|
||||
| $Date: 2008-10-30 20:40:22 $
|
||||
| $Revision: 1.17 $
|
||||
| $Date: 2008-11-23 22:49:42 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -154,6 +154,7 @@ City, State, Country
|
||||
'admincss' => 'style.css',
|
||||
'developer' => '0',
|
||||
'download_email' => '0',
|
||||
'log_page_accesses' => '0',
|
||||
'comments_disabled' => '0',
|
||||
'memberlist_access' => '253',
|
||||
'check_updates' => '0',
|
||||
|
@@ -12,8 +12,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_prefs.php,v $
|
||||
| $Revision: 1.13 $
|
||||
| $Date: 2008-08-17 15:18:14 $
|
||||
| $Revision: 1.14 $
|
||||
| $Date: 2008-11-23 22:49:47 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -204,7 +204,7 @@ define('PRFLAN_192', 'Generate random predefined login names according to a patt
|
||||
define('PRFLAN_193', 'To allow users to set their own login names, leave blank');
|
||||
define('PRFLAN_194', '# - alpha<br />. - numeric<br />* - alphanumeric<br />Other chars used as entered');
|
||||
define('PRFLAN_195', 'Changed values:');
|
||||
define('PRFLAN_196', '');
|
||||
define('PRFLAN_196', 'Log all page accesses to the '.e_FILE_ABS.'logs/ directory');
|
||||
define('PRFLAN_197', '');
|
||||
|
||||
|
||||
|
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_themes/templates/footer_default.php,v $
|
||||
| $Revision: 1.11 $
|
||||
| $Date: 2008-01-05 20:49:06 $
|
||||
| $Revision: 1.12 $
|
||||
| $Date: 2008-11-23 22:49:52 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -21,6 +21,12 @@ $In_e107_Footer = TRUE; // For registered shutdown function
|
||||
|
||||
global $eTraffic, $error_handler, $db_time, $sql, $mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb, $FOOTER, $e107;
|
||||
|
||||
$pref['accessLog'] = '0'; // Temporary flag to determine log format
|
||||
// 1 - text format
|
||||
// 2 - CSV format
|
||||
// 5 - extended text format
|
||||
// 6 - extended CSV format
|
||||
|
||||
//
|
||||
// SHUTDOWN SEQUENCE
|
||||
//
|
||||
@@ -46,17 +52,20 @@ global $eTraffic, $error_handler, $db_time, $sql, $mySQLserver, $mySQLuser, $myS
|
||||
// A Ensure sql and traffic objects exist
|
||||
//
|
||||
|
||||
if(!is_object($sql)){
|
||||
if(!is_object($sql))
|
||||
{
|
||||
// reinstigate db connection if another connection from third-party script closed it ...
|
||||
$sql = new db;
|
||||
$sql -> db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);
|
||||
}
|
||||
if (!is_object($eTraffic)) {
|
||||
if (!is_object($eTraffic))
|
||||
{
|
||||
$eTraffic = new e107_traffic;
|
||||
$eTraffic->Bump('Lost Traffic Counters');
|
||||
}
|
||||
|
||||
if(varset($e107_popup)!=1){
|
||||
if(varset($e107_popup)!=1)
|
||||
{
|
||||
//
|
||||
// B.1 Clear cache (admin-only)
|
||||
//
|
||||
@@ -76,6 +85,11 @@ if(varset($e107_popup)!=1){
|
||||
$dbPercent = number_format($dbPercent,0); // DB as percent of clock
|
||||
$memuse = $e107->get_memory_usage(); // Memory at end, in B/KB/MB/GB ;)
|
||||
$rinfo = '';
|
||||
$logLine = '';
|
||||
if ($pref['log_page_accesses'])
|
||||
{ // Collect the first batch of data to log
|
||||
$logLine.= "'".($now = time())."','".gmstrftime('%y-%m-%d %H:%M:%S',$now)."','".e_PAGE.'?'.e_QUERY."','".$rendertime."','".$db_time."','".$memuse."'";
|
||||
}
|
||||
|
||||
if ( function_exists( 'getrusage' ) )
|
||||
{
|
||||
@@ -117,6 +131,14 @@ if(varset($e107_popup)!=1){
|
||||
if(isset($pref['display_memory_usage']) && $pref['display_memory_usage']){ $rinfo .= CORE_LAN16.$memuse; }
|
||||
if(isset($pref['displaycacheinfo']) && $pref['displaycacheinfo']){ $rinfo .= $cachestring."."; }
|
||||
|
||||
if ($pref['log_page_accesses'])
|
||||
{ // Need to log the page info to a text file as CSV data
|
||||
$logname = e_FILE."logs/logd_".date("z.Y", time()).".csv";
|
||||
$logfp = fopen($logname, 'a+');
|
||||
fwrite($logfp, $logLine."\n");
|
||||
fclose($logfp);
|
||||
}
|
||||
|
||||
if (function_exists('theme_renderinfo'))
|
||||
{
|
||||
theme_renderinfo($rinfo);
|
||||
|
Reference in New Issue
Block a user