• Resolved throwingmarbles

    (@throwingmarbles)


    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

    https://www.ads-software.com/extend/plugins/really-simple-twitter-feed-widget/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor whiletrue

    (@whiletrue)

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

    Thread Starter throwingmarbles

    (@throwingmarbles)

    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).

    Plugin Contributor whiletrue

    (@whiletrue)

    I’m totally with you ?? I’ll try to do it, stay tuned!

    Thread Starter throwingmarbles

    (@throwingmarbles)

    Thank you, sir! ??

    Thread Starter throwingmarbles

    (@throwingmarbles)

    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.

    Plugin Contributor whiletrue

    (@whiletrue)

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

    Thread Starter throwingmarbles

    (@throwingmarbles)

    Awesome, thank you so much for all your work!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Include thumbnail before tweets’ is closed to new replies.