By Dennis Hosang on Wednesday, 06 January 2016
Posted in General Issues
Replies 3
Likes 0
Views 565
Votes 0
Does anyone know how to set the default sort for the photos inside an Album? I have several about 70 photos in a jeep build project i have but they are scattered all over and I would like to put the in order. Not sure if they need to have a filename (jeep-01, jeep-02, etc..) to sort or if there is another means.

Any help or comments are appreciated.
Hi Dennis,

I am really sorry for the delay of this reply.

I just take a quick look on the code and the ordering is determined by the date of uploaded picture where the oldest picture will stay at the top of the albums. If you want to change the ordering so that the latest picture will be at the top, you can modify this by going to your /administrator/components/com_easysocial/includes/albums/albums.php at line 190 add one more options as follow:
$newPhotos = $model->getPhotos( array( 'album_id' => $albumId, 'start' => $nextStart, 'limit' => $tmpLimit , 'state' => SOCIAL_STATE_PUBLISHED, 'privacy' => $isPrivacyRequired) );

// change to

$newPhotos = $model->getPhotos( array( 'album_id' => $albumId, 'start' => $nextStart, 'limit' => $tmpLimit , 'state' => SOCIAL_STATE_PUBLISHED, 'privacy' => $isPrivacyRequired, 'sort' => 'ASC') );


Hope these help.
·
Wednesday, 06 January 2016 12:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you for the reply and suggestion. Would you have a suggestion on how to set it up to sort by name ASC so if I labeled a picture Jeep-01 it would be first and Jeep-02 would be second and so on. If I use date of picture I would have to delete 70 pictures out of the album and upload one at a time and that sounds like a big pain in the butt. Would be great for possible a future enhancement to allow user to change order of album pictures.
·
Wednesday, 06 January 2016 20:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Dennis,

Thanks for your kind input. We will consider this in the future. In the meantime you can try to go to your /administrator/components/com_easysocial/models/photos.php and change the following code at line 385 to order your photos by title:
$query[] = "order by a.`ordering` $sort";

// Replace with

$query[] = "order by a.`title` ASC";


Hope these help.
·
Thursday, 07 January 2016 11:06
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post