The attached patch:

  • allows users to configure how they want to sort images: most to least recent (default) or vice versa (chronologically);
  • also sorts by the node's nid.

The latter 'feature' might need some explanation. I use a mass image submission module, and images are submitted so fast that timestamps are exactly the same. If timestamps are the same for many images they get sorted randomly, and I do not want life to be random. This patch sorts nodes by their nid (so in the order they were added) when the timestamp is the same.

Comments

praseodym’s picture

This patch will fix http://drupal.org/node/21037.

decafdennis’s picture

Assigned: decafdennis » Unassigned
Status: Needs review » Needs work

Appearantly this patch will not apply anymore with the (unannounced?) splitting of image and image_gallery.

seventhguardian’s picture

Status: Needs work » Needs review
StatusFileSize
new2.74 KB

Here's a patch against current version 5.x-1.x-dev of the file image/contrib/image_gallery/image_gallery.module.

It should apply fine now :)

Hetta’s picture

Component: image.module » image_gallery

I get this error, after applying the patch to image_gallery 5.x-2.x-dev:

user warning: Unknown column '$order' in 'order clause' query: SELECT DISTINCT(n.nid) FROM node n INNER JOIN term_node tn ON n.nid = tn.nid WHERE tn.tid IN (15669,15737,16198,15679,16213,16193,15692,16212,15735,16211,15678,15759,15680) AND n.status = 1 ORDER BY n.sticky DESC, $order LIMIT 0, 1 in /srv/www/htdocs/includes/database.mysql.inc on line 178.

seventhguardian’s picture

As I said, it's a patch against 5.x-1.x-dev, not 2.x...

The 2.x version should have changed too much for it to apply cleanly. I'm not using the 2.x version, but it can probably be manually applied.

drewish’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev
Status: Needs review » Needs work

looks pretty good, the only thing i'd like to see changed is a comment explaining why you're sorting by nid.

drewish’s picture

marked http://drupal.org/node/188114 as a duplicate.

joachim’s picture

The latest 2.x-dev release will allow you to add node ID as a sort criterion to the View that the galleries are generated with.

Hetta’s picture

Status: Needs work » Fixed

Views also lets you sort by, say, title, or author, or ...

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

smileybri’s picture

I just don't see this. I can't sort a gallery on my installation. I have Image 5.x-1.7 and Views 5.x-1.6. I don't see Image Gallery under default views, but I created a view called image_gallery and gave it a sort by title, but my gallery is still not sorted. I realize that I don't know what I am doing, and I am missing something, but the way you all talk about it leaves novices out of the loop. I don't mean to complain, but I just read through the docs, and the support tickets, and all and none of you are speaking my language.

Like I said, I am sure it is me. All I want to do is sort the Image Gallery. I have been at this for hours.

smileybri’s picture

Hetta’s picture

http://drupal.org/node/21037 has a very nice patch for 5.x-1.x (and 5.x-2.x-dev).

smileybri: Views isn't integrated with image 5.x-1.x - you need 5.x-2.x-dev for that.