Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xml:lang="en-gb" lang="en-gb" slick-uniqueid="3">
- <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# video: http://ogp.me/ns/video#"><meta property="fb:app_id" content="my_app_id">
- <meta property="og:type" content="video.other" >
- <meta property="og:url" content="path_to_swf" >
- <meta property="og:image" content="path_to_image" >
- <div id='fb-root'></div>
- <script>
- var APP_ID='137867843030139';
- window.fbAsyncInit = initFacebook;
- function initFacebook()
- {
- FB.init({
- appId : APP_ID,
- status : true, // check login status
- cookie : false, // enable cookies to allow the server to access the session
- xfbml : true // parse XFBML
- });
- FB.getLoginStatus(onFacebookLoginStatus);
- };
- (function() {
- var e = document.createElement('script');
- e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
- e.async = true;
- document.getElementById('fb-root').appendChild(e);
- }());
- function facebookLogout()
- {
- FB.logout();
- var loginButtonDiv=document.getElementById("fb-login-button-div");
- loginButtonDiv.style.display="block";
- var logoutButtonDiv=document.getElementById("fb-logout-button-div");
- logoutButtonDiv.style.display="none";
- var contentDiv=document.getElementById("user-is-authenticated-div");
- contentDiv.style.display="none";
- }
- function facebookLogin()
- {
- var loginUrl='http://www.facebook.com/dialog/oauth/?'+
- 'scope=publish_stream,manage_pages&'+
- 'client_id='+APP_ID+'&'+
- 'redirect_uri='+document.location.href+'&'+
- 'response_type=token';
- window.location=loginUrl;
- }
- /*
- * Callback function for FB.login
- */
- function onFacebookLoginStatus(response)
- {
- if (response.status=='connected' && response.authResponse)
- {
- var loginButtonDiv=document.getElementById("fb-login-button-div");
- loginButtonDiv.style.display="none";
- var logoutButtonDiv=document.getElementById("fb-logout-button-div");
- logoutButtonDiv.style.display="none";
- var contentDiv=document.getElementById("user-is-authenticated-div");
- contentDiv.style.display="block";
- }
- else
- {
- var loginButtonDiv=document.getElementById("fb-login-button-div");
- loginButtonDiv.style.display="block";
- var contentDiv=document.getElementById("user-is-authenticated-div");
- contentDiv.style.display="none";
- }
- }
- function postToWallUsingFBUi()
- {
- var data=
- {
- method: 'feed',
- message: '',
- display: 'iframe',
- caption: '<? echo $this->album->artist_name; ?> Click to Listen',
- name: '<? echo $this->album->name; ?>',
- picture: 'http://fnoob.com/images/albums/<? echo $this->album->image; ?>',
- source: link_to_file',
- link: '<? echo $album_link ?>', // Go here if user click the picture
- description: 'By artist <? echo $this->album->artist_name; ?> on <? echo $this->album->format_name; ?> and powered by FNOOB.com ',
- actions: [{ name: 'fnoob.com', link: '<? echo $album_link ?>' }],
- }
- FB.ui(data, onPostToWallCompleted);
- }
- function onPostToWallCompleted(response)
- {
- if (response)
- {
- //console.log(response);
- if (response.error)
- {
- alert(response.error.message);
- }
- else
- {
- if (response.id)
- alert('Posted.... carry on!');
- else if (response.post_id)
- alert('Posted.... carry on!');
- else
- alert('Crap... something went wrong');
- }
- }
- // user cancelled
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement