Badge for recent photos?

dberthiadberthia Registered Users Posts: 117 Major grins
I posted this in a different section, then realized it probably belongs here:

Is there a simple way to create a badge/widget I can use on my web site to display just my latest <n> photos in a grid? This is a no-brainer in Flickr, but apparently the official SmugMug badge will only display images from a specific gallery. Am I missing something?

Comments

  • darryldarryl Registered Users Posts: 997 Major grins
    edited September 23, 2009
    Hi -- I believe if you generate a badge for a specific gallery, you can then edit the code so that it looks at the "Recent Photos" feed instead of that gallery's feed.

    You'll want to look for the string that looks like this:
    albums=http%3A%2F%2Fapi.smugmug.com%2Fhack%2Ffeed.mg%3FType%3Dgallery%26Data%3D5679527_Yh9nr%26format%3Drss200

    And replace it with this:
    albums=http%3A%2F%2Fapi.smugmug.com%2Fhack%2Ffeed.mg%3FType%3DnicknameRecent%26Data%3DYOURSMUGMUGNICKNAME%26format%3Drss200

    Where YOURSMUGMUGNICKNAME is the first part of your http://NICKNAME.smugmug.com website address.

    Ooh, it looks like the Dgrin forum software broke up my code above, so here's a cleaner link (all on one line):
    albums=http%3A%2F%2Fapi.smugmug.com%2Fhack%2Ffeed.mg%3FType%3DnicknameRecent%26Data%3D[b]YOURSMUGMUGNICKNAME[/b]%26format%3Drss200
    

    Yeap. Works. Here's my test: http://www.darryl.com/smugbadges.html

    (Of course those are all from the same gallery... Oh well.)

    --Darryl
  • dberthiadberthia Registered Users Posts: 117 Major grins
    edited September 24, 2009
    Thank you!
  • VesperVesper Registered Users Posts: 1 Beginner grinner
    edited November 4, 2009
    Customizer wizard fails to build the MostRecent badge
    I have the same question: how do I make the Most Recent badge?
    The code hack given above doesn't work for me :(
    Neither works the Customizer wizard. It provides the Most Recent option, but constantly fails to build the MostRecent badge. All other kinds of badges (Gallery, Popular) work perfectly.
  • dberthiadberthia Registered Users Posts: 117 Major grins
    edited November 5, 2009
    Here's the full markup code for my badge. Replace the 2 instances of "dberthia" with your user id, and set your preferences as desired:
    <object type="application/x-shockwave-flash" width="250" height="200" id="vv12x" data="http://cdn.smugmug.com/swfs/badge/flashbadge.swf?mode=box&amp;useLargeImages=true&amp;BadgeHost=cdn.smugmug.com&amp;gapImage=http%3A%2F%2Fphotos.smugmug.com%2Fimg%2Fbesocial%2Finvisible_filler.png&amp;displayMode=full&amp;width=200&amp;height=200&amp;gridSpacing=1&amp;gridRows=3&amp;gridColumns=4&amp;background=%23000000&amp;preloaderColor=%23FFFFFF&amp;preloaderGlow=%23FFFFFF&amp;gridDelay=2&amp;slideshowDelay=4&amp;order=norandom&amp;forceSize=&amp;autostart=true&amp;autorepeat=true&amp;aboutlink=&amp;sharelink=&amp;albums=http%3A%2F%2Fapi.smugmug.com%2Fhack%2Ffeed.mg%3FType%3DnicknameRecent%26Data%3Ddberthia%26format%3Drss200%26Sandboxed%3D1">
    <param name="movie" value="http://cdn.smugmug.com/swfs/badge/flashbadge.swf?mode=box&amp;useLargeImages=true&amp;BadgeHost=cdn.smugmug.com&amp;gapImage=http%3A%2F%2Fphotos.smugmug.com%2Fimg%2Fbesocial%2Finvisible_filler.png&amp;displayMode=full&amp;width=200&amp;height=200&amp;gridSpacing=1&amp;gridRows=3&amp;gridColumns=4&amp;background=%23000000&amp;preloaderColor=%23FFFFFF&amp;preloaderGlow=%23FFFFFF&amp;gridDelay=2&amp;slideshowDelay=4&amp;order=norandom&amp;forceSize=&amp;autostart=true&amp;autorepeat=true&amp;aboutlink=&amp;sharelink=&amp;albums=http%3A%2F%2Fapi.smugmug.com%2Fhack%2Ffeed.mg%3FType%3DnicknameRecent%26Data%3Ddberthia%26format%3Drss200%26Sandboxed%3D1"/>
    <param name="wmode" value="transparent"/>
    </object>
    
  • antistarantistar Registered Users Posts: 42 Big grins
    edited December 17, 2009
    I'd like to create a badge out of keywords galleries, is there a way to hack the code to do it?
  • frogcakefrogcake Registered Users Posts: 13 Big grins
    edited January 3, 2010
    antistar wrote:
    I'd like to create a badge out of keywords galleries, is there a way to hack the code to do it?

    Yep, you can do that. Just replace the albums feed url in the above example by darryl to a keyword feed. Here's an example of mine that grabs photos with the 'slideshow' keyword:
    http%3A%2F%2Fapi.smugmug.com%2Fhack%2Ffeed.mg%3FType%3Duserkeyword%26NickName%3Dfrogcake%26Data%3Dslideshow%26format%3Drss200%26Sandboxed%3D1
    

    You need to change the NickName and Data values to your NickName and keyword respectively.

    Here's darryl's example test page modified to use the keyword feed: http://www.sharedmemory.net/smugbadge.html

    Just view the source.

    In case that page ever goes away, here's the full source code:
    <html> 
    <head> 
    <title>SmugBadge Test</title> 
    <body> 
    <div style="background: #000000;-moz-border-radius:
    .6em;-webkit-border-radius: .6em;overflow:hidden;text-align:
    center;padding-top:13px;width:220px;height:220px;margin:0 auto;"> 
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    width="200" height="200" id="vv12x"> 
    <param name="movie"
    value="http://cdn.smugmug.com/swfs/badge/flashbadge.swf?autorepeat=true&gridRows=3&gridColumns=4&gridSpacing=1&gridDelay=2&autoHideDelay=4&slideshowDelay=4&autostart=true&aboutlink=&sharelink=&background=%23000000&forceSize=&displayMode=full&useLargeImages=true&albums=http%3A%2F%2Fapi.smugmug.com%2Fhack%2Ffeed.mg%3FType%3Duserkeyword%26NickName%3Dfrogcake%26Data%3Dslideshow%26format%3Drss200%26Sandboxed%3D1&gapImage=http%3A%2F%2Fphotos.smugmug.com%2Fimg%2Fbesocial%2Finvisible_filler.png&gapImageTarget=&preloaderGlow=%23FFFFFF&preloaderColor=%23FFFFFF&order=norandom&width=200&height=200&BadgeHost=cdn.smugmug.com"> 
    <param name="wmode" value="transparent"> 
    <embed 
    src="http://cdn.smugmug.com/swfs/badge/flashbadge.swf?autorepeat=true&gridRows=3&gridColumns=4&gridSpacing=1&gridDelay=2&autoHideDelay=4&slideshowDelay=4&autostart=true&aboutlink=&sharelink=&background=%23000000&forceSize=&displayMode=full&useLargeImages=true&albums=http%3A%2F%2Fapi.smugmug.com%2Fhack%2Ffeed.mg%3FType%3Duserkeyword%26NickName%3Dfrogcake%26Data%3Dslideshow%26format%3Drss200%26Sandboxed%3D1&gapImage=http%3A%2F%2Fphotos.smugmug.com%2Fimg%2Fbesocial%2Finvisible_filler.png&gapImageTarget=&preloaderGlow=%23FFFFFF&preloaderColor=%23FFFFFF&order=norandom&width=200&height=200&BadgeHost=cdn.smugmug.com"
    width="200" height="200"  wmode="transparent"> 
    </embed> 
    </object> 
    </div> 
    </body> 
    </html> 
    
    David
  • r9jacksonr9jackson Registered Users Posts: 129 Major grins
    edited January 11, 2010
    Looking at code
    Frogcake,
    I'm looking at your code and understand most of it, but I can't see where your keyword is. I was hoping to have the badge pull from one gallery all the photos with a single keyword like "web".
    I tried this and must be missing something or I missed a section that points it to my smug site.
  • frogcakefrogcake Registered Users Posts: 13 Big grins
    edited January 11, 2010
    r9jackson wrote:
    I'm looking at your code and understand most of it, but I can't see where your keyword is.

    You put the keyword in the bit after 'Data'. For example, if your SmugMug nickname is 'r9jackson' and your keyword is 'cactus' then your albums feed url will be this:
    http%3A%2F%2Fapi.smugmug.com%2Fhack%2Ffeed.mg%3FType%3Duserkeyword%26NickName%3Dr9jackson%26Data%3Dcactus%26format%3Drss200%26Sandboxed%3D1
    

    I don't think you can restrict it to a single gallery, though.
  • r9jacksonr9jackson Registered Users Posts: 129 Major grins
    edited January 11, 2010
    Badge with Keywords
    frogcake wrote:
    You put the keyword in the bit after 'Data'. For example, if your SmugMug nickname is 'r9jackson' and your keyword is 'cactus' then your albums feed url will be this:
    http%3A%2F%2Fapi.smugmug.com%2Fhack%2Ffeed.mg%3FType%3Duserkeyword%26NickName%3Dr9jackson%26Data%3Dcactus%26format%3Drss200%26Sandboxed%3D1
    
    I don't think you can restrict it to a single gallery, though.
    Thank you, Thank you, Thank you. IT WORKS !!
    I have just inserted the "Frogcake" Badge in my photography blog that I have written about Sedona, Arizona (it will post Wednesday morning). I made the keyword "sedonaweb" and placed it on 12 photos that I wanted to display. They can be in a single gallery, if that is the only place you use that keyword. This makes badging very powerful. Imagine, if you wanted to have a mini slide show to illustrate almost anything in any blog on the net, you can now do it. clap.gif

    Andy, you should note this and include it as a feature in all of SmugMug land.
  • r9jacksonr9jackson Registered Users Posts: 129 Major grins
    edited January 11, 2010
    Example posted in my blog
    r9jackson wrote:
    Thank you, Thank you, Thank you. IT WORKS !!
    I have just inserted the "Frogcake" Badge in my photography blog that I have written about Sedona, Arizona (it will post Wednesday morning). I made the keyword "sedonaweb" and placed it on 12 photos that I wanted to display. They can be in a single gallery, if that is the only place you use that keyword. This makes badging very powerful. Imagine, if you wanted to have a mini slide show to illustrate almost anything in any blog on the net, you can now do it. clap.gif

    Andy, you should note this and include it as a feature in all of SmugMug land.

    I posted my blog entry about Sedona as a Photographers Paradise a little early so that you can check it out. http://www.randyonphotography.com/2010/01/sedona-arizona-photographers-paradise.html
  • frogcakefrogcake Registered Users Posts: 13 Big grins
    edited January 11, 2010
    Looks great!
  • r9jacksonr9jackson Registered Users Posts: 129 Major grins
    edited January 19, 2010
    darryl wrote:
    Hi -- I believe if you generate a badge for a specific gallery, you can then edit the code so that it looks at the "Recent Photos" feed instead of that gallery's feed.

    You'll want to look for the string that looks like this:



    And replace it with this:



    Where YOURSMUGMUGNICKNAME is the first part of your http://NICKNAME.smugmug.com website address.

    Ooh, it looks like the Dgrin forum software broke up my code above, so here's a cleaner link (all on one line):
    albums=http%3A%2F%2Fapi.smugmug.com%2Fhack%2Ffeed.mg%3FType%3DnicknameRecent%26Data%3D[B]YOURSMUGMUGNICKNAME[/B]%26format%3Drss200
    
    Yeap. Works. Here's my test: http://www.darryl.com/smugbadges.html

    (Of course those are all from the same gallery... Oh well.)

    --Darryl
    Darryl, how do you place that "code" section in this posting and will that work on a web page?
  • r9jacksonr9jackson Registered Users Posts: 129 Major grins
    edited January 19, 2010
    r9jackson wrote:
    I posted my blog entry about Sedona as a Photographers Paradise a little early so that you can check it out. http://www.randyonphotography.com/2010/01/sedona-arizona-photographers-paradise.html
    Oops, I may have spoken too soon. This code does not work right in Internet Explorer 7. I will go back to the drawing board.
  • dounddound Registered Users Posts: 72 Big grins
    edited January 17, 2011
    Thanks for explaining how to change which feed SmugMug pulls from. For a complete list of feeds, check out SmugMug's feed list.
  • lercheberglercheberg Registered Users Posts: 16 Big grins
    edited February 2, 2011
    When I set a "site-wide viewing password" on the control panel, the badge in the Bio section on my homepage stops working. Is there anyway to provide the password in the badge so I can have both of these on at the same time?

    Website is www.lercheberg.com

    The code in my bio box currently is:

    <html>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="900" height="100"><param name="movie" value="http://cdn.smugmug.com/swfs/badge/flashbadge.swf?useLargeImages=true&nickName=Lercheberg&feedType=popularNickname&BadgeHost=cdn.smugmug.com&albumID=15568120&albumKey=LsUHn&width=900&height=100&gridSpacing=1&gridColumns=9&gridRows=1&background=%23000000&preloaderColor=&preloaderGlow=&gridDelay=1&slideshowDelay=1&order=random&forceSize=&showCaptions=false&introMode= dropdown &aboutlink=&sharelink=&albums=" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><embed src="http://cdn.smugmug.com/swfs/badge/flashbadge.swf?useLargeImages=true&nickName=Lercheberg&feedType=popularNickname&BadgeHost=cdn.smugmug.com&albumID=15568120&albumKey=LsUHn&width=900&height=100&gridSpacing=1&gridColumns=9&gridRows=1&background=%23000000&preloaderColor=&preloaderGlow=&gridDelay=1&slideshowDelay=1&order=random&forceSize=&showCaptions=false&introMode= dropdown &aboutlink=&sharelink=&albums=" width="900" height="100" wmode="transparent" allowScriptAccess="always" ></embed></object>
    </html>
  • darryldarryl Registered Users Posts: 997 Major grins
    edited February 2, 2011
    lercheberg wrote: »
    When I set a "site-wide viewing password" on the control panel, the badge in the Bio section on my homepage stops working. Is there anyway to provide the password in the badge so I can have both of these on at the same time?

    Website is www.lercheberg.com

    Hi Lerche: Hrm. I think that once people log into your site, the badge should start working. Yeah, working for me:

    http://darryl.smugmug.com/
    Password: test

    But if you're just trying to show Popular photos, maybe you should just consider adding that Homepage box:

    http://www.smugmug.com/help/homepage-boxes
  • darryldarryl Registered Users Posts: 997 Major grins
    edited February 2, 2011
    Ah, but you may be running into a Flash security issue if you've got your own domain name. SmugMug Heroes would know more about that.
  • lercheberglercheberg Registered Users Posts: 16 Big grins
    edited February 2, 2011
    Yeah, if they log in through the www.lerchberg.smugmug.com url then it works fine on the www.lercheberg.com url. But not if they only go to www.lercheberg.com.

    How do I loop in a hero?
Sign In or Register to comment.