- Posts: 18
- Thank you received: 0
Sorting of pictures with Photo Gallery Plugin
-
jpmdejonge
Inactive member - Topic Author
- New Member
Less
More
13 years 6 months ago #8409
by jpmdejonge
Sorting of pictures with Photo Gallery Plugin was created 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
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.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
13 years 6 months ago - 13 years 6 months ago #8419
by ivan.milic
Replied by ivan.milic on topic Re: Sorting of pictures with Photo Gallery Plugin
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.
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.
-
jpmdejonge
Inactive member - Topic Author
- New Member
Less
More
- Posts: 18
- Thank you received: 0
13 years 6 months ago #8424
by jpmdejonge
Replied by jpmdejonge on topic Re: Sorting of pictures with Photo Gallery Plugin
Hi Ivan,
As usual you have been of great help.
Thanks, you guys rock!
JP
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