Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: I'm too stupid to get the right variables...  (Read 2910 times)

0 Members and 1 Guest are viewing this topic.

lamama

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 404
I'm too stupid to get the right variables...
« 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)...  ::)
« Last Edit: October 06, 2004, 01:59:10 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: I'm too stupid to get the right variables...
« Reply #1 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.
Logged

lamama

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 404
Re: I'm too stupid to get the right variables...
« Reply #2 on: October 06, 2004, 01:54:16 pm »

hey, it works! :o

thx a lot!   :D
Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 20 queries.