It is a database with trees. Different types (Apples, Pears, Cherries, ...). And each type has subtypes (different types of Apples, ...). Trees are located on several locations. Maybe one user wants to see a specific Apple tree on a specific location. He needs to see the data of that tree and its pictures. Another user (at the same time) may want to see all Apple trees on all locations. Another at the same time wants to see all trees (no matter what kind) on a specific location. They all get the data of all that trees AND all the images of that trees.
All pictures have a name that is made of the recordid of the picturetable + '.jpg'. So the tree with recordid #100 in the treetable can have 3 pictures in the picturetable in eg records #892, #1013 and #1918 in that picturetable, named 892.jpg, 1013.jpg and 1918.jpg in the picturesfolder. The field 'link' in the picturetable
So a bunch of queries on the MySQL database that collect all the data AND all the picturelinks that belong to that data (there is a separate imagestable with all the links of all the images connected to the trees; each tree can have n images connected to it).
I now build a imagelink, space seperated and give it to Fancybox to show a gallery. A few parts based on real code will give you an idea:
Code: |
//(...)
$query = "SELECT * FROM #__picturetable WHERE location='" . $lcode . "' "
. "ORDER BY picturedate DESC";
$db->setQuery($query);
$rowsP= $db->loadAssocList();
foreach( $rowsP as $rowP ) {
// (...)
$gallery .= $rowP['link'] . ' ' ;
}
//(...)
// Tab with picturegallery
$html .= '{tab title="Picture Gallery"}{fancybox url="' . trim($gallery)
. '"}Slideshow pictures{/fancybox}' ;
// (...)
echo $html ;
|
Of course, for a user that needs a complete other selection, another query is used to make the gallerylink to show a complete other set of pictures.