Skip to content

Commit

Permalink
BeWelcome#289 feat: Use the same Lightbox gallery (with inter-linked …
Browse files Browse the repository at this point in the history
…images) in the profile's main page than on the gallery page
  • Loading branch information
zeuros committed Oct 25, 2022
1 parent 26c5c11 commit c891ef1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
4 changes: 3 additions & 1 deletion build/gallery/templates/galleryset.column_col3.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
$callback_tag = $formkit->setPostCallback('GalleryController', 'updateGalleryCallback');
?>
<form method="POST"><?= $callback_tag; ?>
<a href="gallery/img?id=<?= $d->id ?>" data-toggle="lightbox" data-type="image" data-title="<?= $d->title ?>"><img class="img-fluid d-block mx-auto mb-1" src="gallery/thumbimg?id=<?= $d->id ?>&amp;t=1" alt="<?= $d->title ?>"></a>
<a href="gallery/img?id=<?= $d->id ?>" data-toggle="lightbox" data-type="image" data-title="<?= $d->title ?>">
<img class="img-fluid d-block mx-auto mb-1" src="gallery/thumbimg?id=<?= $d->id ?>&amp;t=1" alt="<?= $d->title ?>">
</a>
<?php if ($this->myself) { ?>
<a href="gallery/img?id=<?= $d->id ?>" class="btn btn-sm btn-primary"><i class="fa fa-edit mr-1"></i><?= $words->get('Edit'); ?></a>
<input type="submit" class="btn btn-sm btn-danger" name="button" value="<?= $words->getBuffered('GalleryRemoveImagesFromPhotoset') ?>">
Expand Down
33 changes: 20 additions & 13 deletions build/members/templates/profile.subcolumn_right.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,21 +286,28 @@ class="float-right gray align-self-center"><i class="fa fa-flag" alt="<?=$words-
<?php endif; ?>
</h3>

<div class="p-2 d-flex flex-wrap justify-content-around">
<div class="p-2 d-flex flex-wrap justify-content-around"
style="overflow: scroll; max-height: 400px;">

<?php
// if the gallery is NOT empty, go show it
$p = PFunctions::paginate($statement, 1, $itemsPerPage = 8);
$statement = $p[0];
<?php
// if the gallery is NOT empty, go show it
$galleryImages = PFunctions::paginate($statement, 1, $itemsPerPage = 8)[0];

foreach ($statement as $d) {
echo '<div><a href="gallery/show/image/'.$d->id.'">' .
'<img src="gallery/thumbimg?id='.$d->id.'"' .
' alt="image"' .
' style="height: 50px; width: 50px; margin: 1rem;"/>' .
'</a></div>';
}
?>
foreach ($galleryImages as $galleryImage) {?>
<a href="gallery/img?id=<?= $galleryImage->id ?>"
style="max-width: 40%; display: flex; align-items: center; margin-bottom: 1rem;"
data-toggle="lightbox"
data-type="image"
data-title="<?= $galleryImage->title ?>">
<img
src="gallery/thumbimg?id=<?= $galleryImage->id ?>&amp;t=1"
class="img-fluid"
alt="<?= $galleryImage->title ?>"
/>
</a>
<?php
}
?>
</div>
<a class="btn btn-sm btn-block btn-outline-primary" href="gallery/show/user/<?php echo $member->Username;?>/images" title="<?php echo $words->getSilent('GalleryTitleLatest');?>">
<?php echo $words->get('GalleryShowAll');?></a>
Expand Down

0 comments on commit c891ef1

Please sign in to comment.