Member
Member
drewhack   2008-12-06, 17:50
#1

Okay I may be asking for too much on this one.
Is there a way to include search results on a webpage out of zenphoto.

Lets say for example I have a website for a theatre group with zenphoto for the image gallery. I have photos uploaded into ZenPhoto and tagged appropriately by actor. On their Bio page can I put a script in to pull the search results portion of a page. For example on the Bio Page for the Actor "Josh" it would display all the images that are tagged with "Josh." Im not a novice with PHP mysql but I have not made much sense out of the zenphoto descriptions, a code example would be great!
Thanks!

Administrator
Administrator
acrylian   2008-12-06, 18:06
#2

Take a look at our table setup. We have a table for the images (images), one table that stores all the tags (tags) and one table that stores the connections between the tags and the images (or albums) (obj_to_tag). You need to do the following:

  1. Get the id of the tag "josh" for example for the tagstable.
  2. Search the obj_to_tag table for the occurances of that id and get the objectid of those which is the id of the object attached. Since you want the images you need to query for the type "images".
  3. Now get use the array you got to get the images by id from the images table. Now you have the images with the tag "josh".

An alternative would be to do a tag search and create a dynamic album from it and then call that.

I can't give a code example but if you said you are not a novice to PHP and MySQL so that should help.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.