WordPress.org

Ready to get started?Download WordPress

Forums

Twitter Tools
feature suggestions (1 post)

  1. paul3eb
    Member
    Posted 3 years ago #

    a quick addition that would help style things:

    add a div and class that wraps the main twitter text and reply. i've done this in the aktt_tweet_display() function. i'd use the filter but it doesn't give me control of the text and such so i can't display the individual parts separately.

    you can see what i mean here: http://rrgcc.org (under the "twitter notes"). the center text and "in reply to" is styled one way and the time display is styles another way.

    if there's a way to do it with the filter, i'd be happy to do that but i couldn't see a way to accomplish it.

    thanks.

    code is below:

    function aktt_tweet_display($tweet, $time = 'relative') {
    	global $aktt;
    
    	$middle = aktt_make_clickable(wp_specialchars($tweet->tw_text));
    	$output = '<div class="aktt_tweet_text">' . $middle;
    	if (!empty($tweet->tw_reply_username)) {
    		$output .= 	' <a href="'.aktt_status_url($tweet->tw_reply_username, $tweet->tw_reply_tweet).'" class="aktt_tweet_reply">'.sprintf(__('in reply to %s', 'twitter-tools'), $tweet->tw_reply_username).'</a>';
    	}
    	switch ($time) {
    		case 'relative':
    			$time_display = aktt_relativeTime($tweet->tw_created_at, 3);
    			break;
    		case 'absolute':
    			$time_display = '#';
    			break;
    	}
    	$output .= '</div>';
    	$output .= ' <a href="'.aktt_status_url($aktt->twitter_username, $tweet->tw_id).'" class="aktt_tweet_time">'.$time_display.'</a>';
    	$output = apply_filters('aktt_tweet_display', $output, $tweet); // allows you to alter the tweet display output
    	return $output;
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic