Skip to content

Commit

Permalink
twivatar
Browse files Browse the repository at this point in the history
  • Loading branch information
voitto committed Jul 31, 2009
1 parent b40cc76 commit 7f0f02b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion app/omb/plugins/wp.php
Expand Up @@ -1377,6 +1377,15 @@ function the_title() {
}
}

function profile_get_avatar(&$profile,$size='normal') {
global $db;
$TwitterUser =& $db->model('TwitterUser');
$tu = $TwitterUser->find_by('profile_id',$profile->id);
if ($tu && !empty($tu->screen_name))
return 'http://twivatar.org/'.$tu->screen_name.'/'.$size;
return $profile->avatar;
}

function get_avatar( $current_user_id, $pixels ) {
global $the_author,$request,$the_post;
$avatar = "";
Expand All @@ -1387,12 +1396,14 @@ function get_avatar( $current_user_id, $pixels ) {
if (!isset($the_post->id) || ($the_author->id == $p->id))
$avatar = $p->avatar;
}
if (!(environment('theme') == 'P2'))
if (!(is_microblog_theme()))
return '
<img alt=\'\' src=\''.$avatar.'\'
class=\'avatar avatar-48\' height=\'48\' width=\'48\' />
';
if (strpos($the_author->avatar, 'twitter_production') !== false)
$avatar = profile_get_avatar($the_author);
if (!(empty($avatar)))
return '<a href="'.$the_author->profile.'"><img alt="avatar" src="' . $avatar . '" style="width:'.$pixels.'px;height:'.$pixels.'px;" class="avatar" /></a>';
}
Expand Down
2 changes: 1 addition & 1 deletion app/omb/views/posts/_profile.html
Expand Up @@ -9,7 +9,7 @@

<div id="profile">

<h3 class="profile-h3"><img class="profile-img" src="<?php echo $profile->avatar; ?>" alt="<?php echo $profile->fullname; ?>" />
<h3 class="profile-h3"><img class="profile-img" src="<?php echo profile_get_avatar($profile,'bigger'); ?>" alt="<?php echo $profile->fullname; ?>" />
<?php echo $profile->nickname; ?>
</h3>
<br />
Expand Down

0 comments on commit 7f0f02b

Please sign in to comment.