Código:
<script type="text/javascript"> window.fbAsyncInit = function() { FB.init({appId: '<?=$settings['fbapp_id']?>', status: true, cookie: true, xfbml: true}); /* All the events registered */ FB.Event.subscribe('auth.login', function(response) { // do something with response login(); }); FB.Event.subscribe('auth.logout', function(response) { // do something with response logout(); }); FB.Canvas.setAutoResize(); }; (function() { var e = document.createElement('script'); e.type = 'text/javascript'; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }()); function streampub(name,url) { FB.ui( { method: 'stream.publish', message: 'Est\u00e1 escuchando:', attachment: { name: name, caption: 'BuscadorDeMusica.com.ar - Facebook', description: ( 'La mejor manera de escuchar musica ' + 'en facebook mediante , ' + 'BuscadorDeMusica.com.ar' ), href: '<?=FBAPPL_PATH?>', media: [{ 'type': 'flash', 'swfsrc': url, 'imgsrc': '<?=FBAPP_PATH?>webbanner.png', 'width': '100', 'height': '100', 'expanded_width': '400', 'expanded_height': '320' }] }, action_links: [ { text: 'BuscadorDeMusica.com.ar', href: '<?=MAIN_PATH?>' } ], user_message_prompt: 'Comparte' }, function(response) { if (response && response.post_id) { } else { } } ); } </script>