“Facebook’ta Paylaş” butonu oluşturmak

Kuşkusuz günümüzün en popüler sosyal ağ sitelerinden bir tanesi Facebook. Gerek reklam için, gerek haber için, gerekse yazılarınızı paylaşmak için biçilmiş kaftan diyebiliriz. Çünkü bu sayede yüzlerce kişiye (şanslıysanız binlerce) ulaşmanız çok kolay. Dolayısıyla herkes bir şekilde Facebook üzerinde varolmak istiyor. Artık hemen hemen her sitede “Facebook’ta paylaş” butonunu görmekteyiz. Peki bu nasıl yapılıyor? Şimdi bundan bahsedelim.

facebook’un ilgili döküman sayfası.

https://developers.facebook.com/docs/sharing/reference/share-dialog

Sadece yazı için;

<script>function fbs_click()
 {u=location.href;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 rel="nofollow" href="http://www.facebook.com/share.php?u=<;url>" onclick="return fbs_click()"
 target="_blank">Facebook'ta paylaş</a>

 

 

Küçük “F” logosu ve paylaş yazısı için;

<script>function fbs_click() 
{u=location.href;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>
<style> html .fb_share_link 
{ padding:2px 0 0 20px; height:16px; 
background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) 
no-repeat top left; }
</style><a rel="nofollow" href="http://www.facebook.com/share.php?u=<;url>" 
onclick="return fbs_click()" 
target="_blank" class="fb_share_link">Facebook'ta paylaş</a>

 

 

Sadece ikon için;

<script>function fbs_click() 
{u=location.href;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>
<style> html .fb_share_button { display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea;
 background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right; } html .fb_share_button:hover { color:#fff; border-color:#295582;
 background:#3b5998 url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right; text-decoration:none; }
 </style> <a rel="nofollow" href="http://www.facebook.com/share.php?u=<;url>" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Paylaş</a>

 

Kodlarını kullanıyorsun.
Not: Paylaşacağın linki kendisi otomatik alıyor ama sen belli bir linki, örneğin videonun linkini paylaşacaksan yada videonun açıldığı o sayfayı paylaşacaksan sadece;
<;url> diye değer belirtiyorsun veya <;url> yazan yerlere sayfanın adresini yazıyorsun.

Örnek : Facebookta Paylaş

 

Paylaştıkça Artan Tat...

Bir yorum ekleyin

E-posta hesabınız yayımlanmayacak.