Announcement

#1 2017-09-20 22:30:53

syst3mboot
Member
2017-09-09
6

[HELP] Piwigo API method for changing album sort order

Hello,

Is there an API method for changing the sort order on the albums. I sometimes use the API to upload images to older albums and want them to appear on top when someone visits the website. I believe there's something similar for order images with pwg.images.setRank but I can't find anything for albums.

Kind regards.

Piwigo version: 2.6.3

Offline

 

#2 2017-09-21 21:39:56

syst3mboot
Member
2017-09-09
6

Re: [HELP] Piwigo API method for changing album sort order

Haven't heard a reply so I made my own but rather than using the API I just made it create a POST call to /admin.php?page=cat_list with the following data:

pwg_token=pwg token, obtainable via API
submitManualOrder=Save manual order
catOrd[10]= 0
catOrd[7]= 1
catOrd[8]= 2
catOrd[4]= 3
catOrd[3]= 4
...etc

Note: the catOrd has to be called for every album in your Piwigo library, (I normally get a list of albums with the api, remove the album I require to be first, and add it to top of the list). The number in the square brackets is the album id, the number after the equal sign is the order you want it in.

It's a bit annoying to get a full album list, rearrange the entire list, and send it back to the server, but hey, it works and once implemented only costs you a little more processing power.

Last edited by syst3mboot (2017-09-21 21:41:24)

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact