forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: lamama on October 06, 2004, 04:25:33 am

Title: I'm too stupid to get the right variables...
Post by: lamama on October 06, 2004, 04:25:33 am
I thought it would be nice to know what users watch which picture in my  gallery.

So I tried to write a simple logger (writes into a separate database table everytime a picture is displayed)

Everything works fine, but...

I'm only too stupid to find out where I get the required values in which (global?) variables.

The logger is placed inside displayimage.php, function html_picture()  because it looked like a proper place to put it.
I want to log
- album
- URL of the Pic
- Username
- IP of User

Album and URL is no problem, but where to get the Username and the IP from? ???
Or do I have to place the logger lines somewhere else?

I'm sorry if that is a newbie question (i fear it is)...  ::)
Title: Re: I'm too stupid to get the right variables...
Post by: Nibbler on October 06, 2004, 12:27:37 pm
There is the constant USER_NAME which holds the username and you can get the IP witrh $raw_ip and $hdr_ip or from the server vars directly. You may need to global the ip vars to be able to use them inside the function.
Title: Re: I'm too stupid to get the right variables...
Post by: lamama on October 06, 2004, 01:54:16 pm
hey, it works! :o

thx a lot!   :D