|
From: <ir...@us...> - 2013-02-27 08:14:18
|
Revision: 11113
http://sourceforge.net/p/xoops/svn/11113
Author: irmtfan
Date: 2013-02-27 08:14:14 +0000 (Wed, 27 Feb 2013)
Log Message:
-----------
some bug fixes. 1- store stats when nothing to store 2- name of 2 classes was lowercase
add some more help for users and admins
better method for getting setting.php
Modified Paths:
--------------
XoopsModules/userlog/trunk/userlog/admin/index.php
XoopsModules/userlog/trunk/userlog/admin/setting.php
XoopsModules/userlog/trunk/userlog/class/log.php
XoopsModules/userlog/trunk/userlog/class/setting.php
XoopsModules/userlog/trunk/userlog/class/stats.php
XoopsModules/userlog/trunk/userlog/images/userlog_logo.png
XoopsModules/userlog/trunk/userlog/include/log.php
XoopsModules/userlog/trunk/userlog/include/module.php
XoopsModules/userlog/trunk/userlog/language/english/help/help.html
XoopsModules/userlog/trunk/userlog/language/english/modinfo.php
XoopsModules/userlog/trunk/userlog/xoops_version.php
Added Paths:
-----------
XoopsModules/userlog/trunk/userlog/docs/readme_devs.txt
Modified: XoopsModules/userlog/trunk/userlog/admin/index.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/admin/index.php 2013-02-27 04:31:18 UTC (rev 11112)
+++ XoopsModules/userlog/trunk/userlog/admin/index.php 2013-02-27 08:14:14 UTC (rev 11113)
@@ -56,7 +56,7 @@
$indexAdmin->addInfoBoxLine(_AM_USERLOG_SUMMARY,'<a href="logs.php?options[admin]=1">' . _AM_USERLOG_SUMMARY_ADMIN . '</a>');
$indexAdmin->addInfoBoxLine(_AM_USERLOG_SUMMARY,'<a href="logs.php?options[referer]=google.com">' . _AM_USERLOG_SUMMARY_GOOGLE . '</a>');
}
-$indexAdmin->addConfigBoxLine($Userlog->getConfig('logfilepath') .'/'. USERLOG_DIRNAME , 'folder');
+$indexAdmin->addConfigBoxLine($Userlog->getConfig('logfilepath') , 'folder');
echo $indexAdmin->addNavigation('index.php');
echo $indexAdmin->renderButton();
echo $indexAdmin->renderIndex();
Modified: XoopsModules/userlog/trunk/userlog/admin/setting.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/admin/setting.php 2013-02-27 04:31:18 UTC (rev 11112)
+++ XoopsModules/userlog/trunk/userlog/admin/setting.php 2013-02-27 08:14:14 UTC (rev 11113)
@@ -30,6 +30,7 @@
// Where do we start ?
$set_id = UserlogRequest::getInt('set_id',0);
$logsetObj = $set_id ? $Userlog->getHandler('setting')->get($set_id) : UserlogSetting::getInstance();
+$logsetObj->cleanCache(); // delete all settings caches
if ($set_id && !is_object($logsetObj)) {
redirect_header("setting.php", 1, _AM_USERLOG_SET_ERROR);
}
@@ -98,7 +99,6 @@
$options_arr = $logsetObj->getOptions($option,"key");// empty means all. sanitize options
$logsetObj->setVar("options",implode(",",$options_arr));
$logsetObj->setVar("scope",implode(",",$scope));
- $logsetObj->cleanCache(); // delete all settings caches
$logsetObj->set(true);
redirect_header("setting.php", 1, sprintf($message, $logsetObj->name()));
break;
Modified: XoopsModules/userlog/trunk/userlog/class/log.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/class/log.php 2013-02-27 04:31:18 UTC (rev 11112)
+++ XoopsModules/userlog/trunk/userlog/class/log.php 2013-02-27 08:14:14 UTC (rev 11113)
@@ -143,7 +143,7 @@
// force to create file if not exist
if ($fileHandler->XoopsFileHandler($log_file, false) == false) {
if(!$fileHandler->exists()) {
- $fileHandler->XoopsFileHandler($log_file, true); // create file
+ $fileHandler->XoopsFileHandler($log_file, true); // create file and folder
$this->setErrors('File was not exist create file ({$log_file_name})');
// update the new file in database
$statsObj = UserlogStats::getInstance();
Modified: XoopsModules/userlog/trunk/userlog/class/setting.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/class/setting.php 2013-02-27 04:31:18 UTC (rev 11112)
+++ XoopsModules/userlog/trunk/userlog/class/setting.php 2013-02-27 08:14:14 UTC (rev 11113)
@@ -104,50 +104,35 @@
return $options;
}
///////////////////////////////////////////////////////////
- // if uid setting exist in db
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('logby', 'uid'));
- $criteria->add(new Criteria('unique_id', $unique_uid));
- $logsetObj = $this->userlog->getHandler('setting')->getObjects($criteria);
- if ($logsetObj) {
- $logsetObj = $logsetObj[0];
- $this->setFile('uid', $unique_uid, array($logsetObj->options(), $logsetObj->scope()) );
- return array($logsetObj->options(), $logsetObj->scope());
+ // database get All is better for performance???
+ $logsetsObj = $this->userlog->getHandler('setting')->getAll();
+ if (empty($logsetsObj)) return false; // if not set in db return false
+ $uid_unique_uid = "uid" . $unique_uid;
+ foreach($unique_gid as $key=>$gid) {
+ $gid_unique_gid[$key] = "gid" . $gid;
}
- // if gid setting exist in db
- foreach ($unique_gid as $gid) {
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('logby', 'gid'));
- $criteria->add(new Criteria('unique_id', $gid));
- $logsetObj = $this->userlog->getHandler('setting')->getObjects($criteria);
- if ($logsetObj) {
- $logsetObj = $logsetObj[0];
- $this->setFile('gid', $gid, array($logsetObj->options(), $logsetObj->scope()));
- return array($logsetObj->options(), $logsetObj->scope());
+ $ip_unique_ip = "ip" . $unique_ip;
+ foreach($logsetsObj as $setObj) {
+ $sLobgy = $setObj->logby();
+ $sUnique_id = $setObj->unique_id();
+ $sLogbyId = $sLobgy . $sUnique_id;
+ // if uid setting exist in db return it
+ if($sLogbyId == $uid_unique_uid ||
+ // if gid setting exist in db return it
+ in_array($sLogbyId, $gid_unique_gid) ||
+ // if ip setting exist in db return it
+ $sLogbyId == $ip_unique_ip) {
+ $sets = array($setObj->options(), $setObj->scope());
+ $this->setFile($sLobgy, $sUnique_id, $sets); // build cache
+ return $sets;
}
+ // if all exist in db
+ if($sUnique_id == 0) {
+ $sets = array($setObj->options(), $setObj->scope());
+ $this->setFile('all', 0, $sets); // build cache
+ return $sets;
+ }
}
-
- // if ip setting exist in db
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('logby', 'ip'));
- $criteria->add(new Criteria('unique_id', $unique_ip));
- $logsetObj = $this->userlog->getHandler('setting')->getObjects($criteria);
- if ($logsetObj) {
- $logsetObj = $logsetObj[0];
- $this->setFile('ip', $unique_ip, array($logsetObj->options(), $logsetObj->scope()));
- return array($logsetObj->options(), $logsetObj->scope());
- }
- // if all exist in db
- $criteria = new CriteriaCompo();
- //$criteria->add(new Criteria('logby', 'ip')); // logby can be anything uid, gid, ip, ...
- $criteria->add(new Criteria('unique_id', 0));
- $logsetObj = $this->userlog->getHandler('setting')->getObjects($criteria);
- if ($logsetObj) {
- $logsetObj = $logsetObj[0];
- $this->setFile('all', 0, array($logsetObj->options(), $logsetObj->scope()));
- return array($logsetObj->options(), $logsetObj->scope());
- }
-
return false;
}
Modified: XoopsModules/userlog/trunk/userlog/class/stats.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/class/stats.php 2013-02-27 04:31:18 UTC (rev 11112)
+++ XoopsModules/userlog/trunk/userlog/class/stats.php 2013-02-27 08:14:14 UTC (rev 11113)
@@ -22,6 +22,7 @@
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
include_once dirname(dirname(__FILE__)) . '/include/common.php';
+xoops_loadLanguage("admin",USERLOG_DIRNAME);
class UserlogStats extends XoopsObject
{
@@ -74,6 +75,7 @@
public function getAll()
{
$statsObj = $this->userlog->getHandler('stats')->getAll();
+ if (empty($statsObj)) return false; // if no result nothing in database
foreach ($statsObj as $sObj) {
$index1 = $sObj->stats_type().$sObj->stats_link();
$index2 = $sObj->stats_period();
@@ -100,15 +102,16 @@
case "file":
$logext = "log";
$log_file_paths = array(XOOPS_VAR_PATH .'/'. USERLOG_DIRNAME,XOOPS_UPLOAD_PATH .'/'. USERLOG_DIRNAME);
+
$allFiles = 0;
foreach($log_file_paths as $log_file_path) {
$log_file = $log_file_path . '/' . $this->userlog->getConfig('logfilename').".".$logext;
$files = glob($log_file_path);
$allFiles += count($files);
- $this->update("file" ,0 ,count($files) ,false ,$log_file); // update working file in 2 pathes
+ $this->update("file" ,0 ,count($files) ,false ,$files ? $log_file : ''); // update working file in 2 pathes
}
// update all files in db link='all'
- $this->update("file" ,0 ,$allFiles ,false ,'all');
+ $this->update("file" ,0 ,$allFiles ,false ,$files ? 'all': '');
break;
case "views":
break;
@@ -160,6 +163,8 @@
public function update($type = 'log', $period = 0, $value = null, $increment = false, $link = '')
{
+ // if there is nothing to add to db
+ if (empty($value) && empty($link)) return false;
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('stats_type', $type), "AND");
$criteria->add(new Criteria('stats_period', $period), "AND");
Added: XoopsModules/userlog/trunk/userlog/docs/readme_devs.txt
===================================================================
--- XoopsModules/userlog/trunk/userlog/docs/readme_devs.txt (rev 0)
+++ XoopsModules/userlog/trunk/userlog/docs/readme_devs.txt 2013-02-27 08:14:14 UTC (rev 11113)
@@ -0,0 +1,279 @@
+developers help for userlog module.
+
+1- log user activities structure.
+I assume we need to gather below information from user. If you have any idea about them please let me know.
+i dont sanitize them because i want to log them as ther are. what is your idea. Im a very basic programmer. please help me.
+
+in userlog/class/setting.php
+
+[code]
+ public function getOptions($option = null, $V = "value")
+ {
+ $V = strtolower($V);
+
+ if ($this->userlog->getUser()) {
+ $uid = $this->userlog->getUser()->getVar('uid');
+ $uname = $this->userlog->getUser()->getVar('uname');
+ $last_login = $this->userlog->getUser()->getVar('last_login');
+ $admin = $this->userlog->getUser()->isAdmin();
+ $groups = "g" . implode("g",$this->userlog->getUser()->getGroups()); // g1g2
+ } else {
+ $uid = 0;
+ $uname = '';
+ $last_login = 0;
+ $admin = 0;
+ $groups = "g" . XOOPS_GROUP_ANONYMOUS; // g3
+ }
+ $options = array(
+ "log_id" => array( "type" => "int",
+ "title" => _AM_USERLOG_LOG_ID,
+ "value" => null // null for now
+ ),
+ "log_time" => array( "type" => "int",
+ "title" => _AM_USERLOG_LOG_TIME,
+ "value" => time()
+ ),
+ "uid" => array( "type" => "int",
+ "title" => _AM_USERLOG_UID,
+ "value" => $uid
+ ),
+ "uname" => array( "type" => "text",
+ "title" => _AM_USERLOG_UNAME,
+ "value" => $uname
+ ),
+ "admin" => array( "type" => "bool",
+ "title" => _AM_USERLOG_ADMIN,
+ "value" => $admin
+ ),
+ "groups" => array( "type" => "text",
+ "title" => _AM_USERLOG_GROUPS,
+ "value" => $groups
+ ),
+ "last_login" => array( "type" => "int",
+ "title" => _AM_USERLOG_LAST_LOGIN,
+ "value" => $last_login
+ ),
+ "user_ip" => array( "type" => "text",
+ "title" => _AM_USERLOG_USER_IP,
+ "value" => $_SERVER['REMOTE_ADDR']
+ ),
+ "user_agent" => array( "type" => "text",
+ "title" => _AM_USERLOG_USER_AGENT,
+ "value" => $_SERVER['HTTP_USER_AGENT']
+ ),
+ "url" => array( "type" => "text",
+ "title" => _AM_USERLOG_URL,
+ "value" => $_SERVER['REQUEST_URI']
+ ),
+ "script" => array( "type" => "text",
+ "title" => _AM_USERLOG_SCRIPT,
+ "value" => end(explode('/',$_SERVER['PHP_SELF']))
+ ),
+ "referer" => array( "type" => "text",
+ "title" => _AM_USERLOG_REFERER,
+ "value" => !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ""
+ ),
+ "pagetitle" => array( "type" => "text",
+ "title" => _AM_USERLOG_PAGETITLE,
+ "value" => isset($GLOBALS['xoopsTpl']) ? $GLOBALS['xoopsTpl']->get_template_vars("xoops_pagetitle") : ""
+ ),
+ "module" => array( "type" => "text",
+ "title" => _AM_USERLOG_MODULE,
+ "value" => $this->userlog->getLogModule()->getVar("dirname")
+ ),
+ "item_name" => array( "type" => "text",
+ "title" => _AM_USERLOG_ITEM_NAME,
+ "value" => null
+ ),
+ "item_id" => array( "type" => "text",
+ "title" => _AM_USERLOG_ITEM_ID,
+ "value" => null
+ ),
+ // user data input method
+ "request_method" => array( "type" => "text",
+ "title" => _AM_USERLOG_REQUEST_METHOD,
+ "value" => $_SERVER['REQUEST_METHOD']
+ ),
+ "get" => array( "type" => "text",
+ "title" => _AM_USERLOG_GET,
+ "value" => $_GET
+ ),
+ "post" => array( "type" => "text",
+ "title" => _AM_USERLOG_POST,
+ "value" => $_POST
+ ),
+ "request" => array( "type" => "text",
+ "title" => _AM_USERLOG_REQUEST,
+ "value" => $_REQUEST
+ ),
+ "files" => array( "type" => "text",
+ "title" => _AM_USERLOG_FILES,
+ "value" => $_FILES
+ ),
+ "env" => array( "type" => "text",
+ "title" => _AM_USERLOG_ENV,
+ "value" => $_ENV
+ ),
+ "session" => array( "type" => "text",
+ "title" => _AM_USERLOG_SESSION,
+ "value" => $_SESSION
+ ),
+ "cookie" => array( "type" => "text",
+ "title" => _AM_USERLOG_COOKIE,
+ "value" => $_COOKIE
+ ),
+ "header" => array( "type" => "text",
+ "title" => _AM_USERLOG_HEADER,
+ "value" => headers_list()
+ ),
+ "logger" => array( "type" => "text",
+ "title" => _AM_USERLOG_LOGGER,
+ "value" => $GLOBALS['xoopsLogger']->errors
+ ),
+ // settings will not be logged
+ "store_file" => array( "type" => "int",
+ "title" => _AM_USERLOG_STORE_FILE,
+ "value" => 1
+ ),
+ "store_db" => array( "type" => "int",
+ "title" => _AM_USERLOG_STORE_DB,
+ "value" => 1
+ ),
+ "views" => array( "type" => "int",
+ "title" => _AM_USERLOG_VIEWS,
+ "value" => 1 // for item_name and item_id
+ ),
+ );
+ $ret = $this->userlog->getFromKeys($options, $option);
+ if (empty($V)) return $ret;
+ if ($V == "key") return array_keys($ret);
+ $ret2 = null;
+ foreach ($ret as $option=>$val) {
+ $ret2[$option] = $val[$V];
+ }
+ return $ret2;
+ }
+[/code]
+
+2- setting structure.
+i think we just need to log users based on "uid" or "gid" or "ip" and it will cover all possibilities. please let me know your idea.
+
+the table structure is:
+in userlog/sql/mysql.sql
+[code]
+CREATE TABLE mod_userlog_set (
+ set_id mediumint(8) unsigned NOT NULL auto_increment,
+ name varchar(100) NOT NULL default '',
+ logby varchar(10) NOT NULL default '',
+ unique_id int(11) unsigned NOT NULL default 0,
+ options TEXT NOT NULL,
+ scope TEXT NOT NULL,
+ PRIMARY KEY (set_id),
+ UNIQUE logby_id (logby, unique_id)
+) ENGINE=MyISAM;
+[/code]
+
+The above is clear. more information in module help.
+
+3- performance.
+it checks every hit to see if the visitor have a setting or not. for the best performance i wrote a get function like this.
+in userlog/class/setting.php
+[code]
+ public function get()
+ {
+ // if uid setting exist in File
+ $unique_uid = ($this->userlog->getUser()) ? $this->userlog->getUser()->getVar('uid') : 0;
+ if ($options = $this->getFile('uid', $unique_uid)) {
+ return $options;
+ }
+
+ // if gid setting exist in File
+ $unique_gid = ($this->userlog->getUser()) ? $this->userlog->getUser()->getGroups() : array(XOOPS_GROUP_ANONYMOUS);
+ foreach ($unique_gid as $gid) {
+ if ($options = $this->getFile('gid', $gid)) {
+ return $options;
+ }
+ }
+ // if ip setting exist in File
+ $unique_ip = XoopsUserUtility::getIP(); // ip as int
+ if ($options = $this->getFile('ip', $unique_ip)) {
+ return $options;
+ }
+ // if all exist in File
+ if ($options = $this->getFile('all', 0)) {
+ return $options;
+ }
+ ///////////////////////////////////////////////////////////
+ // database get All is better for performance???
+ $logsetsObj = $this->userlog->getHandler('setting')->getAll();
+ if (empty($logsetsObj)) return false; // if not set in db return false
+ $uid_unique_uid = "uid" . $unique_uid;
+ foreach($unique_gid as $key=>$gid) {
+ $gid_unique_gid[$key] = "gid" . $gid;
+ }
+ $ip_unique_ip = "ip" . $unique_ip;
+ foreach($logsetsObj as $setObj) {
+ $sLobgy = $setObj->logby();
+ $sUnique_id = $setObj->unique_id();
+ $sLogbyId = $sLobgy . $sUnique_id;
+ // if uid setting exist in db return it
+ if($sLogbyId == $uid_unique_uid ||
+ // if gid setting exist in db return it
+ in_array($sLogbyId, $gid_unique_gid) ||
+ // if ip setting exist in db return it
+ $sLogbyId == $ip_unique_ip) {
+ $sets = array($setObj->options(), $setObj->scope());
+ $this->setFile($sLobgy, $sUnique_id, $sets); // build cache
+ return $sets;
+ }
+ // if all exist in db
+ if($sUnique_id == 0) {
+ $sets = array($setObj->options(), $setObj->scope());
+ $this->setFile('all', 0, $sets); // build cache
+ return $sets;
+ }
+ }
+ return false;
+ }
+[/code]
+
+as you can see it create cache files for each settings. IMO it will help to reduce queries for users have a setting.
+
+for getting settings from db i firstly used criteria but then i decide to get all settings at once and then find if the user have setting or not. IMO it has the better performance. please let me know your opinion. what is the best performance? this function is important for your review.
+
+4- views
+now every module have a counter for its item views. eg: news, publisher, page in xoops 2.6
+but this counter is useless. we dont need forever views. we need views in a specific time period.
+in every news agency the first and top block is "today hot news" and it means news that had been most viewed today.
+
+for a long time that was an unsolved issue for me and i think in the whole xoops we have this problem in all modules.
+after starting userlog for a different purpose I suddenly reach to an innovative idea for gathering all views in all modules.
+i used module "notification" because every module item that should have views have a notification too.
+there we have all needed information about items. so i wrote this nice and tricky function:
+[code]
+ public function setItem()
+ {
+ $not_config =& $this->userlog->getLogModule()->getInfo('notification');
+ if (!empty($not_config)) {
+ foreach ($not_config['category'] as $category) {
+ // if $item_id != 0 ---> return true
+ if (!empty($category['item_name']) && $item_id = UserlogRequest::getInt($category['item_name'], 0)){
+ $this->setVar('item_name', $category['item_name']);
+ $this->setVar('item_id', $item_id);
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+[/code]
+
+so for example in news we only have these typical URLs:
+
+news/article.php?storyid=ITEM_ID
+news/index.php|article.php?storytopic=ITEM_ID
+
+as you can see i just need to store item_name and item_id because i have the module dirname and script name!!!
+
+IMO we should stick to this idea to have a overall item views in the XOOPS and drop all counters in all modules.
+i need your idea about this.
\ No newline at end of file
Modified: XoopsModules/userlog/trunk/userlog/images/userlog_logo.png
===================================================================
(Binary files differ)
Modified: XoopsModules/userlog/trunk/userlog/include/log.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/include/log.php 2013-02-27 04:31:18 UTC (rev 11112)
+++ XoopsModules/userlog/trunk/userlog/include/log.php 2013-02-27 08:14:14 UTC (rev 11113)
@@ -27,7 +27,7 @@
include_once 'common.php';
$Userlog = Userlog::getInstance(false);
-$logsetObj = Userlogsetting::getInstance();
+$logsetObj = UserlogSetting::getInstance();
$statsObj = UserlogStats::getInstance();
list($setting, $scope) = $logsetObj->get();
Modified: XoopsModules/userlog/trunk/userlog/include/module.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/include/module.php 2013-02-27 04:31:18 UTC (rev 11112)
+++ XoopsModules/userlog/trunk/userlog/include/module.php 2013-02-27 08:14:14 UTC (rev 11113)
@@ -23,6 +23,6 @@
include_once 'common.php';
function xoops_module_uninstall_userlog(&$module)
{
- $logsetObj = Userlogsetting::getInstance();
+ $logsetObj = UserlogSetting::getInstance();
$logsetObj->cleanCache(); // delete all settings caches
}
\ No newline at end of file
Modified: XoopsModules/userlog/trunk/userlog/language/english/help/help.html
===================================================================
--- XoopsModules/userlog/trunk/userlog/language/english/help/help.html 2013-02-27 04:31:18 UTC (rev 11112)
+++ XoopsModules/userlog/trunk/userlog/language/english/help/help.html 2013-02-27 08:14:14 UTC (rev 11113)
@@ -1,22 +1,37 @@
<div id="help-template" class="outer">
-<h1 class="head">Help: userlog</h1>
-
+<h1 class="head">Help: <a class="ui-corner-all tooltip" href="<{$xoops_url}>/modules/userlog/admin/index.php" title="Back to the administration of Userlog"> Userlog <img src="<{xoAdminIcons home.png}>" alt="Back to the administration of Userlog"/></a></h1>
<h4 class="odd">Description</h4>
<p class="even">
Userlog is a node logger which can log your user/visitor activities in your site.
This is a very useful tool for webmasters in busy sites. for example you can log your other admins navigation.
current nodes for logging are: user id, user group and visitor ip.
+You can store logs in database, in file or both.
</p>
-
+<h4 class="odd">Userlog preferences</h4>
+After installtion we strongly recommend you to go to preferences.<br /><br />
+Here you can set your desired values for important configurations.<br /><br />
+important configs are:<br /><br />
+<b>Log file configs</b>:
+If you need to store logs in file, set the working path, working file size, working file name, ... here<br /><br />
+<b>Log database configs</b>:
+If you need to store logs in database, set the maximum logs thersholds here.<br /><br />
<h4 class="odd">Setting</h4>
<p class="even">
"Setting" provides a wide range of options that you can use to set for specific users to be logged.<br />
<br />
<b>Setting name</b>: here you can input any name you like. It is not important for the module activities. It is just for you.<br />
<br />
-<b>Setting logby</b>: here you will choose the 'node' you want to log users by that. currently you can log users by "user id", "user group" and "visitor ip".<br />
-by selecting user group all activities of users belong to that specific group will be logged.<br />
-visitor ip is very usefull to log robots, malicious visitors and ...<br />
+<b>Setting logby</b>: here you will choose the 'node' you want to log users by that and in the next part you should input the Unique id for this node. currently you can log users by "user id", "user group" and "visitor ip".<br />
+- by selecting uid only that specific user will be logged. eg uid=1<br />
+- by selecting user group all activities of users belong to that specific group will be logged. eg: gid=3<br />
+- visitor ip is very usefull to log robots, malicious visitors and ... eg: ip=66.249.66.1<br />
+- if you set Unique id = 0 (read the next part) Userlog module will log all users/visitors regardless of logby.
+the priority for getting settings is as below.<br /><br />
+IF EXIST uid get it<br />
+ELSE IF EXIST gid get it<br />
+ELSE IF EXIST ip get it<br />
+ELSE IF Unique id = 0 log all users<br />
+
<br />
<b>Setting Unique id</b>: here you must choose one unique id (node id) to be logged.<br />
(eg: uid=1, gid=3 (anonymous), ip=66.249.66.1) enter 0 means all users.<br />
@@ -25,13 +40,18 @@
select log user views means store uid, groups, script name, pagetitle, module, item name, item id in Database.<br />
<br />
<b>Setting scope:</b> if you want to log users activities in some specific module here you can do it.<br />
-select nothing means all website.
+select nothing means all website.<br />
+<br />
+attention: we assume you will not have many settings in your site (eg: less than 100 settings) so we dont provide many navigation facilities like order and sort in set list table. you just have a pagenav.<br />
+advise: more settings will confuse you more. choose logby and Unique id wisely to avoid any overlap.<br />
+for example for a specific user use "uid" but for a group use "gid".<br />
</p>
<h4 class="odd">Logs</h4>
<p class="even">
You can see users logs through this section of the userlog Module.<br /><br />
To search for logs based on a criteria you have an advance form.<br /><br />
+To do: browsing logs from log file<br /><br />
</p>
<h4 class="odd">Views block</h4>
<p class="even">
Modified: XoopsModules/userlog/trunk/userlog/language/english/modinfo.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/language/english/modinfo.php 2013-02-27 04:31:18 UTC (rev 11112)
+++ XoopsModules/userlog/trunk/userlog/language/english/modinfo.php 2013-02-27 08:14:14 UTC (rev 11113)
@@ -27,28 +27,28 @@
// configs
// config logfile
-define("_MI_USERLOG_CONFCAT_LOGFILE","Log file");
+define("_MI_USERLOG_CONFCAT_LOGFILE","Log file (Set if you need to store logs in file otherwise foget it)");
define("_MI_USERLOG_CONFCAT_LOGFILE_DSC","Preferences for log file");
define("_MI_USERLOG_CONFCAT_FORMAT","Format");
define("_MI_USERLOG_CONFCAT_FORMAT_DSC","Preferences for format");
define("_MI_USERLOG_CONFCAT_PAGENAV","Page navigation");
define("_MI_USERLOG_CONFCAT_PAGENAV_DSC","Preferences for page navigation");
-define("_MI_USERLOG_CONFCAT_LOGDB","Log database");
+define("_MI_USERLOG_CONFCAT_LOGDB","Log database (Set if you need to store logs in database otherwise foget it)");
define("_MI_USERLOG_CONFCAT_LOGDB_DSC","Preferences for Log database");
-define("_MI_USERLOG_MAXLOGFILESIZE","Maximum file size for log file (bytes)");
-define("_MI_USERLOG_MAXLOGFILESIZE_DSC","Advise: Set it below 1MB because some servers have limitations for view large file in Cpanel.");
+define("_MI_USERLOG_MAXLOGFILESIZE","Maximum file size for current working log file (in bytes)");
+define("_MI_USERLOG_MAXLOGFILESIZE_DSC","Advise: Set it below 1MB because some servers set limitations for viewing large files in Cpanel.");
define("_MI_USERLOG_LOGFILEPATH","Log file full path");
define("_MI_USERLOG_LOGFILEPATH_DSC","Advise: a path outside wwwroot is safe from browsing by everybody");
-define("_MI_USERLOG_LOGFILENAME","Log file name");
-define("_MI_USERLOG_LOGFILENAME_DSC","the initial log file name");
+define("_MI_USERLOG_LOGFILENAME","Current working Log file name");
+define("_MI_USERLOG_LOGFILENAME_DSC","Older log files will be stored with this prefix. Log_file_name_date('Y-m-d_H-i-s').log");
// config format
define("_MI_USERLOG_DATEFORMAT","Date format");
-define("_MI_USERLOG_DATEFORMAT_DSC","If leave empty will use Core default");
+define("_MI_USERLOG_DATEFORMAT_DSC","If you leave it empty, this module will use Core default");
// config pagenav
define("_MI_USERLOG_SETS_PERPAGE","Number of settings per page");
-define("_MI_USERLOG_SETS_PERPAGE_DSC","The default value");
+define("_MI_USERLOG_SETS_PERPAGE_DSC","The default value for viewing settings");
define("_MI_USERLOG_LOGS_PERPAGE","Number of logs per page");
-define("_MI_USERLOG_LOGS_PERPAGE_DSC","The default value");
+define("_MI_USERLOG_LOGS_PERPAGE_DSC","The default value for viewing logs");
// config logdb
define("_MI_USERLOG_MAXLOGS","Maximum logs stored in db");
define("_MI_USERLOG_MAXLOGS_DSC","logs will be deleted from db after this number");
Modified: XoopsModules/userlog/trunk/userlog/xoops_version.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/xoops_version.php 2013-02-27 04:31:18 UTC (rev 11112)
+++ XoopsModules/userlog/trunk/userlog/xoops_version.php 2013-02-27 08:14:14 UTC (rev 11113)
@@ -19,6 +19,7 @@
* @author The XOOPS Project <www.xoops.org> <www.xoops.ir>
* @version $Id: xoops_version.php 1 2013-02-26 16:25:04Z irmtfan $
*/
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
$modversion = array();
$modversion['name'] = _MI_USERLOG_NAME;
$modversion['dirname'] = 'userlog';
|