forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: nambroque on April 20, 2016, 11:06:31 pm

Title: Sorting linked files by position
Post by: nambroque on April 20, 2016, 11:06:31 pm
At the moment, if you have an album which "contains" only linked files, it is not possible to establish their position in the album.
Would that be possible?
In case not, then I would like to know if it maybe be possible to hide the option of sorting files by position in those albums which contain no photo (or which "contain" only linked files), as that option has no sense in them.
Thanks in advance
Title: Re: Sorting linked files by position
Post by: Αndré on April 22, 2016, 10:19:45 am
Some background information to understand how Coppermine sorts files. When you sort files in their "regular" album (i.e. the album you actually uploaded them to) Coppermine adds an ascending value in the database, according to your sorting. Now, if you view an album with linked files, the same values will be used to order the pictures in that album. There's no way to change that without code modification.


In case not, then I would like to know if it maybe be possible to hide the option of sorting files by position in those albums which contain no photo (or which "contain" only linked files), as that option has no sense in them.

As I personally don't use that feature, I need to ask where/how exactly you want to disable that feature. As far as I know the only way to sort pictures is to use the "Sort my pictures" button in the main menu. On the "Picture Manager" you need to select the album. Do you want to hide albums without pictures in the picture manager?
Title: Re: Re: Sorting linked files by position
Post by: nambroque on April 25, 2016, 10:17:50 pm
Some background information to understand how Coppermine sorts files. When you sort files in their "regular" album (i.e. the album you actually uploaded them to) Coppermine adds an ascending value in the database, according to your sorting. Now, if you view an album with linked files, the same values will be used to order the pictures in that album. There's no way to change that without code modification.


As I personally don't use that feature, I need to ask where/how exactly you want to disable that feature. As far as I know the only way to sort pictures is to use the "Sort my pictures" button in the main menu. On the "Picture Manager" you need to select the album. Do you want to hide albums without pictures in the picture manager?

Thanks for your reply André
I'll try to explain better what I mean: At the moment, if someone is looking at an album which contains only linked files, and he/she arranges the pictures by "date" (of upload) or by "position", it is the same.
So, what I mean is that if an album contains no files (only linked ones) the option of arranging them by position (when you are seeing the album. not in the picture manager) is not useful.
For instance, you can see any of the albums of this category (http://fotometeo.ame-web.org/index.php?cat=73), and arrange them by date and then by position, and you will see that nothing will change
So, what I was asking is if it may be possible that if an album contains no files (only linked ones) the option of arrange the files by position when you are seeing the album does not appear.
Title: Re: Sorting linked files by position
Post by: Αndré on April 26, 2016, 09:21:39 am
Okay, now I got what you mean.

if someone is looking at an album which contains only linked files, and he/she arranges the pictures by "date" (of upload) or by "position", it is the same.
This also applies to the rest of the albums in your gallery, if you don't manually sort your pictures (which is probably the case, as it would also affect albums with only linked files). I suggest to disable that sort option for your whole gallery. Do you agree?
Title: Re: Re: Sorting linked files by position
Post by: nambroque on April 26, 2016, 09:55:38 am
Quote from: Αndré
Okay, now I got what you mean.
This also applies to the rest of the albums in your gallery, if you don't manually sort your pictures (which is probably the case, as it would also affect albums with only linked files). I suggest to disable that sort option for your whole gallery. Do you agree?

Yes, that would be good...
Title: Re: Sorting linked files by position
Post by: Αndré on April 27, 2016, 09:57:35 am
Open js/thumbnails.js, find
Code: [Select]
    sortable += separator;
   
    sortable += '<span class="sortorder_options">';
    sortable += js_vars.sort_vars.sort_position;
    sortable += '</span>';
    sortable += '&nbsp;';
    sortable += '<span class="statlink">';
    sortable += '<a href="thumbnails.php?album=' + js_vars.sort_vars.aid + '&amp;page=' + js_vars.sort_vars.page + '&amp;sort=pa" title="' + js_vars.sort_vars.sort_pa + '"><img src="images/ascending.png" width="9" height="9" border="0" alt="+" /></a>';
    sortable += '</span>';
    sortable += '&nbsp;';
    sortable += '<span class="statlink">';
    sortable += '<a href="thumbnails.php?album=' + js_vars.sort_vars.aid + '&amp;page=' + js_vars.sort_vars.page + '&amp;sort=pd" title="' + js_vars.sort_vars.sort_pd + '"><img src="images/descending.png" width="9" height="9" border="0" alt="-" /></a>';
    sortable += '</span>';
   
and delete or comment it out.
Title: Re: Sorting linked files by position
Post by: nambroque on April 27, 2016, 10:13:49 am
Thanks, solved  :)