Forums

[resolved] [closed] What's the best way to post a flickr set inline? (6 posts)

  1. Mike
    Member
    Posted 8 months ago #

    Hi everyone,

    I'm putting together a personal photoblog-ish site based around WordPress just to put up photos from local venues along with album reviews, tutorials, etc etc. You know the deal.

    I'm looking for the best way to host 30-50 flickr photos and then display them inline on a post, like this: http://www.mikelesaski.com/blog/2011/08/01/savestheday_vintagevinyl/ (note this isn't live yet and is just a very early test haha)

    There are about a million flickr widgets and things for WordPress, but all of them make ugly galleries from your sets and require API keys etc. I don't want a lightbox, at least not for this. Personally, I don't like lightboxes just about anywhere on the web. They tend to be slow and messy. I'd consider it only if it's incredibly clean and quick, but really I'd rather viewers to just be able to scroll down and take a quick look. Inline, full post-width photos, with the ability to click and see the full size photo either on flickr or a lightbox.

    In my head right now I think I'd like to host each show separately in its own flickr set, so each photo can still be found there to drive extra traffic and comments. Then have a function/shortcode be usable in wordpress (something like [flickrset =3193048@094] or whatever) to pass a flickr set ID to some code, and return HTML for ahref/img tags for the whole set to be inlined in the post.

    I don't know toooo much PHP etc, but I'm fairly certain I could just dissect some code to make this happen if it comes down to it. I'm just seeing if you guys can come up with any simpler solutions first! I'd also love to hear if anyone has any ideas for different ways approach the entire thing. Thank you!

  2. Jackson
    Member
    Posted 8 months ago #

    You've posted this 3 times in 8 hours...

    The solution that comes to mind is grabbing a public Flickr RSS feed, parsing, extracting the images and displaying them however you please. This however involves custom PHP, and by the sounds of it may be over your head - no offense.

    Here's the PHP function you could use to load the RSS feed - http://php.net/manual/en/function.simplexml-load-file.php

    Otherwise you should look to the existing tools available, find one that works for you and if needed tweak to your needs.

  3. Mike
    Member
    Posted 8 months ago #

    Offense taken. That's pretty rude of you to say to someone you have no knowledge about. I'll figure it out, it's basic coding compared to any real programming. I just didn't want to have to learn PHP's syntax if I didn't have to and there was an easier solution out there that I wasn't seeing. Also, I posted it on two separate forums, didn't know that'd be such a huge issue. One was moving far quicker than the other. Next time you try and help someone, you can leave out the "may be over your head". So unnecessary bud.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    I just didn't want to have to learn PHP's syntax if I didn't have to

    You will have to at some point if you intend to continue using WordPress. So I suggest you start now. And posting the same question three times in rapid succession is also considered extremely rude.

  5. Jackson
    Member
    Posted 8 months ago #

    Offense taken.

    You're gonna need some thicker skin if you're looking in forums for free advice.

    That's pretty rude of you to say to someone you have no knowledge about.

    You stated in your original post that you "I don't know toooo much PHP etc" - which to me at least, means that writing your own function to parse and display a Flickr RSS feed is outside your wheelhouse.

    didn't want to have to learn PHP's syntax

    Then how are you going to dissect some code and just make this happen?

    Really I was trying to save you trouble, since what I have to offer isn't exactly what you want. But here you go, this will display thumbnails from a Flickr feed wrapped in links to the image on Flickr:

    <?php
    if ( false === ( $flickr_home_strip = get_transient( 'flickr_home_strip' ) ) ) {
    
        $feedURL = 'http://api.flickr.com/services/feeds/photos_public.gne?id=XXXX&lang=en-us&format=rss_200';
    
        $flickr_home = simplexml_load_file($feedURL);
    
        $count = 1;
        $out = '';
    
        foreach ($flickr_home->channel->item as $entry) {
          	$regx = "/\< *[img][^\>]*[src] *= *[\"\']{0,1}([^\"\'\ >]*)/i";
    	  	$matches = array();
    	  	preg_match( $regx, $entry->description, $matches );
          	$out.= '<div class="fl-item n'.$count.'"><span class="thumbnail"><a href="'.$entry->link.'" target="_blank"><img src="'.$matches[1].'" width="120" /></a></span></div>';
          	if($count == 5) break;
        	$count++;
        }
    
        set_transient( 'flickr_home_strip', $out, 60*60 );
    
    }
    echo($flickr_home_strip);
    ?>

    Also, I posted it on two separate forums, didn't know that'd be such a huge issue.

    It's not a huge issue, but it makes it look like you're bumping your topic and clutters up the forum with dupes. So unnecessary dude...

  6. Mike
    Member
    Posted 8 months ago #

    You guys are too much, haha. It's a message board... on the internet... C'mon now. Just silly. I really hope you guys are more friendly to people in the future, or at least in real life. This is embarrassing.

    Also, pro-tip for life: whenever someone says "no offense", it really just translates to "I'm going to be a dick but say no offense after so its okay". It's been that way since like... 1997? Don't bother responding, I won't be back to look at this, unless you guys want to have a nice friendly discussion amongst each other. In that case, have a ball! :) Take care!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags