1
0
mirror of https://github.com/e107inc/e107.git synced 2025-02-16 04:24:42 +01:00
php-e107/e107_plugins/facebook/facebook_menu.php
2009-11-09 02:48:44 +00:00

122 lines
2.1 KiB
PHP

<?php
//error_reporting(E_ALL);
require_once (e_BASE.'class2.php');
include_once (e_PLUGIN.'facebook/facebook_function.php');
if ( isset ($_POST['fb_sig_in_canvas']))
{
return;
}
/**
* start the logic...
*
*/
global $pref;
if ( ( $pref[ 'Facebook_Api-Key' ] != '' ) && ( $pref[ 'Facebook_Secret-Key' ] != '' ) && ( $pref[ 'user_reg' ] == 1 ) )
{
if ( USER ) {
if ( USERID == get_id_from_uid ( is_fb() ) ) {
if ( Facebook_User_Is_Connected() === true ) {
$html .= Render_Facebook_Profile();
$html .= Render_Connect_Invite_Friends();
} else {
$html .= uid_check();
}
} else {
if ( is_fb() && uid_exists() && ( single_uid() == 1 ) ) {
Add_Facebook_Connect_User( '', USERID );
header ( 'Location:' . e_SELF ) ;
} else if ( is_fb() && ( USERID != get_id_from_uid ( is_fb() ) ) ) {
//return Facebook_LogOut();
$html .= uid_check();
}
}
if ( ( Get_Connection_Status() == '' ) && ( Facebook_User_Is_Connected() === true ) ) {
$html .= uid_check();
} else {
$html .= Render_Facebook_Connect_Button();
}
} else {
if ( is_fb() ) {
if ( Get_Connection_Status() == '' ) {
$html .= '<a href="#" onclick="facebook_onlogin_ready();">
<img id="fb_login_image" src="http://static.ak.fbcdn.net/images/fbconnect/login-buttons/connect_light_medium_long.gif" alt="Connect" />
</a>';
// Fb_Connect_Me();
} else if ( Get_Connection_Status() == 1 ) {
//not a real error! just some problem with Facebook ID
$html .= 'Ops... Some error Occur';
} else if ( Get_Connection_Status() == 0 ) {
$html .= Render_Fcuk_Facebook_Connect_Button();
}
}
$html .= Render_Facebook_Connect_Button();
}
}
$caption = 'facebook';
// $text = $tp->parseTemplate($html, true, $facebook_shortcodes);
$ns->tablerender($caption, $html);
?>