Tuesday, April 1, 2014

How to add sharing functionality to website

<?php
$message='';
$url=urlencode($url);
?>
<div class="share-this">
<span><?php echo $this->__('Share this article on');?></span>
    <ul>
                    <li class="fb-share">
                    <a href="javascript:poptastic('https://www.facebook.com/sharer/sharer.php?u=<?php echo $url; ?>')" title="<?php echo $this->__('Share on Facebook'); ?>">Facebook</a>
                    </li>

<li class="twitter-share">
                    <a href="javascript:poptastic('http://twitter.com/intent/tweet?text=<?php echo $message; ?>&url=<?php echo $url; ?>');" title="<?php echo $this->__('Share With Twitter'); ?>">Tweet</a>
                    </li>
                 
<li class="zing-share">
<a href="javascript:poptastic('http://link.apps.zing.vn/share?u=<?php echo $url; ?>&t=&desc=&images=&media=&width=0&height=0')">Zing</a>
                   </li>
                 
<script>
function poptastic(url) {
      var newWindow = window.open(url, 'name', 'height=600,width=450,top=100,left=500');
      if (window.focus) {
        newWindow.focus();
      }
   
 }
</script>
                 
            </ul>
</div>

No comments:

Post a Comment