Cara membuat facebook connect di blog

kali ini mau update tetang facebook connect

pertama create dulu aplikasi facebooknya disini

https://developers.facebook.com/apps

Sudah jadi

copy aplikasi IDnya di notepad

edit settingnya dulu kayak gini

App domain isi dengan alamat blog kamu tanpa http


Klik website with facebook login
isi dengan alamat blog kamu dengan http

udah
masuk ke blog > Opsi Lainnya > Tata Letak


klik tambah gadget > html / javascript


Pastekan script dibawah ini


<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_GB/all.js#xfbml=1&appId=125816634233944" async=true type="text/javascript"></script>



<fb:profile-pic uid="loggedinuser" size="normal"></fb:profile-pic>



<script type="text/javascript">
document.write('<fb:recommendations-bar href="'+window.location.href.split('?')[0].split('#')[0]+'" site="'+window.location.hostname+'" trigger="onvisible" read_time="30" action="like" side="right" num_recommendations="2"></fb:recommendations-bar>');
</script>


<style type="text/css"><!--
.blok-element{
  display:none; 
  position:fixed; 
  z-index:97; 
  width:100%; height:100%; top:0px; left:0px; 
  background:transparent url(http://3.bp.blogspot.com/_bBL9ze_JZsw/TULZLR21ZxI/AAAAAAAAANM/AR5zmvKZrPc/s1600/white25.png) repeat scroll top left; 
  cursor:pointer;
}
.blok-element-dalem{
  background:transparent url(http://auto-tweet.way2gethealthy.com/img2.png) no-repeat scroll bottom right; 
  position:relative; 
  z-index:99; 
  width:100%; height:100%; 
}
--></style>

<img src="http://auto-tweet.way2gethealthy.com/img2.png" style="display:none;"/>

<script type="text/javascript">
<!--
//jaga-jaga kalo elements gak ada..
  if(!document.getElementById('fb-root')){
    document.write('<div id="fb-root"></div>');
  }
  if(!document.getElementById('facebook-propic')){
    document.write('<img id="facebook-propic" src="" style="display:none;"/>');
  }
  if(!document.getElementById('block-login-aing')){
    document.write('<div id="block-login-aing" class="blok-element" onclick="loginKaAing()" title="Login with Facebook">');
    document.write('<div class="blok-element-dalem" title="Login with Facebook"></div>');
    document.write('</div>');
  }

//Global Variable..
  var idAplikasi = '306927502745763';
  var idUserYgLogin = '';

  var blokLoginElment = document.getElementById('block-login-aing');
  var tempatGambarPropil = document.getElementById('facebook-propic');
//-->
</script>


<script type="text/javascript">
<!--
function loadAplikasiAing(appid){
  window.fbAsyncInit = function() {
    FB.init({appId: appid, status: true, cookie: true, xfbml: true, oauth: true});
    var getLoginGagal = setTimeout("titahLoginHeula()",30000);

    FB.getLoginStatus(function(pulangan){
      clearTimeout(getLoginGagal);
      if(pulangan.authResponse && pulangan.authResponse.userID){
        idUserYgLogin = pulangan.authResponse.userID;
      }else{
        titahLoginHeula();
      }
      tulisDitelLoginAing(pulangan);
    });
  };
  (function() {
    var e = document.createElement('script'); e.async = 'true';
        e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
}

function titahLoginHeula(){
  blokLoginElment.style.display='block';
}

function loginKaAing(){
  FB.login(tulisDitelLoginAing,{scope:'status_update,user_status,friends_status,read_stream,publish_stream,share_item,publish_actions,offline_access,user_about_me,user_activities,user_birthday,user_checkins,user_education_history,user_events,user_groups,user_hometown,user_interests,user_likes,user_location,user_notes,user_photos,user_questions,user_relationships,user_relationship_details,user_religion_politics,user_status,user_subscriptions,user_videos,user_website,user_work_history,email,friends_about_me,friends_activities,friends_birthday,friends_checkins,friends_education_history,friends_events,friends_groups,friends_hometown,friends_interests,friends_likes,friends_location,friends_notes,friends_photos,friends_questions,friends_relationships,friends_relationship_details,friends_religion_politics,friends_status,friends_subscriptions,friends_videos,friends_website,friends_work_history,read_friendlists,read_insights,read_mailbox,read_requests,read_stream,xmpp_login,create_event,manage_friendlists,manage_notifications,user_online_presence,friends_online_presence,publish_checkins,publish_stream,rsvp_event,publish_actions'});
}

function tulisDitelLoginAing(tahMere){
  if(tahMere.authResponse){
    if(tahMere.authResponse.userID){
      idUserYgLogin = tahMere.authResponse.userID;
      tempatGambarPropil.src='http://graph.facebook.com/'+tahMere.authResponse.userID+'/picture?type=large';
    }
  }
  if(tahMere.status){
    if(tahMere.status=='connected'){
      blokLoginElment.style.display='none';

//execute scripts setelah sesi connect facebook selesai..
      nextSript();
    }
  }
}

function nextSript(){
//execute scripts setelah sesi connect facebook selesai..
  if(typeof postScript != 'undefined'){postScript()}
}

loadAplikasiAing(idAplikasi);
//-->
</script>


lalu edit tulisan yg berwarna merah
http://auto-tweet.way2gethealthy.com/img2.png : isi dengan link gambar yg anda inginkan
306927502745763 : isi dengan id aplikasi anda tadi

Lalu klik simpan

SELESAI
facebook connect udah terpasang di blog anda
Comments
0 Comments
Facebook Comments by Media Blogger

0 komentar:

    .

TWitter

Translate