How do you access Gallery's 'user ID' from PHP rather than from Smarty?
|Posted: Thu, 2007-05-24 14:24|
I am trying to add a few PHP-driven pages onto the side of my Gallery2 application to make a website. The extra PHP pages will be for users to write and save a variety of personal information under their Gallery2 username and password (i.e. they would sign-in on the website, where they would be able to edit their gallery as well as edit their information under the same session). I don't want to use any blog/3rd party application to do this as what I need to do is not covered elsewhere. I thought this would be a simple task, as I thought all I would need was to identify the 'user id' of the user once they sign in - I could then use this 'user id' in some new PHP tables, that I will create, against their personal information to only allow a user's information to be edited by themself once they had logged in). I'm happy writing the PHP stuff once I've been able to access the 'user id' variable in PHP (i.e. not in Smarty).
To test this - once I can 'echo' the 'user ID' in a PHP file I'm happy doing the rest, as it will mean I've managed to identify and use the variable. The principle is that I want to be able to do the same as this Smarty code, but in PHP:
I thought the other way might be like this (http://gallery.menalto.com/node/58611) but I can't get that to display either :
I tried these 2 methods, neither of which I can get to work:
1) embedding Gallery2 in my website and accessing it via an external PHP page within which I might be able to use the 'user ID' variable:
2) adding a new template.tpl file that uses an 'include' to access another PHP file, within which I use the 'user ID' variable:
I'm really struggling to get this to work (having spent 2 days searching the forums and everywhere else since). Can anyone help, as I'm sure I'm missing something simple that might help others trying to embed their gallery into their website?
Thanks in advance.