View Single Post
  #5  
Old 06-28-2016, 08:58 AM
TheAdminMarket's Avatar
TheAdminMarket TheAdminMarket is offline
 
Join Date: Jun 2013
Location: Thessaloniki, Greece
Posts: 511
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To use vBulletin as a Facebook TAB application (does not works in normal FB profiles and also in Facebook groups), all you need is:

1.- To operate your site in SSL

2.- Your style must be fluid (100% width) or, if it's fixed, 810px width

3.- To add in the headinclude template
Code:
<style type="text/css">
	overflow:auto;
	overflow-x:hidden; 
</style>
4.- To add at the end of footer template (just above </body>):
Code:
<div id="fb-root"></div>
<script type="text/javascript" src="//connect.facebook.net/en_US/all.js"></script>
<script>
	FB.init({
		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">
	FB.Canvas.setSize();
	window.fbAsyncInit = function () {
		FB.Canvas.setAutoResize();			
	}
	FB.Canvas.scrollTo(0,0);
</script>
With the above modifications I was able to use vBulletin as Facebook tab application without any problem and without any plugin (even without the old vB FB app). Just keep in mind that you must have activated (and working) the Facebook connect in your site.

If your Facebook connect in your site does not works, still you can use vBulletin in FB, but in this case you must do some extra work by including and setting FB SDK. This can be done (as example only) by creating a php file with content:

Code:
	// Required Facebook PHP SDK v4.0.9 or later.
	// Include required files form Facebook SDK
	require_once( 'Facebook/HttpClients/FacebookHttpable.php' );
	require_once( 'Facebook/HttpClients/FacebookCurl.php' );
	require_once( 'Facebook/HttpClients/FacebookCurlHttpClient.php' );
	require_once( 'Facebook/Entities/AccessToken.php' );
	require_once( 'Facebook/Entities/SignedRequest.php' );
	require_once( 'Facebook/FacebookSession.php' );
	require_once( 'Facebook/FacebookRedirectLoginHelper.php' );
	require_once( 'Facebook/FacebookSignedRequestFromInputHelper.php' ); // added in v4.0.9
	require_once( 'Facebook/FacebookRequest.php' );
	require_once( 'Facebook/FacebookResponse.php' );
	require_once( 'Facebook/FacebookSDKException.php' );
	require_once( 'Facebook/FacebookRequestException.php' );
	require_once( 'Facebook/FacebookOtherException.php' );
	require_once( 'Facebook/FacebookAuthorizationException.php' );
	// these two classes required for canvas and tab apps
	require_once( 'Facebook/FacebookCanvasLoginHelper.php' );
	require_once( 'Facebook/FacebookPageTabHelper.php' );
	require_once( 'Facebook/GraphObject.php' );
	require_once( 'Facebook/GraphSessionInfo.php' );
	use Facebook\HttpClients\FacebookHttpable;
	use Facebook\HttpClients\FacebookCurl;
	use Facebook\HttpClients\FacebookCurlHttpClient;
	use Facebook\Entities\AccessToken;
	use Facebook\Entities\SignedRequest;
	use Facebook\FacebookSession;
	use Facebook\FacebookRedirectLoginHelper;
	use Facebook\FacebookSignedRequestFromInputHelper; // added in v4.0.9
	use Facebook\FacebookRequest;
	use Facebook\FacebookResponse;
	use Facebook\FacebookSDKException;
	use Facebook\FacebookRequestException;
	use Facebook\FacebookOtherException;
	use Facebook\FacebookAuthorizationException;
	use Facebook\GraphObject;
	use Facebook\GraphSessionInfo;
	// these two classes required for canvas and tab apps
	use Facebook\FacebookCanvasLoginHelper;
	use Facebook\FacebookPageTabHelper;	
	// Initialize Facebook Connection
	FacebookSession::setDefaultApplication( ''.APP_ID.'',''.APP_SECRET.'' );
	// init login helper
	$helper = new FacebookRedirectLoginHelper( ''.APP_TAB_LINK.'' );
	// init page tab helper
	$pageHelper = new FacebookPageTabHelper();
	// get session from the page
	$session = $pageHelper->getSession();
As I said the last code is just an example. Is not the complete code. But I don't think that you'll need it. The included with vB Facebook connect works fine and is easy to activate it. The only addition is that you need SSL connection.

Christos
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01171 seconds
  • Memory Usage 1,786KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete