Permalink
Browse files

Use Twitter web intents for user name links

  • Loading branch information...
1 parent 70bcbd8 commit 54779f0845e3c34c066cc60bfa84e8b61bba5d0b @ginatrapani ginatrapani committed Nov 3, 2011
@@ -8,11 +8,11 @@
<div class="individual-tweet post clearfix">
<div class="grid_1 alpha">
- <a href="http://twitter.com/{$l->container_post->author_username}">
+ <a href="https://twitter.com/intent/user?user_id={$l->container_post->author_user_id}">
<img src="{$l->container_post->author_avatar}" class="avatar"/><img src="{$site_root_path}plugins/{$l->container_post->network|get_plugin_path}/assets/img/favicon.ico" class="service-icon"/></a>
</div>
<div class="grid_3 right small">
- <a href="http://twitter.com/{$l->container_post->author_username}">{$l->container_post->author_username}</a>
+ <a href="https://twitter.com/intent/user?user_id={$l->container_post->author_user_id}">{$l->container_post->author_username}</a>
</div>
<div class="grid_13">
{if $l->image_src}
@@ -14,14 +14,14 @@ $unit (optional) If $show_distance='true', unit should be 'mi' or 'km' for miles
<div class="individual-tweet post clearfix{if $post->is_protected} private{/if}">
<div class="grid_2 alpha">
<div class="avatar-container">
- {if $post->network == 'twitter'} <a href="http://twitter.com/{$post->author_username}" title="{$post->author_username} on Twitter">{/if}
+ {if $post->network == 'twitter'} <a href="https://twitter.com/intent/user?user_id={$post->author_user_id}" title="{$post->author_username} on Twitter">{/if}
<img src="{$post->author_avatar}" class="avatar2"/><img src="{$site_root_path}plugins/{$post->network|get_plugin_path}/assets/img/favicon.ico" class="service-icon"/>
{if $post->network == 'twitter'}</a>{/if}
</div>
</div>
<div class="grid_3 small">
{if $post->network == 'twitter' && $username_link != 'internal'}
- <a href="http://twitter.com/{$post->author_username}" title="{$post->author_username} on Twitter">{$post->author_username}</a>
+ <a href="https://twitter.com/intent/user?user_id={$post->author_user_id}" title="{$post->author_username} on Twitter">{$post->author_username}</a>
{else}
{$post->author_username}
{/if}
@@ -33,9 +33,9 @@ $unit (optional) If $show_distance='true', unit should be 'mi' or 'km' for miles
{/if}
{if $post->network == 'twitter'}
{if $post->is_reply_by_friend or $post->is_retweet_by_friend}
- <a href="http://twitter.com/{$post->author_username}" title="Friend"><span class="sprite ui-icon-contact"></span></a>
+ <a href="https://twitter.com/intent/user?user_id={$post->author_user_id}" title="Friend"><span class="sprite ui-icon-contact"></span></a>
{else}
- <a href="http://twitter.com/{$post->author_username}" title="{$post->author_username} on Twitter"><span class="sprite ui-icon-person"></span></a>
+ <a href="https://twitter.com/intent/user?user_id={$post->author_user_id}" title="{$post->author_username} on Twitter"><span class="sprite ui-icon-person"></span></a>
{/if}
{/if}
</div>
@@ -27,7 +27,7 @@
<div class="grid_3 small">
{if $t->network == 'twitter' && $username_link != 'internal'}
<a {if $reply_count && $reply_count > $top_20_post_min}id="post_username-{$smarty.foreach.foo.iteration}" {/if}
- href="http://twitter.com/{$t->author_username}">{$t->author_username}</a>
+ href="https://twitter.com/intent/user?user_id={$t->author_user_id}">{$t->author_username}</a>
{else}
{$t->author_username}
{/if}
@@ -1,20 +1,20 @@
<div class="individual-tweet prepend_20 clearfix{if $t.is_protected} private{/if}">
<div class="grid_2 alpha">
<div class="avatar-container">
- {if $f.network == 'twitter'}<a href="http://twitter.com/{$f.user_name}" title="{$f.user_name} on Twitter">{/if}
+ {if $f.network == 'twitter'}<a href="https://twitter.com/intent/user?user_id={$f.user_id}" title="{$f.user_name} on Twitter">{/if}
<img src="{$f.avatar}" class="avatar"/><img src="{$site_root_path}plugins/{$f.network|get_plugin_path}/assets/img/favicon.ico" class="service-icon"/>
{if $f.network == 'twitter'}</a>{/if}
</div>
</div>
<div class="grid_4 small">
- {if $f.network == 'twitter'}<a href="http://twitter.com/{$f.user_name}" title="{$f.user_name} on Twitter">{/if}
+ {if $f.network == 'twitter'}<a href="https://twitter.com/intent/user?user_id={$f.user_id}" title="{$f.user_name} on Twitter">{/if}
{$f.user_name}
{if $f.network == 'twitter'}</a>{/if}
<div class="small gray">
{if $f.follower_count > 0 && $f.friend_count > 0}
{$f.follower_count|number_format} followers, {$f.friend_count|number_format} friends<br>
{/if}
- {if $f.network eq 'twitter'}<a href="http://twitter.com/{$f.user_name}" title="{$f.user_name} on Twitter"><span class="sprite ui-icon-person"></span></a>{/if}
+ {if $f.network eq 'twitter'}<a href="https://twitter.com/intent/user?user_id={$f.user_id}" title="{$f.user_name} on Twitter"><span class="sprite ui-icon-person"></span></a>{/if}
</div>
</div>
<div class="grid_12 omega">
@@ -66,7 +66,7 @@
<div class="grid_18 alpha omega">
{foreach from=$mutual_friends key=uid item=u name=foo}
<div class="avatar-container float-l mr_10 mb_10">
- <a href="http://twitter.com/{$u.user_name}" title="{$u.user_name}"><img src="{$u.avatar}" class="avatar2"/><img src="{$site_root_path}plugins/{$u.network}/assets/img/favicon.ico" class="service-icon2"/></a>
+ <a href="https://twitter.com/intent/user?user_id={$u.user_id}" title="{$u.user_name}"><img src="{$u.avatar}" class="avatar2"/><img src="{$site_root_path}plugins/{$u.network}/assets/img/favicon.ico" class="service-icon2"/></a>
</div>
{/foreach}
</div>
@@ -11,16 +11,9 @@
<div class="br" style="min-height:110px">
<div class="tweet pr">
{if $post->post_text}
- {if $post->network == 'twitter'}
- {$post->post_text|filter_xss|link_usernames_to_twitter}
- <a href="http://twitter.com/intent/tweet?in_reply_to={$post->post_id}"><span class="ui-icon ui-icon-arrowreturnthick-1-w" title="reply"></a>
- <a href="http://twitter.com/intent/retweet?tweet_id={$post->post_id}"><span class="ui-icon ui-icon-arrowreturnthick-1-e" title="retweet"></a>
- <a href="http://twitter.com/intent/favorite?tweet_id={$post->post_id}"><span class="ui-icon ui-icon-star" title="favorite"></a>
- {else}
{$post->post_text}
{if $post->is_protected}
<span class="sprite icon-locked"></span>
- {/if}
{/if}
{/if}
@@ -2,7 +2,7 @@
<h2>Chatterboxes</h2>
{foreach from=$chatterboxes key=tid item=u name=foo}
<div class="avatar-container" style="float:left;margin:7px;">
- <a href="http://twitter.com/{$u.user_name}" title="{$u.user_name}"><img src="{$u.avatar}" class="avatar2"/><img src="{$site_root_path}plugins/{$u.network}/assets/img/favicon.ico" class="service-icon2"/></a>
+ <a href="https://twitter.com/intent/user?user_id={$u.user_id}" title="{$u.user_name}"><img src="{$u.avatar}" class="avatar2"/><img src="{$site_root_path}plugins/{$u.network}/assets/img/favicon.ico" class="service-icon2"/></a>
</div>
{/foreach}
<div align="right" style="clear:all;padding-top:60px"><a href="index.php?v=friends-mostactive&u={$instance->network_username}&n=twitter">More...</a></div>
@@ -14,7 +14,7 @@
<h2>Deadbeats</h2>
{foreach from=$deadbeats key=tid item=u name=foo}
<div class="avatar-container" style="float:left;margin:7px;">
- <a href="http://twitter.com/{$u.user_name}" title="{$u.user_name}"><img src="{$u.avatar}" class="avatar2"/><img src="{$site_root_path}plugins/{$u.network}/assets/img/favicon.ico" class="service-icon2"/></a>
+ <a href="https://twitter.com/intent/user?user_id={$u.user_id}" title="{$u.user_name}"><img src="{$u.avatar}" class="avatar2"/><img src="{$site_root_path}plugins/{$u.network}/assets/img/favicon.ico" class="service-icon2"/></a>
</div>
{/foreach}
<div align="right" style="clear:all;padding-top:60px"><a href="index.php?v=friends-leastactive&u={$instance->network_username}&n=twitter">More...</a></div>
@@ -24,7 +24,7 @@
<h2>Popular</h2>
{foreach from=$popular key=tid item=u name=foo}
<div class="avatar-container" style="float:left;margin:7px;">
- <a href="http://twitter.com/{$u.user_name}" title="{$u.user_name}"><img src="{$u.avatar}" class="avatar2"/><img src="{$site_root_path}plugins/{$u.network}/assets/img/favicon.ico" class="service-icon2"/></a>
+ <a href="https://twitter.com/intent/user?user_id={$u.user_id}" title="{$u.user_name}"><img src="{$u.avatar}" class="avatar2"/><img src="{$site_root_path}plugins/{$u.network}/assets/img/favicon.ico" class="service-icon2"/></a>
</div>
{/foreach}
<div align="right" style="clear:all;padding-top:60px"><a href="index.php?v=friends-mostfollowed&u={$instance->network_username}&n=twitter">More...</a></div>

0 comments on commit 54779f0

Please sign in to comment.