Desk andrei ghioc email facebook

Importa pozele de pe facebook

Cum sa cream o aplicatie care it importa pozele de pe Facebook:

Insereaza in header:

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
FB.init({
appId  : '186633588026923',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml  : true  // parse XFBML
});
 
</script>
<script type="text/javascript">
window.getAlbums = function() {
  FB.api('/me/albums', function(resp) {
 
	var ulPC = document.getElementById('PicsFromFb');
	var iCNT = new Number(0);
	var iimgTXT = new String();
	ulPC.innerHTML = '';
    for (var i=0, l=resp.data.length; i<l; i++) {
		var album = resp.data[i];
		iCNT = 0;
 
		  FB.api('/'+album.id+'/photos', function(respPC) {
			for (var iPC=0, lPC=respPC.data.length; iPC<lPC; iPC++) {
				var pic = respPC.data[iPC];
 
				iimgTXT = '<div class="addFoto-galItem" >';
				iimgTXT += '<div class="addFoto-fotoHolder FbPicBox"> ';
				iimgTXT += '<center><img style="padding: 5px;" alt="" src="' + pic.images[pic.images.length - 1].source + '"  /></center>';
				iimgTXT += '</div></div>';
				iCNT += 1;
				if (iCNT >= 6) {
					iCNT = 0;
					iimgTXT += '<div class="clear" ><!-- --></div>';
				}
				ulPC.innerHTML += iimgTXT;
 
			}
 
		  });
 
    }
 
  });
};
 
</script>

Insereaza butonul:

<fb:login-button perms="user_photos,friends_photos,user_photo_video_tags,friends_photo_video_tags" onlogin="getAlbums()">
Importa pozele de pe Facebook
</fb:login-button>

Inseareaza si pozitia unde doresti sa fie listate pozele.

<div id="PicsFromFb" ></div>

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Bill Viola