I'm too stupid to get the right variables... I'm too stupid to get the right variables...
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

I'm too stupid to get the right variables...

Started by lamama, October 06, 2004, 04:25:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lamama

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)...  ::)

Nibbler

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.

lamama