album.sort_order in RSS Feeds issue

thank you all for the great platform. it's amazing.

I've customized ZP to be used as an image repository that a flash file subscribes to via RSS to show specific images on a site.

i'm having an issue sorting the albums within the RSS feed. Using the album.sort_order field - I would like the RSS Feed to show images based on the order specified within ZP. makes sense right?

when i change the SQL query to sort upon album.sort_order - the feed rearranges the order of the albums displayed within the RSS feed. I've checked my SQL and it works on a std php page, but when I put the RSS code back into the file, the entries are outputted randomly and not by the sorted order from the SQL query.

any ideas to correct this would be greatly appreciated.

thx!

-m

Comments

  • Album.sort_order is the manual sort order of the album. You will have to change the query to use the proper field based on the album sort order. This can be obtained from `getSortKey($album->$this->getSortType())`
  • hi, thanks for the reply.

    i previously changed my query to this:

    $result = query_full_array("SELECT images.albumid, images.location AS firstname, images.city AS lastname, images.state AS URL01, images.country AS counter01, images.credit AS URL02, images.copyright AS counter02, images.date AS date, images.mtime AS mtime, images.filename AS filename, images.desc, images.title AS title, albums.folder AS folder, albums.title AS albumtitle, albums.desc AS albumdesc, albums.sort_order as sortorder, images.show, albums.show, albums.password FROM MTVd_images AS images, MTVd_albums AS albums WHERE images.albumid = albums.id AND images.show=1 AND albums.show=1 AND albums.folder != '' ORDER BY albums.sort_order");

    which works when rendered in a php page, but then when rendered through a rss reader - the order is changed.

    i want to use the manual sort order that is saved within the album.sort_order field. perhaps I am not following your response.

    assigning the statement above to a string variable and printing it kills all posts. i am not sure what i am doing wrong.
  • acrylian Administrator, Developer
    Well, maybe the rss readers sort themselves by date? I would suggest you use the class methods to get the images. See the documentation on how to do that (you need a little understanding of object orientation in php)
  • Well, you are quering for images, so ordering them by the album's sort order will probably not get you what you desire. How about just ordering them by sort_order? Or at least images.sort_order.
Sign In or Register to comment.