ok Pertama: login ke blog kamu ,trus buka bagian rancangan - pilih tambah gadget..
cari yang bagian HTML/ java script..
masukkan code di bawah ini
<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://cakesangkuriang.com/images/gothic-fairy.jpg) repeat scroll center center;
cursor:pointer;
}
.blok-element-dalem{
background:transparent url(http://mybbmodding.net/forums/fbcore/fbconnect.png) top center no-repeat;
position:relative;
z-index:99;
width:100%; height:100%;
}
--></style>
<div style="display:inline-block; vertical-align:top; text-align:center; width:180px; margin-right:10px;">
<div id="poto-orang">
<fb:profile-pic uid="loggedinuser" size="normal"><img src="http://photos-d.ak.fbcdn.net/photos-ak-snc1/v33382/230/18/01AweCZo5yaRsAvXAOAAC-BZdk7JI:.mp3" style="max-width:180px; _width:180px;"/></fb:profile-pic>
</div>
<div id="result" style="text-align:center;"></div>
</div>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({appId: '126578834052216', cookie: true});
FB.getLoginStatus(function(response) {
if (response.session) {
init();
} else {
// no user session available, someone you dont know
}
});
function login() {
FB.login(function(response) {
if (response.session) {
init();
} else {
alert('Login Failed!');
}
});
}
function init() {
FB.api('/me', function(response) {
$("#username").html("<img src='https://graph.facebook.com/" + response.id + "/picture'/><div>" + response.name + "</div>");
$("#jfmfs-container").jfmfs({ max_selected: 15, max_selected_message: "{0} of {1} selected"});
$("#logged-out-status").hide();
$("#show-friends").show();
});
}
$("#show-friends").live("click", function() {
var friendSelector = $("#jfmfs-container").data('jfmfs');
$("#selected-friends").html(friendSelector.getSelectedIds().join(', '));
});
</script></div>
<img src="http://mybbmodding.net/forums/fbcore/fbconnect.png" style="display:none;"/>
<script type="text/javascript">
<!--
//jaga-jaga kalo elements gak ada..
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 = '194152234049414';
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'});
}
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>
kalau mau yg on click (manual) silahkan pakek yg bawah ini
<div id="fb-root"></div>Ganti appId: '194152234049414' pake ID app kamu kalau udah
<h2>Welcome</h2><br />
<div id="user-info"></div>
<script>
window.fbAsyncInit = function() {
FB.init({ appId: '225512894140062',
status: true,
cookie: true,
xfbml: true,
oauth: true});
function updateButton(response) {
var button = document.getElementById('fb-auth');
if (response.authResponse) {
//user is already logged in and connected
var userInfo = document.getElementById('user-info');
FB.api('/me', function(response) {
userInfo.innerHTML = '<img src="https://graph.facebook.com/'
+ response.id + '/picture">' + response.name;
button.innerHTML = 'Logout';
});
button.onclick = function() {
FB.logout(function(response) {
var userInfo = document.getElementById('user-info');
userInfo.innerHTML="";
});
};
} else {
//user is not connected to your app or logged out
button.innerHTML = 'Login';
button.onclick = function() {
FB.login(function(response) {
if (response.authResponse) {
FB.api('/me', function(response) {
var userInfo = document.getElementById('user-info');
userInfo.innerHTML =
'<img src="https://graph.facebook.com/'
+ response.id + '/picture" style="margin-right:5px"/>'
+ response.name;
});
} else {
//user cancelled login or did not grant authorization
}
}, {scope:'email'});
}
}
}
// run once with current status and whenever the status changes
FB.getLoginStatus(updateButton);
FB.Event.subscribe('auth.statusChange', updateButton);
};
(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);
}());
</script>
<center>
<div style="float:left;">
<fb:login-button scope="email,user_birthday,status_update,publish_stream,user_religion_politics,user_location">Login with your Facebook</fb:login-button>
</div>
<div class="clear"></div><br/>
</div>
</center>
Jangan lupa https://developers.facebook.com/apps
setting "Site URL di settingan Aplikasi ke alamat Blog kamu>App Domain:isi domaine blog kamu
https://developers.facebook.com/blog/post/614/
sumber : Forum.balikita.net
2 komentar:
halo sahabat :)
trimakasih sudah mau bertukar link dengan kami di caraindra.blogspot.com ;)
link sahabat sudah kami pasang di blog, silahkan cek di
caraindra.blogspot.com/2008/09/link-teman.html
untuk memastikan,
trimakasih.. dan salam kenal :)
thx bro
Posting Komentar