i have an error in subs.php, every time i install fbconnect the script would disable entire forum (blank page), it seems like a problem with below function, because when i remove it, the forum would be back to normal again :
function show_facebook(){
global $settings, $user_info, $context, $txt, $modSettings, $scripturl, $boarddir;
include_once $boarddir.'/fbc/facebook_init_main.php';
//user is logged in and maintenance mode is disabled
if ($context['user']['is_logged'] && empty($modSettings['fb_enable']))
{
if (!empty($user_info['fbname'])){
echo '<img src="' . $settings['images_url'] . '/facebook.png" alt="'.$txt['fb_title'].'" /> <a href="', $scripturl, '?action=facebook">'.$txt['fb_title'].'</a>';
}else{
echo '<img src="' . $settings['images_url'] . '/facebook.png" alt="'.$txt['fb_title'].'" /> <a href="', $scripturl, '?action=facebook;area=sync">'.$txt['fb_integrate'].'</a>';
}
echo'<br /><br />';
}
//user is logged maintenance is enabled and they have permission to manage facebook
elseif ($context['user']['is_logged'] && !empty($modSettings['fb_enable']) && allowedTo('manage_facebook')){
if (!empty($user_info['fbname'])){
echo '<img src="' . $settings['images_url'] . '/facebook.png" alt="'.$txt['fb_title'].'" /> <a href="', $scripturl, '?action=facebook">'.$txt['fb_title'].'</a>';
}else{
echo '<img src="' . $settings['images_url'] . '/facebook.png" alt="'.$txt['fb_title'].'" /> <a href="', $scripturl, '?action=facebook;area=sync">'.$txt['fb_integrate'].'</a>';
}
echo'<br /><br />';
}
//user isnt logged and maintenance mode is disabled
elseif (empty($context['user']['is_logged']) && empty($modSettings['fb_enable'])){
if(!empty($modSettings['requireAgreement'])){
echo' <fb:login-button v="2" size="large" autologoutlink="false" perms="email,user_birthday,status_update,publish_stream,user_photos,create_event" onlogin="window.location=\'', $scripturl, '?action=facebook;area=connect;agree\'">'.$txt['login'].'</fb:login-button>';
}else{
echo' <fb:login-button v="2" size="large" autologoutlink="false" perms="email,user_birthday,status_update,publish_stream,user_photos,create_event" onlogin="window.location=\'', $scripturl, '?action=facebook;area=connect;step\'">'.$txt['login'].'</fb:login-button>';
}
}
}
function show_facebook_like($extra,$extra1,$extra2){
global $scripturl, $modSettings, $sourcedir, $user_info, $context, $boarddir;
include_once $sourcedir.'/FB_Connect/FB_Connect.php';
db_select_member_settings('fb_show_likeb',$user_info['id']);
if(!empty($context['fb_show_likeb'])){
if (empty($modSettings['like_board_url'])){$url = ''.$scripturl.'';}else{$url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];}
include_once $boarddir.'/fbc/facebook_init_main.php';
if($modSettings['likeshow'] == $extra2){
echo $extra.'<iframe src="http://www.facebook.com/plugins/like.php?href='.$url.'&layout=', empty($modSettings['liketopiclayout']) ? 'standard' : 'button_count','
&show_faces=false&width=450&action=', empty($modSettings['liketopicverbb_board']) ? 'like' : 'recommend','&colorscheme=', empty($modSettings['liketopiccolour']) ? 'light' : 'dark','
&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>'.$extra1;
}
}
}