Recent photos section

fliegermausfliegermaus Registered Users Posts: 15 Big grins
edited December 16, 2008 in SmugMug Support
Hi,

I would like to show the visitors of my site the most recent photos I added to the galleries.

Now, I know about the 'recent photos' feed but is there a simple way to show these recent photos as a gallery page?
.

Comments

  • denisegoldbergdenisegoldberg Administrators Posts: 14,409 moderator
    edited November 1, 2008
    Hi,

    I would like to show the visitors of my site the most recent photos I added to the galleries.

    Now, I know about the 'recent photos' feed but is there a simple way to show these recent photos as a gallery page?
    There's a javascript hack in this thread - http://www.dgrin.com/showthread.php?t=105824&highlight=recent+photos - that will allow you to show the photos from the last x days (where you can change the number of days when you call the function.

    If you want to see it at work, go to the Kaleidoscope page on my site, then click "photos from the last 15 days".

    Also - see this thread - http://www.dgrin.com/showthread.php?p=697258#post697258 - for code to create a find page, including a date box. You can see this working on my Find page.

    --- Denise
  • AllenAllen Registered Users Posts: 10,015 Major grins
    edited November 1, 2008
    Hi,

    I would like to show the visitors of my site the most recent photos I added to the galleries.

    Now, I know about the 'recent photos' feed but is there a simple way to show these recent photos as a gallery page?
    Have you tried Photo Timeline? Look in your control panel under the homepage tab.
    Al - Just a volunteer here having fun
    My Website index | My Blog
  • fliegermausfliegermaus Registered Users Posts: 15 Big grins
    edited November 2, 2008
    Thanks for the ideas.

    I thought of the timeline at first, but it displays the photos in reverse order. Also, if I haven't added any photos in the last x days, after this time the timeline displays nothing if it's fixed at eg. 15 days.

    I worked on a small hack earlier but I was a bit afraid of showing it off -- I didn't want to reinvent the wheel and then brag about it :-)

    Anyway, I created a small javascript function for parsing the recent photos feed and displaying the photos on my home page. Only a few recent photos are shown but it won't be a problem to show more of them if needed. You can look at my site (http://kotografia.pl) to see it working. The top row of photos are the most recent photos added.
    .
  • darryldarryl Registered Users Posts: 997 Major grins
    edited November 2, 2008
    Thanks for the ideas.

    I thought of the timeline at first, but it displays the photos in reverse order. Also, if I haven't added any photos in the last x days, after this time the timeline displays nothing if it's fixed at eg. 15 days.

    I worked on a small hack earlier but I was a bit afraid of showing it off -- I didn't want to reinvent the wheel and then brag about it :-)

    Anyway, I created a small javascript function for parsing the recent photos feed and displaying the photos on my home page. Only a few recent photos are shown but it won't be a problem to show more of them if needed. You can look at my site (http://kotografia.pl) to see it working. The top row of photos are the most recent photos added.

    Fliegermaus -- you did reinvent the wheel, but I think your wheel is much more efficient than mine: http://www.dgrin.com/showthread.php?t=100758

    I'm going to look at your code -- I'm sure it's better than what I've cobbled together. I did want to mention that I'm getting an error pop-up when I look at your page that says:
    The page at http://kotographia.pl says:

    doc=[objectElement]

    Ah, I see you're not actually dynamically populating your Recent Albums section (I guessed "Najnowsze" means recent), but rather have simply renamed the Featured Albums section. I have a hack to dynamically replace your Featured Albums with Recent Albums as pulled from the feed. Same concept as Recent Photos -- read the feed and then format it:

    http://www.dgrin.com/showthread.php?p=688574#post688574

    Running both Recent Photos and Recent Galleries hacks will probably be quite slow, as it'll have to load and parse two feeds. But I see you're using YAHOO.util.Datasource. I wonder if that's faster than whatever I copied from Dr. Dobbs. At least I won't have to have a lot of excess Javascript on my pages if there's already functions I can use from YAHOO.
  • fliegermausfliegermaus Registered Users Posts: 15 Big grins
    edited November 3, 2008
    darryl wrote:
    I'm going to look at your code -- I'm sure it's better than what I've cobbled together. I did want to mention that I'm getting an error pop-up when I look at your page that says:

    That was me ;) I was debugging the code on the live site using alerts instead of the logging package from Yahoo.
    darryl wrote:
    Ah, I see you're not actually dynamically populating your Recent Albums section (I guessed "Najnowsze" means recent), but rather have simply renamed the Featured Albums section. I have a hack to dynamically replace your Featured Albums with Recent Albums as pulled from the feed. Same concept as Recent Photos -- read the feed and then format it:

    http://www.dgrin.com/showthread.php?p=688574#post688574

    The first section "Najnowsze zdjecia" is populated dynamically from the RSS feed. The section below ("Najnowsze albumy") is renamed "Featured galleries".
    .
  • fliegermausfliegermaus Registered Users Posts: 15 Big grins
    edited November 4, 2008
    Ok, I think I found even better solution for showing the recently uploaded photos. I put together a script that displays the newest images in a standard SmugMug gallery layout. What it creates is a "virtual gallery" if you will.

    What the script does is trick SmugMug into thinking it's displaying a regular gallery, but instead replaces the "regular" gallery feed with the recent photos feed.

    You can see the script in action at my site. Click on any picture on the top row or on the "zobacz wiecej ostatnio dodanych zdjec" link just below the top row of photos. The gallery this link leads to is actually populated from the recent photos RSS feed.

    The script still needs improvement but I dare to say it's not bad for one day's worth of work ;)
    .
  • MikeksMikeks Registered Users Posts: 21 Big grins
    edited November 21, 2008
    This is exactly what i am looking for. i would love to see this implemented into smugmug without having to create your own code :D fliegermaus i was wondering if you would be willing to share the code ( i know it's not perfect yet ) so that maybe i could have have a recent gallery on my page as well.

    Mike
  • darryldarryl Registered Users Posts: 997 Major grins
    edited December 1, 2008
    Ok, I think I found even better solution for showing the recently uploaded photos. I put together a script that displays the newest images in a standard SmugMug gallery layout. What it creates is a "virtual gallery" if you will.

    What the script does is trick SmugMug into thinking it's displaying a regular gallery, but instead replaces the "regular" gallery feed with the recent photos feed.

    You can see the script in action at my site. Click on any picture on the top row or on the "zobacz wiecej ostatnio dodanych zdjec" link just below the top row of photos. The gallery this link leads to is actually populated from the recent photos RSS feed.

    The script still needs improvement but I dare to say it's not bad for one day's worth of work ;)

    I don't see any pictures at the top or the link you mention. Can we please see?
  • carolinecaroline Registered Users Posts: 1,302 Major grins
    edited December 16, 2008
    I would like to have a link in my biotext to 'recent photos' in the format that Denise has on her site here :-
    http://www.denisegoldberg.com/gallery/2659217

    I thought I had seen a recent post describing how to do this but can't find it now. Any help would be appreciated, thanks.

    Caroline
    Mendip Blog - Blog from The Fog, life on the Mendips
    www.carolineshipsey.co.uk - Follow me on G+

    [/URL]
  • denisegoldbergdenisegoldberg Administrators Posts: 14,409 moderator
    edited December 16, 2008
    caroline wrote:
    I would like to have a link in my biotext to 'recent photos' in the format that Denise has on her site here :- http://www.denisegoldberg.com/gallery/2659217

    I thought I had seen a recent post describing how to do this but can't find it now. Any help would be appreciated, thanks.
    Caroline -
    Do you mean the link on that page to "photos from the last 15 days"? That's the javascript hack that I mentioned in my earlier post on this thread. I'll add it here rather then sending you back to that page (which I think linked to another page...). I can't remember who originally supplied the hack. It wasn't me - I'm just a happy user.

    This goes in your bottom javascript box:
    //
    // most recent
    //
    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;
    }
    
    // end Most Recent
    
    Then, put this where you want to see the link to your recent photos - after changing the number in the function to the number of days you want to see, and after changing the text as desired:
    <a href="javascript:showRecent(15)">photos from the last 15 days</a>
    

    I assume that's what you were looking for, not my "recent galleries" which displays an html-only gallery. But if it's the recent galleries you wanted, I posted a snippet of the code for the html-only gallery at http://www.dgrin.com/showpost.php?p=987907&postcount=7.

    --- Denise
Sign In or Register to comment.