Pages: 1
Hello,
I got a question about a SQL-script I want to build. Let me give you a quick introduction to what my plans are:
- Ik heb inmiddels een Piwigo-galerij gebouwd voor een goede vriendin van mij, waarvoor ik de site beheer. Zij is fotografe en biedt fotoshoots aan tegen betaling. Mensen die een fotoshoot hebben gehad krijgen de foto's van de fotoshoot gratis, maar dan wel slechts tot middelgroot formaat en met een watermerk.
- I built a Piwigo Gallery for a good friend of me. She's a semi-professional photographer and needed a reliable website. She's offering photoshoots to people in exchange for payment. People that got a photoshoot with her will get all the photos by the Gallery, but limited to a max of medium size and with a watermark. If they want printed photos (without watermark) or enlargements, they should order those by a special ordering page. As such a thing doesn't exist I have to script that SQL-query myself. That's no problem, but I need the "user_id" first to check to what categories and photos the person has access.
So, what I need, is the user_id variable contents when a user gets on the ordering page.
I hope you guys understand it all, haha. If not, don't hesitate to ask!
I hope to hear from you soon!
Piwigo version: 2.7
PHP version: native 5.4
MySQL version: 5.5.37-cll
Piwigo URL: http://www.nienkeklijn-fotografie.nl/gallery/
Offline
Hi Blackbird,
You have the current user id in $user['id'] (you can add "global $user;" at the beginning of your function if you're in a function)
Offline
plg wrote:
Hi Blackbird,
You have the current user id in $user['id'] (you can add "global $user;" at the beginning of your function if you're in a function)
Thanks! So If I'm right $user is an array here with the id in it? Can I exclude this Id like this?:
<?php $user_id = $user{'id'}; ?>
Then, user_id contains the user if I'm right? (It's some time ago I practised with this PHP). Thanks again!!
Last edited by Blackbird (2014-10-02 22:23:30)
Offline
Pages: 1