ZenphotoCMS Forum
additional SELECT needed - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: additional SELECT needed (/thread-930.html)



additional SELECT needed - SaS - 2006-12-05

Hi All,
I have started using ZP a few days ago; but I am slightly customizing it in order to give users a basic interface to upload their own pictures. I have no major problem with that.
Unfortunately, for legal reasons, in the country I live in, it is not allowed to publish pictures (or any content) if it is not approved by the webmaster. Therefore, I am looking for a way to "validate" the pictures before publishing them online. An easy way I am trying to code is to add a 1-character field in the 'image' table : 'N'=not approved yet, 'Y'=approved. By default, each photo uploaded get the 'N' value.
My problem... is that I am not able to select the thumb to be printed on screen. I have noticed that actually all the thumbs are printed. My question is then : where could I add a SELECT quesry on the DB n oder to have online only the validated='Y' thumb (and therefore, pictures) ???

Help welcomed !

---SaS




additional SELECT needed - trisweb - 2006-12-05

Hmmmm....

This is interesting because generally, Zenphoto uses the filesystem to display all photos, so if it's in the folder, then it gets displayed.

I think you'll need to add the filtering in the sortImageArray method in the Album class. Make a database call (with a "WHERE approved='Y'" or something), and remove images from the array if they're not in the query results. You can do that before the return statement.