WordPress.org

Ready to get started?Download WordPress

Forums

Really Simple Twitter Feed Widget
[resolved] Include thumbnail before tweets (8 posts)

  1. throwingmarbles
    Member
    Posted 1 year ago #

    Hi,
    Thank you for updating your plugin to the new API. I use it on two sites and it works like a charm!

    For one of the sites, I am trying to include a thumbnail in front of each tweet. I know your plugin currently doesn't provide this feature so I've tried to alter the code, without success.
    Is this a feature you are planning to implement, or is there some way I could do this myself, perhaps with some minor pointers? Help would be very much appreciated...

    Kindest regards,
    Marloes

    http://wordpress.org/extend/plugins/really-simple-twitter-feed-widget/

  2. whiletrue
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Marloes,
    do you mean a thumbnail of your Twitter profile, like in the Twitter homepage?

  3. throwingmarbles
    Member
    Posted 1 year ago #

    Wow, that's a quick reply. :-)

    Yes, I mean your Twitter profile image, in front of every tweet. Like the current standard Twitter widget does:

    https://twitter.com/settings/widgets/new

    (Except the iframe is so ugly and impossible to style with CSS, so I'd much rather use your plugin to accomplish the same).

  4. whiletrue
    Member
    Plugin Author

    Posted 1 year ago #

    I'm totally with you :) I'll try to do it, stay tuned!

  5. throwingmarbles
    Member
    Posted 1 year ago #

    Thank you, sir! :-)

  6. throwingmarbles
    Member
    Posted 1 year ago #

    In the meantime, I have added some code to replace the timestamp with "x secs/mins/hrs" up until 24 hrs. After that it turns into dates, just like on Twitter.

    Might come in handy for someone else. I'm not a php-pro, so I hope I didn't mess this up. :-)

    function time_elapsed_string($time) {
        $etime = time() - $time;
        if ($etime < 1) {
            return '0 secs';
        }
        $a = array( 60 * 60	=>  'hr',
                    60		=>  'min',
                    1		=>  'sec'
                  );
        if ($etime < 86400) {
    
    	    foreach ($a as $secs => $str) {
    	        $d = $etime / $secs;
    	        if ($d >= 1) {
    	            $r = round($d);
    	            return $r . ' ' . $str . ($r > 1 ? 's' : '');
    	        }
    	    }
    	}
    	else {
    		return date('M d', $time);
    	}
    }

    Then call function time_elapsed_string($time) in your template and use CSS to style it properly.

  7. whiletrue
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, the thumbnail is coming with 2.1 release out today; the timestamp is following in the next release!

  8. throwingmarbles
    Member
    Posted 1 year ago #

    Awesome, thank you so much for all your work!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic