Skip to content

Commit

Permalink
Merge branch 'IDI-116' into development
Browse files Browse the repository at this point in the history
Conflicts:
	style.css
  • Loading branch information
acheetham committed Jul 16, 2013
2 parents a224bbb + 2797b3b commit fae4c17
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 22 deletions.
7 changes: 3 additions & 4 deletions front-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,12 @@
<?php endwhile; ?>

<div class="fl-col">
<?php get_template_part('tweets', 'aegisprog') ?>
<?php get_template_part('tweets', 'SNOWocad') ?>

<?php idi_display_twitter_feed('aegisproj'); ?>
<?php idi_display_twitter_feed('SNOWocad'); ?>
</div>

<div class="fl-col">
<?php get_template_part('tweets', 'FluidProject') ?>
<?php idi_display_twitter_feed('FluidProject'); ?>

<div class="idi-box">
<div class="idi-mailing-list">
Expand Down
28 changes: 28 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,32 @@ function panel_login_fail( $username ) {
}
}

function idi_display_twitter_feed($twitter_un) {
require_once("wp-content/plugins/twitteroauth/twitteroauth/twitteroauth.php");
$num_tweets = 1;
$consumerkey = "luK78NyRjDEmMVhi6sgIw";
$consumersecret = "E6bY0ShFmtibIqWU0oHokCVZKYtPEvZcNyACBPzYqo";
$accesstoken = "123905660-DBVNC6meqlD4KgZrQcAuynwYaMxJsLqLiyrtkArR";
$accesstokensecret = "UhlTPgNowuNOsC0Oaw89PM29PcVRD4N14sAdkAUk";
$connection = new TwitterOAuth($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);
$tweets = array_filter($connection->get("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitter_un."&count=".$num_tweets));

echo '<div class="idi-box idi-highlight-box twitter-feed-group">
<div class="idi-box-text">
<a class="twitter-follow-button" rel="external nofollow" href="http://twitter.com/'.$twitter_un.'" title="Follow @'.$twitter_un.'">@'.$twitter_un.'</a>
<ul>
';
if(!empty($tweets)){
foreach($tweets as $tweet) {
echo '<li class="tweet">'.$tweet->text.
'<div class="tweet-date">'.substr($tweet->created_at, 0, 16).'</div></li>';
}
} else{
echo "<p>no tweets found</p>";
}
echo '</ul>
</div>
</div>';
}

?>
2 changes: 2 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,8 @@ h3,
list-style: none;
}
.twitter-feed-group .tweet-date {
margin-top: 0.5em;
color: #959595;
font-style: italic;
text-decoration: none;
}
Expand Down
6 changes: 0 additions & 6 deletions tweets-FluidProject.php

This file was deleted.

6 changes: 0 additions & 6 deletions tweets-SNOWocad.php

This file was deleted.

6 changes: 0 additions & 6 deletions tweets-aegisprog.php

This file was deleted.

0 comments on commit fae4c17

Please sign in to comment.