ホーム > wordpress > twitter-tools

twitter-tools

2012 年 2 月 23 日 コメントをどうぞ コメント

wordpressプラグインのtwitter-tools  ついったーをブログ上に表示したりできるやつ。

で、自分のtweetを表示させているのだが、イマイチわかりづらいので、少し編集する。

 

編集内容は

・tweetごとに区切りを入れる。

・時間表示を改行する。

ちょっと見やすくしたいだけなので、とりあえずこんなもん。

 

編集するソースは『wp-content/plugins//twitter-tools.php』

tweetに区切りを入れるため下記部分を編集する(赤字

function aktt_sidebar_tweets($limit = null, $form = null) {
global $wpdb, $aktt;
if (!$limit) {
$limit = $aktt->sidebar_tweet_count;
}
if ($aktt->exclude_reply_tweets) {
$where = “AND tw_text NOT LIKE ‘@%’ “;
}
else {
$where = ”;
}
$tweets = $wpdb->get_results(”
SELECT *
FROM $wpdb->aktt
WHERE tw_text NOT LIKE ‘”.$wpdb->escape($aktt->tweet_prefix.’%’).”‘
$where
ORDER BY tw_created_at DESC
LIMIT $limit
“);
$output = ‘<div>’.”\n”
.’    <ul>’.”\n”;
if (count($tweets) > 0) {
foreach ($tweets as $tweet) {
$output .= ‘        <li>’.aktt_tweet_display($tweet).'<br />’.’———‘.'</li>’.”\n”;
}
}
else {
$output .= ‘        <li>’.__(‘No tweets available at the moment.’, ‘twitter-tools’).'</li>’.”\n”;
}
if (!empty($aktt->twitter_username)) {
$output .= ‘        <li>’.'<a href=”‘.aktt_profile_url($aktt->twitter_username).’”>’.__(‘More updates…’, ‘twitter-tools’).'</a>’.‘<br />’.’———‘.‘</li>’.”\n”;
}
$output .= ‘</ul>’;
if ($form !== false && $aktt->tweet_from_sidebar == ‘1’ && aktt_oauth_test()) {
$output .= aktt_tweet_form(‘input’, ‘onsubmit=”akttPostTweet(); return false;”‘);
$output .= ‘    <p id=”aktt_tweet_posted_msg”>’.__(‘Posting tweet…’, ‘twitter-tools’).'</p>’;
}
if ($aktt->give_tt_credit == ‘1’) {
$output .= ‘<p>’.__(‘Powered by <a href=”http://alexking.org/projects/”>Twitter Tools</a>’, ‘twitter-tools’).'</p>’;
}
$output .= ‘</div>’;
print($output);

htmlタグをシングルクォーテーションで括ってつなげればいいらしい。

エラーになったときは、シングルクォーテーションの不足か間にドットが無いとか・・・。

 

時間表示の前に改行を入れるため下記を編集(赤字)

function aktt_tweet_display($tweet, $time = ‘relative’) {
global $aktt;
$output = aktt_make_clickable(wp_specialchars($tweet->tw_text));
if (!empty($tweet->tw_reply_username)) {
$output .=     ‘ <a href=”‘.aktt_status_url($tweet->tw_reply_username, $tweet->tw_reply_tweet).’”>’.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 .= ‘<br /> <a href=”‘.aktt_status_url($aktt->twitter_username, $tweet->tw_id).’”>’.$time_display.'</a>’;
$output = apply_filters(‘aktt_tweet_display’, $output, $tweet); // allows you to alter the tweet display output
return $output;
}

これだけ。

ついでなんで、「ago」を消してみた

最下部のにある

function aktt_relativeTime

~長いので省略~

return sprintf(__(‘%s ago‘, ‘twitter-tools’), $relative_date);

以前に少しつついているので、元ソースは少し違うところがあるかも・・・・。

関連する記事

There have been promising signs, says Dr. Robert Stern, professor of neurology and neurosurgery at Boston University. He points to a brain imaging tool which identified the abnormal protein associated with CTE, described this year by researchers at the University of California Los Angeles. He is performing a wide range of medical tests on 150 former NFL players, as well as 50 athletes of the same age who play non contact sports, like swimmers. The goal is also to come up with a way of diagnosing CTE among the living.IPL is at the incubation stage and is intended for bodies corporate with very high net worth and sustaining capacity (in financial parlance). Mere break even in the strict financial sense for all IPL teams is plausible only after a couple of years. It is far Cheap NFL Jerseys fetched to compare IPL with English Football League (28 yrs, 20 teams, valuation $4 billion) or the NBA (60 yrs, 30 teams, valuation wholesale nfl jerseys $7 billion) or NFL (90 yrs, 32 teams, valuation $33 billion) with just a 3 year track record of a mere 10 teams.Dish Network offers three packages cheap football jerseys with considerably more value. The first being their Classic Bronze package with over 120 channels and priced regularly at $39.99, and in promotion for $24.99 for the first year. Next is the Classic Silver package with over 220 channels, priced regularly at $52.99 and, also in promotion for $37.99 for the first year. The most overwhelming value is the Classic Gold package with more than 260 channels wholesale football jerseys double the amount cheap nfl jerseys U verse would provide for just $13 more a month, regularly $62.99 yes you guessed it, also in promotion for $47.99 for the first year. AT U verse can provide a package with up to 230 channels, but pricing on this U 200 package starts at $64.00 per month.Football practice develops the skills and techniques needed for players to block and tackle, as well as carry and catch the ball. The drills a coach employs should http://cheapjerseysupply.com be designed to improve the individual performance and the team overall production during games. Training must include physical conditioning for hitting as well as drills for stamina and wind. Nevertheless, this remains a work in progress team, with head coach Gus Bradley certainly playing the long game. Sadly for the franchise, it looks as though the same may happen again this year should Jake Locker fail to stay healthy. Locker, a fourth year pro is one of the unlucky few to show signs of great potential, only to miss out on being able to show it because of injury. States and localities typically exempt jobs in law enforcement, child or nursing care, schools or other cheap football jerseys areas in which other laws require background checks for safety or security reasons. The same is true for jobs in the private sector that require background checks for licensing, such as drivers or day care workers.

関連する記事

カテゴリー: wordpress タグ: , ,
  1. コメントはまだありません。
  1. トラックバックはまだありません。