The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Trace and log user actions... Details »» | |||||||||||||||||||||||||
This hack was requested by ossi69 and John Mac.
This is a pretty simple hack that allows you to track and document a user's actions while they are logged into your board. Every click made by the user makes a brand new entry in a log file. The log file entries include, username, IP address, date and time, and the URL clicked on. The user actions are documented even before the user has a chance to see the page he clicked on. Templates affected by this hack: none Tables affected by this hack: user Files affected by this hack: global.php, admin/user.php Execute the following query to create a new field in the user table: alter table user add trace smallint(5) unsigned DEFAULT 0 NOT NULL; You also need to create a brand new directory in your forums directory by the name of tracelog. You need to make sure that your give the appropriate\ read/write permissions to this directory so that the http server on your host can create files in there. Here is a sample output: Code:
Zed, 192.168.1.101 , 2003-04-28 18:31:30, /forums/index.php Zed, 192.168.1.101 , 2003-04-28 18:31:36, /forums/forumdisplay.php?forumid=9 Zed, 192.168.1.101 , 2003-04-28 18:31:42, /forums/showthread.php?threadid=143901 Zed, 192.168.1.101 , 2003-04-28 18:31:51, /forums/rules.php Zed, 192.168.1.101 , 2003-04-28 18:31:53, /forums/forumdisplay.php?forumid=9 Zed, 192.168.1.101 , 2003-04-28 18:32:07, /forums/showthread.php?threadid=143901 Zed, 192.168.1.101 , 2003-04-28 18:32:11, /forums/index.php Zed, 192.168.1.101 , 2003-04-28 18:32:15, /forums/forumdisplay.php?forumid=103 Zed, 192.168.1.101 , 2003-04-28 18:32:28, /forums/showthread.php?threadid=225576 Zed, 192.168.1.101 , 2003-04-28 18:32:38, /forums/member.php?action=getinfo&userid=4112 Show Your Support
|
Comments |
#2
|
||||
|
||||
Is this supposed to be unsigned?
alter table user add trace smallint(5) unsigned DEFAULT 0 NOT NULL; Will this also add a line under each user's session so you can tell where one leaves off and one starts? |
#3
|
||||
|
||||
Unsigned is fine. The possible values for that field are 0 and 1.
Start times are when the user signs on for the first time. And the leaving time should be between the time of the last entry and the time for the cookie timeouts on your board. |
#4
|
||||
|
||||
I see, thanks!
Wouldn't it be better to have a line separate each users session though in case the log gets kind of long? Like this: Zed, 192.168.1.101 , 2003-04-28 18:31:30, /forums/index.php Zed, 192.168.1.101 , 2003-04-28 18:31:36, /forums/forumdisplay.php?forumid=9 Zed, 192.168.1.101 , 2003-04-28 18:31:42, /forums/showthread.php?threadid=143901 Zed, 192.168.1.101 , 2003-04-28 18:31:51, /forums/rules.php Zed, 192.168.1.101 , 2003-04-28 18:31:53, /forums/forumdisplay.php?forumid=9 ------------------------------------------------------------------------- Boofo, 192.168.1.101 , 2003-04-28 18:32:07, /forums/showthread.php?threadid=143901 Boofo, 192.168.1.101 , 2003-04-28 18:32:11, /forums/index.php Boofo, 192.168.1.101 , 2003-04-28 18:32:15, /forums/forumdisplay.php?forumid=103 ------------------------------------------------------------------------- Test, 192.168.1.101 , 2003-04-28 18:32:28, /forums/showthread.php?threadid=225576 Test, 192.168.1.101 , 2003-04-28 18:32:38, /forums/member.php?action=getinfo&userid=4112 Something like that? And will there be a way to prune the log? |
#5
|
||||
|
||||
This hack is activated by user participation on the board. TO do this you would have to take the last activity time by the user and compare it against the current time and if it is greater than your $cookietimeout then you would output a line separator.
As for the pruning, I figured the file entries can just be deleted. or edited manually. They really don't take up that much space to cause real concern. |
#6
|
||||
|
||||
Wouldn't comparing the username do the job, too?
|
#7
|
||||
|
||||
Quote:
Nope, it is per user. Each user gets his/her own file in the tracelog directory, i.e., username Zzed will have his entries be written to Zzed.log, and username Boofo will have his entries written to Boofo.log. |
#8
|
||||
|
||||
I just got it installed and saw that. Sorry.
It looks great! Can it be done by the time line like you mentioned before? Would make it easier on a big log. Also, is there a way to have it be read form the Admin CP instead of having to go FTP to read it? |
#9
|
||||
|
||||
I'll look into the line separator thing.
You can view the file through your browser by going to http://myforum.com/forums/tracelog/Zzed.log Or you can get a directlry listing by going to: http://myforum.com/forums/tracelog |
#10
|
||||
|
||||
Thanks, my friend. Great hack. I like it.
How can I add the link in the user's admin cp profile so you can just click it and read it? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|