Sorting of pictures with Photo Gallery Plugin

More
13 years 6 months ago #8409 by jpmdejonge
Dear support,

Thankk you for the great template and extensions, awesome!

I have one question. How could I change the order of the pictures displayed in the article and the lightbox when using the Photo Gallery plugin?

I have tried to discover how it is sorted by default but I was not able to find out.

Your help is most appreciated!

Jean-Paul

Please Log in to join the conversation.

More
13 years 6 months ago - 13 years 6 months ago #8419 by ivan.milic
The simple reason is that there is no sorting at all , so that is left to server hosting your site to do that.

Open plugins\content\photogallery.php

Find this:
....
$image_files = get_files($images_dir);
if(count($image_files)) {
$index = 0;
foreach($image_files as $index=>$file) {
....


and add sort statement before foreach loop:

....
$image_files = get_files($images_dir);
if(count($image_files)) {
$index = 0;
sort($image_files);
foreach($image_files as $index=>$file) {
....

This way sorting will be by image name.
Last edit: 13 years 6 months ago by ivan.milic.

Please Log in to join the conversation.

More
13 years 6 months ago #8424 by jpmdejonge
Hi Ivan,

As usual you have been of great help.

Thanks, you guys rock!

JP

Please Log in to join the conversation.

Time to create page: 0.288 seconds
Powered by Kunena Forum