The "last viewed" feature shows IP addresses when viewed as an admin. Is there a way to modify Coppermine to allow showing the person's user name instead of their IP address?
Having the ability to show both might be nice as well. Also, I only want this information displayed when browsing as an admin. I don't want the general public knowing who has looked at what.
I looked for a mod, plugin, or hack that would do this, but I can't find anything. I might have a go at it myself, if someone wanted to point me in the right direction. (I'm a total beginner at php.)
thanks,
Glen
Not a feature request. Moving to support board.
So, does anyone know how to do this?
thanks,
Glen
It's easy
find in /include/functions.inc.php
cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET hits=hits+1, lasthit_ip='$raw_ip', mtime=CURRENT_TIMESTAMP WHERE pid='$pid'");
replace with
cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET hits=hits+1, lasthit_ip='" . USER_NAME . "', mtime=CURRENT_TIMESTAMP WHERE pid='$pid'");
probably you should remove slashes too in same functions.inc.php
find
$caption .="<br/>".row['lasthit_ip'];
replace with
$caption .="<br/>".stripslashes ($row['lasthit_ip']);
and also replace the heading IP to username in your theme
Thank you, Veronica! That does exactly what I wanted.