1
I’m having a hard time doing Lightbox open a gallery specifies to load the images from a certain directory. At this point the code below lists several thumbnails, which would be the picture albums. When I open an image, it works the resource, but lists the thumbnails, not what is in the directory of that ID
.
This is possible. Images are separated into different directories depending on the ID
gallery. The path is recorded in the database, and the file in a directory. See my code:
PHP
foreach($dados_fotos as $gal) {
$fotos_treinamento .= <<<HTML
<div class="medium-3 columns end">
<a rel="lightbox[]" data-group="gallery-{$gal['galeria']}" href="http://sistema/public/uploads/fotos/{$gal['galeria']}/{$gal['foto']}">
<div class="card">
<div class="card-section">
<img data-galery="gallery-{$gal['galeria']}" src="http://sistema/public/uploads/fotos/{$gal['galeria']}/{$gal['foto']}"/>
</div>
</div>
</a>
</div>
HTML;
}
EDIT
Bank query, the gallery ID, the image ID, and the photo path are saved in the database.
The directory in the folder where the physical files are located is the same as the gallery ID. ex: fotos/ID_GALERIA/arquivo.jpg
I don’t understand the tag
javascript
if you’re usingphp
...– MagicHat
I corrected, thank you
– Eduardo Santos
what data does
$dados_fotos
receives, or mehlor as it picks up this data ?– MagicHat
If you can put that in the question for me to visualize... Num sounds very difficult, but I’m a little slow to process hj.. hehe But put the code....
– MagicHat
I edited there friend
– Eduardo Santos
this thumbnail that refers, is the file and it is being presented as thumbnail (due to interference of the plugin) or is another file ?
– MagicHat
It is the first file of the array
– Eduardo Santos
I’m having a little trouble understanding..."but lists the thumbnails, not what’s in the directory of that ID", Based on the table you sent, which is exactly the name of the file and the
path
that is being returned ?– MagicHat
What I want I believe to look like this link http://wbruno.com.br/ajax/usando-lightbox-em-pagina-carregada-ajax/ see if you can understand better
– Eduardo Santos
Sorry, link is not loading if you can answer the previous question...
– MagicHat
Yes the images are in the directory of that ID and the directory is equivalent to id for example in the database have image xxxx.jpg gallery 5. The directory will be uploads/photos/5/xxxx.jpg
– Eduardo Santos