Closed infomaniaco closed 9 years ago
Hi, this is impossible to do with donkeyGallery at now. Probably in the next future I will add a new feature that allows a json data loading instead the actual folder file listing. The only thing you can do is to write a php script that calls your db and returns a json response with the data you want to add on your images, then, with some javascript code, you can append the new data on each image.
thanks for your answer, I'm thinking to calls my DB and take the info modifing this function :
galleryGenerate($galleryPath,$forceGenerate,$thumbSizes,$elementId,$root) {
$md5check = md5check($galleryPath,$root);
$galleryImages = imageList($root.$galleryPath);
$galleryNumb = count($galleryImages);
for ($i=0; $i<$galleryNumb; $i++) {
if (($forceGenerate == 1) or (md5check == "changed")) {
thumbGenerate($galleryImages[$i],$galleryPath,$thumbSizes,$root);
}
$alt = $i+1;
//call DB and take info of "galleryImages[$i]"
//$code['jsonInfo'][]= "IMAGES INFO HERE"
$code['jsonFancy'][] = "<a href=\"".$galleryPath.$galleryImages[$i]."\"><img src=\"".$galleryPath."thumb/thumb-".$galleryImages[$i]."\" alt=\"Image ".$alt."\" />";
$code['jsonNoFancy'][] = "<img src=\"".$galleryPath."thumb/thumb-".$galleryImages[$i]."\" alt=\"Image ".$alt."\" />";
$galleryJsArray[] = "
{
'href' : '".$galleryPath.$galleryImages[$i]."'
}
";
}
return $code;
}
Is that possible? or am I doing it wrong?
Yes i think is possible, but remember that this function is used to generate a json response for the jquery plugin, so (to obtain a new markup with new data) you need to modify the jquery.donkeyGallery.js file too .
Well, so I must use a new markup for my new information from my DB or can I use that one?
PHP galleryFunction.php ==> function galleryGenerate
function galleryGenerate($galleryPath,$forceGenerate,$thumbSizes,$elementId,$root) {
$md5check = md5check($galleryPath,$root);
$galleryImages = imageList($root.$galleryPath);
$galleryNumb = count($galleryImages);
for ($i=0; $i<$galleryNumb; $i++) {
if (($forceGenerate == 1) or (md5check == "changed")) {
thumbGenerate($galleryImages[$i],$galleryPath,$thumbSizes,$root);
}
$alt = $i+1;
//HERE I OBTAIN THE INFO (STRING) BY USING THE NAME OF IMAGE
$info= infoDB($galleryImages[$i]);
$code['jsonInfo'][]=$info; //HERE I WANT TO PASS THIS INFO
$code['jsonFancy'][] = "<a href=\"".$galleryPath.$galleryImages[$i]."\"><img src=\"".$galleryPath."thumb/thumb-".$galleryImages[$i]."\" alt=\"Image ".$alt."\" />"; $code['jsonNoFancy'][] = "<img src=\"".$galleryPath."thumb/thumb-".$galleryImages[$i]."\" alt=\"Image ".$alt."\" />"; $galleryJsArray[] = " { 'href' : '".$galleryPath.$galleryImages[$i]."' } "; } mysqli_close($connessione); return $code; }
//this is a piece of JQUERY.DONKEYGALLERY.JS
switch (settings.fancybox.active) { case false: var count = Object.keys(data.jsonNoFancy).length; for (var i=0; i<count; i++){ markup += "
I really need help to continue with clarity, my target is to view the image with description saved in a DB with the name of the image (puoi rispondere anche in italiano)
I think for .... { markup += ""+ fCssOpen + data.jsonNoFancy[i] + data.jsonInfo[i] + fCssClose +""; }
Hello everyone, I am new here and I would like to explain to you a problem that is concerning me regarding Donkey Gallery (http....). Donkey Gallery is a set of ajax, php and css which cooperate in order to create a beautiful, fast and clean picture gallery wich can be easily inserted into websites. Donkey Gallery is a set of ajax, php and css which cooperate in order to create a beautiful, fast and clean picture gallery which is easy to insert into websites. . As you can see it will be enough to charge your own pictures into the /images cartel and open an empty class. example: (
[IT] Salve a tutti, sono nuovo quì, e vorrei esporvi un problema che mi affligge riguardo Donkey Gallery (http://factory.brainleaf.eu/donkeyGallery/) DonkeyGallery è un insieme di ajax, php e css che cooperano per avere una galleria di immagini bella,veloce,pulita, e sopratutto facile da implementare nei propri siti web. Infatti basta caricare le proprie immagini nella cartella /images e aprire un div vuoto
esempio:(
Nella pagina in html per avere una buona presentazione delle immagini. Questo è il mio problema: ho delle informazioni contenute nel mio database per ogni immagine, e vorrei e si potessero visualizzare insieme all'immagine, come potrei farlo?
fonte:https://help.github.com/articles/github-flavored-markdown Donkey gallery download: https://github.com/Gix075/donkeyGallery