1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-18 05:09:05 +01:00

62 lines
1.2 KiB
PHP

<?php
if(USER_AREA)
{
e107::css('social', 'css/fontello.css');
e107::css('social' ,'css/social.css');
$social = e107::pref('core','social_login');
if(!empty($social) && is_array($social))
{
$appID = vartrue($social['Facebook']['keys']['id']);
}
$ogImage = e107::pref('social','og_image', false);
if(!empty($ogImage))
{
e107::meta('og:image',e107::getParser()->thumbUrl($ogImage,'w=500',false,true));
unset($ogImage);
}
if(!empty($appID))
{
e107::meta('fb:app_id', $appID);
$locale = strtolower(CORE_LC)."_".strtoupper(CORE_LC2);
$init = "
window.fbAsyncInit = function() {
FB.init({
appId : '".$appID."',
xfbml : true,
version : 'v2.3'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = '//connect.facebook.net/".$locale."/sdk.js';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
";
define('SOCIAL_FACEBOOK_INIT', $init);
}
else
{
define('SOCIAL_FACEBOOK_INIT', false);
}
}
?>