Skip to content

Instantly share code, notes, and snippets.

@brettshumaker
Created July 4, 2012 17:56
Show Gist options
  • Save brettshumaker/3048594 to your computer and use it in GitHub Desktop.
Save brettshumaker/3048594 to your computer and use it in GitHub Desktop.
Facebook Share button for TubePress
<?php $the_url = 'http://www.youtube.com/watch?v='.$video->getId(); ?>
<div class="facebookShare">
<script type="text/javascript">
function fbs_click() {
u=<?php echo $the_url ?>;
t=document.title;
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}
</script>
<a href="http://www.facebook.com/share.php?u=<<url>" onclick="return fbs_click()" target="_blank"></a>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment