coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: UrOnline on November 27, 2006, 07:45:40 PM

Title: Log User Names
Post by: UrOnline on November 27, 2006, 07:45:40 PM
I've search the board and haven't found a solution.

I would like to log User names every time they log in. Is this possible?

Thanks in advance.
Title: Re: Log User Names
Post by: Sami on November 28, 2006, 06:53:02 AM
Yes it's possible ,
- Use  USER_NAME constant it will set after each authentication
- OR just query the xxx_users table

BTW there is some plugin for online users stat , look at the cpg1.4 plugin contributions (http://forum.coppermine-gallery.net/index.php?board=66.0)
Title: Re: Log User Names
Post by: UrOnline on November 28, 2006, 07:07:55 AM
I'm not sure that I completely understand. This will keep a log of every time a user logs in. And if yes (and it's not too complicated to explain) can you explain it just a little more. I'm kinda new at php (even though I'm a Windows Programmer - so at least I have some coding experience).

Thanks a lot.
Title: Re: Log User Names
Post by: Sami on November 28, 2006, 07:11:53 AM
Let me know what do you want to do , your first post was just about possibility
Title: Re: Log User Names
Post by: UrOnline on November 28, 2006, 07:28:45 AM
I would like to have a log (text file or something similar) that has in it - Date, Time, and UserName. Basically whenever a user signs in it should log it. This should be similar to the log files that already exist (in Logging and statistics) such as eCards and Vote Statistics.

I guess it's time for me to go out and buy the PHP For Dummies book (at least to start), and start burning the midnight oil. I would love to have some kind of clue about how pHp works.  ;)
Title: Re: Log User Names
Post by: Sami on November 28, 2006, 07:39:51 AM
You have all this info on database (xxx_usres table)

this plugin may help you to get the idea:

http://forum.coppermine-gallery.net/index.php?topic=35233.0

just look at the codebase.php and find the online_today($html) function , there is a mysql query ;)
Title: Re: Log User Names
Post by: UrOnline on November 28, 2006, 07:41:33 AM
Your the greatest. Thanks for pointing me in the right direction.