By blicod on
Is there a way to display image-galleries in reverse order.
I have galleries shown with a rewritten fgallery.module but I want to reverse the view order
Today it list the gallery like this!
gallery1
--date 2007.01.22
--date 2007.01.26
--date 2007.02.02
--date 2007.02.04
I want it to list like this (reverse order)
gallery1
--date 2007.02.04
--date 2007.02.02
--date 2007.01.26
--date 2007.01.22
I could use "Weight" option but when I come up to more than 20 sub-galleries it will be the same problem I think.
Got a tip that it probably will work to override the image_gallery.css ... But how?
The image_gallery.css looks like this:
ul.galleries {
list-style-type : none;
margin : 0;
padding : 0;
}
ul.galleries li {
background : #181818;
border : 1px #181818 solid;
color: #acacac;
margin : 1em 0;
padding : 1em;
}
ul.galleries li img {
float : left;
padding-right : 4px;
margin-right : 4px;
}
ul.galleries li div.count {
clear : both;
}
ul.galleries h3 {
margin : 0;
padding : 0;
}
ul.images {
list-style-type : none;
margin : 0;
padding : 0;
}
ul.images li {
float : left;
margin : 1em;
}
Comments
Hope You Get an Answer
I posted the same question yesterday at http://drupal.org/node/120327 and am still waiting for some guidance. So I'm hoping that one of us gets a bite.
Hack image_gallery.module?
I think you could change it in function image_gallery_page within image_gallery.module
Maybe something like changing
to
Just an idea (haven't tried it).
--Zivtech--
:(
Thanks for the tip but it didn´t work for me.
Tried to create a new gallery with sub-galleries but it still show the sub-galleries in alphabetical order.
Any other suggestions?
Hacking Image Gallery Should Work
Have a look here at this. I think this is the function in Image Gallery where the image references are put into the images array.
This is just an SQL query that includes "ORDER BY n.sticky DESC, n.created DESC". Perhaps we could make it ORDER BY n.sticky DESC, n.created DESC ASCENDING or something like that and it would load the images up in reverse.
Well I tried the ASCENDING hack. It didn't break Image Module but it didn't fix it either.
We need a PHP/Drupal wiz to give us a hand.
Try array_reverse
The function is calling taxonomy_get_tree which automatically orders the taxonomy array by weight and then alphabetically. You could add array_reverse(taxonomy_get_tree... ) and try to turn the whole thing backwards.
--Zivtech--
<?phpfunction
Tried that and no effect. Code didn´t break
<?phpfunction
Tried that and no effect. Code didn´t break
array_reverse Didn't Work
Good idea but it didn't do the trick.
In my case the photos are ordered in descending order by the node reference with the largest node number first. This ordering may be independent of any ordering of the photos in the images array of the Image Gallery module. So .. is there a way to reorder the display of nodes?
Ordering images or sub-galleries?
Are we trying to reorder the images within the gallery or are we reordering the list of sub-galleries for the gallery? I am thinking maybe you guys are wanting two different things? Let me know... I have some new ideas and I hope they're getting better!
--Zivtech--
sub-galleries
hehe...sub-galleries
and images to... But there is an other thread for that.
Take a look at the site nottie.net/gallery and you´ll see that the sub-galleries is named by date and the oldest date come at the top of the list. I like to reverse this.
Are You Sure?
I bet the subs are in alphabetical not chronological order. Add another one to check.
Ok, still think you need array_reverse then...
Try adding the line like that.
--Zivtech--
We are talking Gallery or Sub-Gallery Order - Correct?
I'm assuming this change, if it works would affect the Gallery or Sub-Gallery order. So my question is: to change the order photos are displayed within a Gallery do I have to hack the image module or the image gallery module. I'm betting it's the image module.
I'm Mostly Interested in the Order Photos are Displayed
But I'm really interested in fixing both the album and the photo order.
My preferences:
Galleries should be listed chronologically with the most recent on top. Currently they are alphabetical. Perfection would be a toggle.
Photos within galleries should be listed in reverse chronological order with newest last.
But my main focus is photo order. I can live with alphabetical albums.
Photos within galleries
Photos within galleries should be listed in reverse chronological order with newest last.
Can´t you just add the images in reverse chronological order. Then you got the last added image first;)
That is what I do today:D
Reversing image order on gallery page:
This is within function image_gallery_page in the image_gallery.module. Just change where it says "ORDER BY n.sticky DESC, n.created DESC" to "ORDER BY n.sticky DESC, n.created ASC" and that should put the images in ascending order based on creation date.
You can change your gallery order just by using weights. It looks a little complicated to list those chronologically.
--Zivtech--
Thanks... for the image
Thanks... for the image ASC
You are correct. I can change the weigt but when I come to more then 20 sub-galleries (-10 to 10) it will not function anymore
So do someone have any idea?
This Works But Not Completely
I made the change from DESC to ASC and that changes the thumbnails on the page listing my photo albums to show the oldest thumbnails rather than the newest. That's progress. But alas, the photos are still in the wrong order (newest is still at the top). I'm going to try the ASC change in the images module. That has to work.
This Fixes the Image Order
It is in the Image Gallery module. Here is the change (DESC to ASC) that sets the photo order to oldest photo first. This is the modified code.
where n.created. DESC was changed to n.created.ASC. This changes the order from DESCENDING to ASCENDING.
Works for me.
I forgot to say thanks
Much thanks for the help on the image order issue.
This line fix the sub-gallery order
$galleries = taxonomy_get_tree(_image_gallery_get_vid(), $tid, -1, 1);$galleries=array_reverse($galleries);
This line fix the sub-gallery order in flash gallery module
..so it will probably fix the image gallery module
Many thanks to Lynn and InterceptPoint
Oops
That should have read n.create DESC was changed to n.created ASC.
Is it possible to do this in
Is it possible to do this in template.php so that the change is not overwritten with each upgrade? I tried to take the whole function, but got a "cannot redeclare" error.
Thanks,
Maria
arsort() function
Add arsort() in image_gallery_page() function on image_gallery.module file
--
IGUANA!