Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Ascending sort thumbnails by a custom numeric field  (Read 5568 times)

0 Members and 1 Guest are viewing this topic.

dimangelid

  • Coppermine novice
  • *
  • Country: gr
  • Offline Offline
  • Gender: Male
  • Posts: 31
Ascending sort thumbnails by a custom numeric field
« on: January 27, 2019, 10:14:00 pm »

Hello,

I have installed version 1.5.46 at my website. We have setup some custom fields and our users complete them when uploading any photo.

Now we want to ascending sort thumbnails on all albums by one of these fields, which is numeric. Such option is not available at gallery settings.

Is anyone aware how can i achieve that?
Logged

dimangelid

  • Coppermine novice
  • *
  • Country: gr
  • Offline Offline
  • Gender: Male
  • Posts: 31
Ascending sort thumbnails by a custom numeric field
« Reply #1 on: February 10, 2019, 11:34:59 pm »

Hello,

I have installed version 1.5.46 at my website. We have setup some custom fields and our users complete them when uploading any photo.

Now we want to ascending sort thumbnails on all albums by one of these fields, which is numeric. Such option is not available at gallery settings.

Is anyone aware how can i achieve that?

Hello again,
Is anybody aware on how to achieve that?
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: Ascending sort thumbnails by a custom numeric field
« Reply #2 on: February 10, 2019, 11:40:48 pm »

Not quite sure what you are asking. Maybe this thread will help https://forum.coppermine-gallery.net/index.php/topic,63706.msg375149/topicseen.html#msg375149
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Ascending sort thumbnails by a custom numeric field
« Reply #3 on: March 14, 2019, 10:02:19 pm »

I assume you're talking about that option: https://documentation.coppermine-gallery.net/en/configuration.htm#admin_thumbnail_default_sortorder

The probably easiest way would be to set that value to "Position ascending" and create a small script that updates the value of the position field with the value of your custom field (I can provide such a script, if you cannot create it yourself). Of course this script needs to be run regularely (e.g. with a cronjob) to update any changes in the custom fields or if new files are added to your gallery. Alternatively you could modify the Coppermine code to use the custom field instead of the position field, but modifying core files is not recommended.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.