View Full Version : Show Recent in Right Order
duren
Jun-11-2008, 08:48 AM
Hi Andy and Team,
Could you please make it so that the showrecent java script routine will allow me to display images with most recent showing first? as it is, one month's worth of images for me is about 2000. I want my clients to be able to see my recent work. They have to scroll all the way to the end to see what I did yesterday. Capiche?
Andy
Jun-11-2008, 08:52 AM
Capiche?
I didn't write the hack that does that, I'm terribly sorry :( What hack did you install, I'll see if I can find the author for you.
duren
Jun-11-2008, 09:12 AM
//Goto Recent Gallery
function showRecent(days)
{
endDate = new Date();
oneDay = 1000*60*60*24;
startDate = new Date(endDate.getTime() - (parseInt(days) * oneDay));
sUrl = "/date/";
sUrl += startDate.getFullYear() + "-" + padDate(startDate.getMonth() + 1) + "-" + padDate(startDate.getDate());
sUrl += "/";
sUrl += endDate.getFullYear() + "-" + padDate(endDate.getMonth() + 1) + "-" + padDate(endDate.getDate());
window.location = sUrl;
}
function padDate(datePart)
{
if (datePart.toString().length != 1)
return datePart
return "0" + datePart;
}
//Goto Recent Gallery
DJKennedy
Jun-11-2008, 07:55 PM
Geeze...I asked 3-4 days ago about showing the newest first - and I put it in two different forums - no answers from the code gurus.
:huh
guess I wont ask anymore - ive been asking for ever about this.
DrDavid
Jun-12-2008, 08:36 AM
I set Duren up with that code a few days ago.. All the code does is create a URL based on a rolling 30 days. It uses the built in smugmug function to do it.
Basically, it creates this URL:
http://www.bobthecameraman.com/date/2008-06-02/2008-06-12
Problem is that if I try to reverse the dates like this:
http://www.bobthecameraman.com/date/2008-06-12/2008-06-02
It doesn't work.. Would it be possible to figure out which date was "bigger", then sort it the direction indicated? First URL would be oldest -> newest, 2nd URL would be newest -> oldest.
Thanks!
David
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.