Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Trace and log user actions... Details »»
Trace and log user actions...
Version: 1.00, by Zzed Zzed is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 04-27-2003 Last Update: Never Installs: 43
 
No support by the author.

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
Note:Go to this post to download the directory protection file for this hack.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-28-2003, 10:04 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #3  
Old 04-28-2003, 10:19 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 04-28-2003, 10:23 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 04-28-2003, 10:28 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 04-28-2003, 10:38 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wouldn't comparing the username do the job, too?
Reply With Quote
  #7  
Old 04-28-2003, 10:41 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 04:38 PM Boofo said this in Post #6
Wouldn't comparing the username do the job, too?

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.
Reply With Quote
  #8  
Old 04-28-2003, 11:01 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #9  
Old 04-28-2003, 11:04 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #10  
Old 04-28-2003, 11:09 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:12 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04704 seconds
  • Memory Usage 2,294KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete