• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More
Support SmugMug Customization Automatic "Recent" Featured Gallery using Timeline

FAQtoid

Ever wanted to create an Avatar? Creating an Avatar!

Searching Dgrin with Google Searching with Google

Dgrin Challenges

Congratulations to the Winner of DSS #128 (Sunrise or Sunset), ShootingStar.

The next Dgrin Challenge DSS #129 (Silhouette Revisited ) is open for entries through May 27th, 2013 at 8:00pm PDT.

As always, we look forward to your participation but please do take a moment to read through the rules before posting your entry.

Past DSS Challenge Winners, DSS Challenge Rules, and other important DSS Challenge information is here.

Need some help with Accessories?

Tutorials

Ever find yourself wondering just how someone managed to create an image using different effects?

Here are three simple tutorials we hope will encourage you to try something new.

The Hot Seat

A lifelong interest in landscape photography has led Eyal Oren to make a study of his adopted hometown of Marblehead, MA. As you can see, his dedication is paying off!

Africa!

Dgrinners Harryb, Pathfinder, and others joined Andy Williams and Marc Muench on Safari in East Africa recently. Here are some awesome threads to check out!

 
Thread Tools Display Modes
Page 3  of  3
1 2 3
Old Nov-18-2007, 08:02 AM
#41
wyndham is offline wyndham
Big grins
Bump!
__________________
www.wyndhamhollis.com
Old Nov-18-2007, 08:26 AM
#42
Allen is offline Allen
"tweak 'til it squeaks"
Allen's Avatar
Quote:
Originally Posted by wyndham
I've been trying to get this code working since July (on and off) and posted two requests for help on this thread which have gone unanswered. I tried some of the things suggested by others (eg moving the <body OnLoad... > to the footer but never get any results - neither can I see any hint of a Recently Added section in the OP's site accessed via his link.

Sometimes I feel like I'm invisible here - what do I have to do to get some help, or at least a response? Please, please could someone who has made this feature work, even in the wrong date order give me a hint as to what may be going wrong. It's a particularly valuable facility to me since I'm adding stuff from archives across a growing number of galleries until I get caught up and there's no incentive for anyone to re-visit if they feel they have to trawl through stuff they've seen before just to see what's new. It really ought to be added as a simple switch option on the Control Panel.

http://wyndhamhollis.smugmug.com
I get this error in Firbug. Might look at your code again.

missing ) after argument list
smugLoad(); addRecentFeatured('Recently Added Photographs',30,http://wyndhamhol...

I see this in your html,

<body class="homepage bodyColor_Black" onload=" smugLoad(); addRecentFeatured('Recently Added Photographs',30,http://wyndhamhollis.smugmug.com/pho...0485928-Th.jpg);">

Probably should be like this.

<body class="homepage bodyColor_Black" onload=" smugLoad(); addRecentFeatured('Recently Added Photographs',30,'/photos/220485928-Th.jpg');">

Example from first post.
Code:
<body onload="addRecentFeatured('Recent Work', 60, '/photos/52382214-Ti-4.jpg');">

Last edited by Allen; Nov-19-2007 at 05:49 AM.
Old Nov-19-2007, 02:25 AM
#43
wyndham is offline wyndham
Big grins
Thanks for your reply. Could you clarify a few points for me please:

1) Missing ) after argument list. I assume the argument list is the code I cut from the original post and pasted into the Javascript box. Counting the () I get 48 of each so can't see that they're out of balance. If it was the code in the body tag section then it only had one set and they were both in place.

2) Where does the "smugload()" come from? You've said it appears in my html code but it didn't and I don't see it in the OP either.

3) Having failed to find the ) in the first point above I tried pasting your suggested code into the Body Tag including the change to the picture path but can see no change to my homepage.

Sorry to be such a pain, but my programming started and ended with BASIC and so I don't know what to look for in Java. By the mostly positive responses to the original post I assumed that this worked without too much hassle...
__________________
www.wyndhamhollis.com
Old Nov-19-2007, 05:46 AM
#44
Allen is offline Allen
"tweak 'til it squeaks"
Allen's Avatar
Quote:
Originally Posted by wyndham
Thanks for your reply. Could you clarify a few points for me please:

1) Missing ) after argument list. I assume the argument list is the code I cut from the original post and pasted into the Javascript box. Counting the () I get 48 of each so can't see that they're out of balance. If it was the code in the body tag section then it only had one set and they were both in place.

2) Where does the "smugload()" come from? You've said it appears in my html code but it didn't and I don't see it in the OP either.

3) Having failed to find the ) in the first point above I tried pasting your suggested code into the Body Tag including the change to the picture path but can see no change to my homepage.

Sorry to be such a pain, but my programming started and ended with BASIC and so I don't know what to look for in Java. By the mostly positive responses to the original post I assumed that this worked without too much hassle...
It's somewhere in your control panel customize section. I'm as raw on this
stuff as you and only reporting error and possible hint for fix.

I think it's jumping out before it gets to the last ) so not seeing it. Maybe because of the
missing '.

...30,'http...
Old Nov-19-2007, 07:47 AM
#45
wyndham is offline wyndham
Big grins
Thank You, Thank You, Thank You! It works at last and I'll worry about the way it displays etc. another time.

PS Thanks again! I hope this really useful feature has made it's way onto the wish list.
__________________
www.wyndhamhollis.com
Old Mar-06-2008, 07:38 AM
#46
Erick L is offline Erick L
Major grins
Quote:
Originally Posted by JoshFink
Did I miss it in here or was it never discovered. Can the newest pictures show up first?
Bump.

It would be nice to have a customization page for this gallery as well.
__________________
Erick - borealphoto.com
borealphoto.smugmug.com
Old Apr-16-2008, 02:44 PM
#47
Raina.Rae is offline Raina.Rae
Major grins
Raina.Rae's Avatar
Huh recent Gallary help
I'm new to smugmug, and this feature would be great, so people can find the new stuff quick. However I'm having trouble getting this to work, because I'm not sure how it is supposed to show up. Are the new gallaries supposed to show in the featured box, or in a seperate gallary titled recent gallaries. Could you be a little more discriptive as to how this is supposed to show up. Because everytime I try it doesn't appear anything has changed so I tkae the code out. I'm looking for a gallary to show up the says recent gallary am I wrong in looking for that.



Quote:
Originally Posted by devbobo
As soon as the Timeline function appeared on smugmug, I have been thinking about automatically creating a "Recent" featured gallery on the homepage.

Here's the code to do it..

Javascript code...
Code:
function addRecentFeatured(text, days, thumbUrl) {
  if (YD.hasClass(document.body, "homepage")) {
    divTags = YD.getElementsByClassName("boxBottom", "div", YD.get("featuredBox"));
 
    for (i=0; i<divTags.length; i++) {
      miniBox = document.createElement("div");
      miniBox.className = "miniBox";
 
      photoBox = document.createElement("div");
      photoBox.className = "photo";
      miniBox.appendChild(photoBox);
 
      photoLink = document.createElement("a");
      photoLink.setAttribute("href", "javascript:showRecent(" + days + ");");
      photoBox.appendChild(photoLink);
 
      photoImg = document.createElement("img");
      photoImg.setAttribute("border", "0");
      photoImg.setAttribute("alt", text);
      photoImg.setAttribute("title", text);
      photoImg.src = thumbUrl;
      photoImg.className = "imgBorder";
      photoLink.appendChild(photoImg);
 
      albumTitle = document.createElement("p");
      albumTitle.className = "albumTitle";
      miniBox.appendChild(albumTitle);
      albumLink = document.createElement("a");
      albumLink.className = "nav";
      albumLink.setAttribute("href", "javascript:showRecent(" + days + ");");
      albumTitle.appendChild(albumLink);
 
      albumLinkText = document.createTextNode(text);
      albumLink.appendChild(albumLinkText);
      spacerDiv = document.createElement("div");
      spacerDiv.className = "spacer";
      miniBox.appendChild(spacerDiv);
 
      divTags[i].insertBefore(miniBox, divTags[i].childNodes[1]);
 
      break;
    }
  }
}
 
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;
}
To run this function, add the following to the body tag code...

Code:
<body onload="addRecentFeatured(text, days, thumbUrl);">
where
- text = title to be displayed next to feature album
- days = number of days (since today) to include
- thumbUrl = url of the thumbnail image

eg.
Code:
<body onload="addRecentFeatured('Recent Work', 60, '/photos/52382214-Ti-4.jpg');">
You can check it out here

Cheers,

David
Old Apr-16-2008, 03:31 PM
#48
Erick L is offline Erick L
Major grins
Quote:
Originally Posted by Raina.Rae
Are the new gallaries supposed to show in the featured box, or in a seperate gallary titled recent gallaries. Could you be a little more discriptive as to how this is supposed to show up.
Mine shows up as first among the other galleries. For some odd reason, it shows second in IE. Exemple: http://www.borealphoto.com/galleries

One thing you might have missed is the code needed in the body tag:

<body onload="addRecentFeatured(text, days, thumbUrl);">

Replace...

1- "text" with the text you want under or beside the thumbnail. On my site, it says "Recent".
2- "days" with the number of days you want
3- "thumburl" with the the adress of a thumbnail on your site. That thumbnail will link to the recent gallery, like the thumbnails link to ther galleries. To find the thumb's adress, right-click on a thumbnail and click on "copy image adress" or "copy image url" (something similar, my browswer is in French).

You can also use a text link:

<a href="javascript:showRecent(30)">Recent work</a>

I still don't how to reverse the order though.The last image uploaded shows last instead of first.

And make sure you put a feature request in the support forum or via email so it becomes a standard feature instead of a hack.
__________________
Erick - borealphoto.com
borealphoto.smugmug.com
Old Jan-01-2009, 06:19 AM
#49
MJR is offline MJR
Beginner grinner
MJR's Avatar
Recently taken instead of uploaded?
Quote:
Originally Posted by javier.rinaldi
Well since I use a navbar for most of my stuff, and that's where I wanted a link to the 'Recent' gallery I took a look at the code and pretty much kept the date functions

Code:
//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
then I placed the following into the navbar html
Code:
<li><a href="javascript:showRecent(30)">Recent</a></li>
Works great since the recent gallery is just a /date/YYYY-MM-DD/YYYY-MM-DD string added to the url.

I hope you don't mind me reusing this part of the code. I figured someone might want to try the Navbar 'recent' gallery link.

Jav
http://rinaldi.smugmug.com
Hi Javier -

thanks for the great code.

Is there some way top change the date uploaded to smugmug to the date the photo was taken?

I just loaded a bunch a photos on and they all appear as recent...

thanks!
Matthijs
Old Feb-03-2009, 12:36 PM
#50
albumflip is offline albumflip
Big grins
I would like to see SmugMug develop a section for the homepage which shows recent photos as they have created the "featured" section. It seems obvious that you would want to show people your newest additions. I would also like to see this in some type of slideshow format or a image rotator. Is SmugMug currently working on a "recent photos" project?
__________________
my site: www.albumflip.com
Old Jun-05-2009, 07:36 AM
#51
etfg is offline etfg
Big grins
A Little Help Please
QUESTION!!!!!!!!!
I think I have it working, but it seems to only add new images,, I want it to show only the last 7 days.

What am i doing wrong.

also is there anyway to set up, last 50 uploads or something

thanks in advance.
ed

(if you have problems viewing my site, i have just added my new domain. so if it doesnt work try this change.thewasteproject.org)
__________________
:barbThanks in advance:barb
change.thewasteproject.org
Old Aug-26-2011, 08:12 PM
#52
southeasternphotography is offline southeasternphotography
Trouper
Recent Images code - Super!
[QUOTE=javier.rinaldi;248236]Well since I use a navbar for most of my stuff, and that's where I wanted a link to the 'Recent' gallery I took a look at the code and pretty much kept the date functions
.............../QUOTE]

Awesome! I implemented this and it worked SUPER the first time out! Thank you so much for what you do for us "pasters"!!!

Troup Nightingale
Southeastern Photography
http://www.southeasternphotography.com
Old Jun-02-2012, 10:44 AM
#53
austriker is offline austriker
Big grins
So I dont want to do this for the timeline (homepage slideshow thing) but rather for my gallery I have setup in my navbar for "recent uploads" which is a seperate gallery. Right I have it set to show the last few days of uploads (under smart gallery settings) but have to go back every few days to update..

I am a newb, but is there a way to customize just my gallery with the above instructions show it will show last 200 uploads, or uploads in the last 14 days ??? And what CSS should I use?? Thanks! Sorry if my question is dumb.
__________________
just starting out, been shooting for years but never made a website.. yay for smugmug.
My Smugmug

DG Forum Codes
Old Jun-05-2012, 02:23 PM
#54
Smug Eric is online now Smug Eric
Smug Hero
Smug Eric's Avatar
I'm not sure if that is that is something that can be done. Where it limits the photos that show in the gallery to only the most recent XX number of images. You can do it manually by hiding the images.
__________________
Eric
Support Hero and Customeister
http://www.smugmug.com/help
Page 3  of  3
1 2 3
Tell The World!  

Thread Tools
Display Modes

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump