Hello,
I'm having a problem getting the username into a block of PHP inside of the album.tpl file.
Generally, what I'm doing is that each time a user loads an album page, I'm logging their activity to a file. I had this code working fine in Gallery1, but now in Gallery2 I can't get it going. Here's what I've put into the album.tpl of my theme:
{php}
$logpath = "/usr/share/gallerylogs/log.html";
$username = $user.userName;
$fp = fopen($logpath, "a");
fputs($fp, date("H:i:s m/d/y") . "- $username - \n");
fclose($fp);
{/php}
The problem is that $user.userName does not work inside of the {php} tags -- just outside (for example, I can render the username onto the screen just by putting {user.userName} somewhere else in the template.
My question is this: is there anyway to access the userName from within the PHP block?
Thanks!
Posts: 3
dump