- Posts: 11
- Thank you received: 0
image ordering on gallery
14 years 9 months ago #7342
by canda13
image ordering on gallery was created by canda13
Hi,
I am trying to order my images published in the following gallery:
www.greatorexfinearts.com/index.php?opti...cle&id=28&Itemid=120
as you can see the different sizes are all mixed, even though I have named the images 01, 02, 03 etc
Please advise how I can sort the images into the order that I want
Many thanks,
Chris
I am trying to order my images published in the following gallery:
www.greatorexfinearts.com/index.php?opti...cle&id=28&Itemid=120
as you can see the different sizes are all mixed, even though I have named the images 01, 02, 03 etc
Please advise how I can sort the images into the order that I want
Many thanks,
Chris
Please Log in to join the conversation.
-
ivan.milic
Support Staff -
- Offline
- Moderator
-
Less
More
- Posts: 14116
- Thank you received: 1639
14 years 9 months ago - 14 years 9 months ago #7357
by ivan.milic
Replied by ivan.milic on topic Re: image ordering on gallery
Hi,
open file
plugins\content\photogallery.php
find next function and add red marked line:
function get_files($images_dir,$exts = array('jpg')) {
$files = array();
if($handle = opendir($images_dir)) {
while(false !== ($file = readdir($handle))) {
$extension = strtolower(get_file_extension($file));
if($extension && in_array($extension,$exts)) {
$files[] = $file;
}
}
closedir($handle);
}
asort($files);
return $files;
}
open file
plugins\content\photogallery.php
find next function and add red marked line:
function get_files($images_dir,$exts = array('jpg')) {
$files = array();
if($handle = opendir($images_dir)) {
while(false !== ($file = readdir($handle))) {
$extension = strtolower(get_file_extension($file));
if($extension && in_array($extension,$exts)) {
$files[] = $file;
}
}
closedir($handle);
}
asort($files);
return $files;
}
Last edit: 14 years 9 months ago by ivan.milic.
Please Log in to join the conversation.
Time to create page: 0.263 seconds