Open a gallery via ID with Lightbox

Asked

Viewed 152 times

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

inserir a descrição da imagem aqui

  • I don’t understand the tag javascript if you’re using php...

  • I corrected, thank you

  • what data does $dados_fotos receives, or mehlor as it picks up this data ?

  • 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....

  • I edited there friend

  • this thumbnail that refers, is the file and it is being presented as thumbnail (due to interference of the plugin) or is another file ?

  • It is the first file of the array

  • 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 ?

  • 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

  • Sorry, link is not loading if you can answer the previous question...

  • 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

Show 6 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.