|
Joined: Nov 2001
Posts: 12
Junior Member
|
Junior Member
Joined: Nov 2001
Posts: 12 |
I want to log the last date/time of access by all of my members. I've looked in ultimatebb.cgi and *think* I've found where I need to make a change to accomplish what I need. In the code, I see: quote: # set new last login my $cookie2 = cookie( -name => "login$vars_config{Cookie_Number}", -value => [$GotTime{LastLoginDT}, $GotTime{LastLoginJulian}], -path => '/', -expires => '+1y' );
It *seems* I can just add at the bottom of the above (and before my $cookie3;): quote: open(XXX,">/mydomain/cgi-bin/$user_number.dlv");print XXX "$cookie2";close(XXX);
With much trepidation, I tried it for a few minutes, and it logged some of the users, but I'm not sure it got all of them. Can anyone tell me if this is the only place I need to add it, or if it will even work? TIA
|
|
|
|
Joined: Sep 2001
Posts: 379
Member
|
Member
Joined: Sep 2001
Posts: 379 |
I'd rather go for the "&WriteFileAsString" method (routine provided by UBB), hehe. Anyway... it depends on your visitors. Not everyone uses cookies, so relying on cookies for the last login date/time won't be reliable, either. In ultimatebb.cgi, find: I think that should do the trick. That'll write the date/time to "membernumber.dlv" located in your "members" directory. Hope this was of some help to you.
|
|
|
|
Joined: Nov 2001
Posts: 12
Junior Member
|
Junior Member
Joined: Nov 2001
Posts: 12 |
Excellent! Thanks for the assist
|
|
|
|
Joined: Sep 2001
Posts: 379
Member
|
Member
Joined: Sep 2001
Posts: 379 |
My pleasure!
|
|
|
|
Joined: Nov 2001
Posts: 12
Junior Member
|
Junior Member
Joined: Nov 2001
Posts: 12 |
Just a followup, for anyone reading this, the code needs to be in both places, in order, apparently, to catch both logged in and non-logged in users. I wasn't able to get the &WriteFileAsString to work (didn't really spend much time on it, got an error, so I pulled it ), but the $GotTime{LastLoginDT} is MUCHO cleaner. My board is not very high activity (maybe 20 visitors a day) so it will take a while for these to accumulate. I've already got a script to download the ".dlv" files and extract the info in a report. This is gonna be a "Good Thing"(tm) and will eventually allow pruning members that register but never return. It's too bad it won't capture users that return but don't log in, but that's "sort of" covered using the web logs and IP addresses (if they're not AOL or some other ISP that randomly assigns IP addresses). Speaking of IP addresses, I have to drop the TLD to get anything usable, but it's not very accurate that way. I wish the "Internet Gods" would come up with a better (unique) way to identify traffic Thanks again, Idle, I'd have never figured out why it wasn't capturing all the users if you hadn't pointed it out. I sure got a long way to go to get a handle on how all this UBB stuff works!
|
|
|
|
Joined: Sep 2001
Posts: 379
Member
|
Member
Joined: Sep 2001
Posts: 379 |
If you're looking for the most "recent activities" for your members, you may want to have a look at my "Advanced IP Logging" mod. (6.1 - 6.3x). It logs those (IP and date/time), you can search for logged IPs, view IP history for your members, adds a "Recent Activities" section below "Bonus Information" in profiles, etc.
|
|
|
|
Joined: Nov 2001
Posts: 12
Junior Member
|
Junior Member
Joined: Nov 2001
Posts: 12 |
Thanks for the offer, but I'm already checking "visits" by IP address based on the web logs. I'm using a script that grabs both the registration IP and the "last edit" IP, then slogs through ALL posts to extract any additional to produce an "IP database" for reference. The trouble with IP's is that they are not unique, e.g., AOL randomly assigns them from their "pool" and two different users may have the same IP on different days. Also, some users appear to almost never get the same IP twice, so I don't even consider the TLD. Unfortunately, the logging generated by the above hacks doesn't appear, unless they actually login (or already are logged in when they visit). If they are not logged in, and just browse the board, the ONLY record is the web logs. At the moment, I'm tracking both, and trying to figure some way to combine the results, but neither is really a good solution. I guess I could make the board viewable by registered user's only, but don't want to go that route, it might discourage "future" users from hanging around for a while. I'm afraid that given the IP's not being unique, and allowing non registered (non logged in) folks to read the board, I'll never *really* know, except for the folks with static IPs. *sigh* Back to the drawing board...
|
|
|
|
Joined: Sep 2001
Posts: 379
Member
|
Member
Joined: Sep 2001
Posts: 379 |
I'm aware of AOL and other such cable providers, rotating the IPs amongst their members... rather annoying, indeed. Then again, if you take a look at my Advanced IP Loggin mod, you can use it as a reference to log IPs when they post, register, login/logout, etc. I have already included the login/register and posting (you'll soon see where to add the code to log IPs on user logout). Of course, unless you use my routine or make your own from ubb_lib_idle.cgi (Advanced IP Logging), you'll end up with pretty heavy log files for your members since this will record every IP, and doesn't check if it already exists in the member's log file.
|
|
|
|
Joined: Nov 2001
Posts: 12
Junior Member
|
Junior Member
Joined: Nov 2001
Posts: 12 |
Yup, I see the potential for some LARGE log files, that's why I went with an individual file for each user, that just gets overwritten with the latest information. I use the posts as my "IP History" for each user(and their registration and last edit IP from their record), and just scan it once a day to collect all the IPs each user has ever posted from.
|
|
|
|
Joined: Sep 2001
Posts: 379
Member
|
Member
Joined: Sep 2001
Posts: 379 |
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|