mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 06:38:00 +02:00
Fixes
This commit is contained in:
@@ -64,7 +64,7 @@ class facebook_main_ui extends e_admin_ui
|
||||
</p><p><b>Note:</b> Even if you have created an application and received an API key, you should review steps 1.4 through 1.7 and make sure your application settings are appropriate.
|
||||
</p>
|
||||
|
||||
<ol><li>1. Go to <a href="http://www.facebook.com/developers/createapp.php" class="external free" title="http://www.facebook.com/developers/createapp.php" rel="nofollow">http://www.facebook.com/developers/createapp.php</a> to create a new application.
|
||||
<ol><li>1. Go to <a rel="external" href="http://www.facebook.com/developers/createapp.php" class="external free" title="http://www.facebook.com/developers/createapp.php" rel="nofollow">http://www.facebook.com/developers/createapp.php</a> to create a new application.
|
||||
</li><li>2. Enter a name for your application in the <b>Application Name</b> field.
|
||||
</li><li>3. Accept the <a href="http://developers.facebook.com/terms.php" class="external text" title="http://developers.facebook.com/terms.php" rel="nofollow">Developer Terms of Service</a>, then click <b>Save Changes</b>.
|
||||
</li><li>4. On the <b>Basic</b> tab, keep all of the defaults.
|
||||
|
@@ -158,7 +158,7 @@ function facebook_client()
|
||||
{
|
||||
global $pref;
|
||||
|
||||
$pref = e107::getPlugConfig()->getPref();
|
||||
$pref = e107::getPlugConfig('facebook')->getPref();
|
||||
|
||||
static $facebook = null;
|
||||
|
||||
@@ -252,7 +252,7 @@ function Fb_Connect_Me()
|
||||
|
||||
global $sql;
|
||||
$sql4 = new db;
|
||||
if (!$sql4->db_select("user_extended", "*", "user_facebookID = '".is_fb()."' "))
|
||||
if (!$sql4->db_select("user_extended", "*", "user_plugin_facebook_ID = '".is_fb()."' "))
|
||||
{
|
||||
|
||||
$nickname = username_exists(Get_Facebook_Info('first_name'));
|
||||
@@ -263,7 +263,7 @@ function Fb_Connect_Me()
|
||||
|
||||
$sql2->db_Insert('user', array('user_name'=>$nickname, 'user_loginname'=>$username, 'user_password'=>$password, 'user_login'=>Get_Facebook_Info('name'), 'user_image'=>Get_Facebook_Info('pic')));
|
||||
$sql3 = new db;
|
||||
$sql3->db_Insert('user_extended', array('user_extended_id'=>last_user(), 'user_facebookID'=>is_fb()));
|
||||
$sql3->db_Insert('user_extended', array('user_extended_id'=>last_user(), 'user_plugin_facebook_ID'=>is_fb()));
|
||||
|
||||
Add_Facebook_Connect_User('', last_user());
|
||||
|
||||
@@ -278,11 +278,11 @@ function UEID()
|
||||
|
||||
global $sql;
|
||||
|
||||
$sql->db_Select("user_extended", "user_facebookID", "user_extended_id = '".USERID."' ");
|
||||
$sql->db_Select("user_extended", "user_plugin_facebook_ID", "user_extended_id = '".USERID."' ");
|
||||
|
||||
$row = $sql->db_Fetch();
|
||||
|
||||
return $row['user_facebookID'];
|
||||
return $row['user_plugin_facebook_ID'];
|
||||
|
||||
}
|
||||
/**
|
||||
@@ -321,7 +321,7 @@ function Fb_LogIn()
|
||||
Log_In_Registered_User();
|
||||
|
||||
}
|
||||
else if ($sql2->db_Select("user_extended", "*", "user_facebookID = '".is_fb()."' "))
|
||||
else if ($sql2->db_Select("user_extended", "*", "user_plugin_facebook_ID = '".is_fb()."' "))
|
||||
{
|
||||
$row2 = $sql2->db_Fetch();
|
||||
extract($row2);
|
||||
@@ -359,7 +359,7 @@ function Get_Connection_Status()
|
||||
$sql2 = new db;
|
||||
|
||||
if (($sql->db_Select("facebook", "*", "facebook_uid = '".is_fb()."' ")) ||
|
||||
($sql2->db_Select("user_extended", "*", "user_facebookID = '".is_fb()."' "))
|
||||
($sql2->db_Select("user_extended", "*", "user_plugin_facebook_ID = '".is_fb()."' "))
|
||||
)
|
||||
{
|
||||
$row = $sql->db_Fetch();
|
||||
@@ -382,7 +382,7 @@ function Facebook_User_Is_Connected()
|
||||
{
|
||||
global $sql;
|
||||
|
||||
if ($sql->db_select("user_extended", "*", "user_extended_id = '".get_id_from_uid(is_fb())."' AND user_facebookID = '".is_fb()."' "))
|
||||
if ($sql->db_select("user_extended", "*", "user_extended_id = '".get_id_from_uid(is_fb())."' AND user_plugin_facebook_ID = '".is_fb()."' "))
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -432,16 +432,16 @@ function Switch_Facebook_User()
|
||||
$sql3 = new db;
|
||||
$sql4 = new db;
|
||||
|
||||
if (!$sql1->db_Insert('user_extended', array('user_extended_id'=>USERID, 'user_facebookID'=>is_fb())))
|
||||
if (!$sql1->db_Insert('user_extended', array('user_extended_id'=>USERID, 'user_plugin_facebook_ID'=>is_fb())))
|
||||
{
|
||||
|
||||
$sql2->db_Update("user_extended", "user_facebookID = '".is_fb()."' WHERE user_extended_id = '".USERID."' ");
|
||||
$sql2->db_Update("user_extended", "user_plugin_facebook_ID = '".is_fb()."' WHERE user_extended_id = '".USERID."' ");
|
||||
|
||||
}
|
||||
|
||||
$id = get_id_from_uid(is_fb());
|
||||
|
||||
$sql3->db_Update("user_extended", "user_facebookID = '' WHERE user_extended_id = '".$id."' ");
|
||||
$sql3->db_Update("user_extended", "user_plugin_facebook_ID = '' WHERE user_extended_id = '".$id."' ");
|
||||
$sql4->db_Update("facebook", "facebook_user_id = '".USERID."' WHERE facebook_uid = '".is_fb()."' ");
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ function single_uid()
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
|
||||
$count = $sql->db_Count("user_extended", "(*)", "WHERE user_facebookID = '".is_fb()."'");
|
||||
$count = $sql->db_Count("user_extended", "(*)", "WHERE user_plugin_facebook_ID = '".is_fb()."'");
|
||||
return $count;
|
||||
}
|
||||
|
||||
@@ -469,7 +469,7 @@ function uid_check()
|
||||
|
||||
$msg = "";
|
||||
|
||||
if ($sql->db_select("user_extended", "*", "user_facebookID = '".is_fb()."' AND user_extended_id !='".USERID."'"))
|
||||
if ($sql->db_select("user_extended", "*", "user_plugin_facebook_ID = '".is_fb()."' AND user_extended_id !='".USERID."'"))
|
||||
{
|
||||
|
||||
// header ( 'Location: ' . e_SELF ) ;
|
||||
@@ -478,13 +478,13 @@ function uid_check()
|
||||
$msg .= "<div class='facebook_notice'><a href='".e_SELF."?facebook_delete' title='delete user'>would you like to delete this facebook account? press this link!</a></div>";
|
||||
|
||||
}
|
||||
else if ($sql->db_select("user_extended", "*", "user_facebookID != '".is_fb()."' "))
|
||||
else if ($sql->db_select("user_extended", "*", "user_plugin_facebook_ID != '".is_fb()."' "))
|
||||
{
|
||||
|
||||
$msg = "<div class='facebook_notice'> <a href='usersettings.php' title='click here'>The provided Facebook ID is wrong!</a> </div> <div class='fb_green'>".your_facebook_is()."</div>";
|
||||
|
||||
}
|
||||
else if ($sql->db_select("user_extended", "*", "user_facebookID = '' "))
|
||||
else if ($sql->db_select("user_extended", "*", "user_plugin_facebook_ID = '' "))
|
||||
{
|
||||
|
||||
$msg = "<div class='facebook_notice'><a href='usersettings.php' title='click here'>Specify your Facebook ID in the Profile Settings! </a></div><div class='fb_green'>".your_facebook_is()."</div>";
|
||||
@@ -506,7 +506,7 @@ function uid_exists()
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
|
||||
if ($sql->db_select("user_extended", "*", "user_extended_id = '".USERID."' AND user_facebookID = '".is_fb()."'"))
|
||||
if ($sql->db_select("user_extended", "*", "user_extended_id = '".USERID."' AND user_plugin_facebook_ID = '".is_fb()."'"))
|
||||
{
|
||||
$row = $sql->db_Fetch();
|
||||
return $row['user_extended_id'];
|
||||
@@ -558,7 +558,7 @@ function render_facebook_init_js($uid)
|
||||
{
|
||||
|
||||
$sql = e107::getDb();
|
||||
$pref = e107::getPlugConfig()->getPref();
|
||||
$pref = e107::getPlugConfig('facebook')->getPref();
|
||||
|
||||
$text .= '<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
@@ -682,7 +682,7 @@ function Render_Invite_Friends_Link()
|
||||
|
||||
function Render_Fun_Box($stream, $connections, $width)
|
||||
{
|
||||
$pref = e107::getPlugConfig()->getPref();
|
||||
$pref = e107::getPlugConfig('facebook')->getPref();
|
||||
return '<fb:fan profile_id="'.$pref['Facebook_App-Bundle'].'" stream="'.$stream.'" connections="'.$connections.'" width="'.$width.'"></fb:fan><div style="font-size:8px; padding-left:10px"><a href="'.e_PLUGIN.'facebook">e107fbconnect</a> on Facebook</div>';
|
||||
}
|
||||
|
||||
@@ -804,7 +804,8 @@ function username_exists($user)
|
||||
|
||||
function set_cookies($id, $pwd)
|
||||
{
|
||||
global $pref;
|
||||
$pref = e107::getConfig()->getPref();
|
||||
|
||||
$cockiename = $pref['cookie_name'] ? $pref['cookie_name'] : 'e107cookie';
|
||||
$cookieval = $id.".".$pwd;
|
||||
|
||||
|
@@ -1,118 +1,129 @@
|
||||
<?php
|
||||
//error_reporting(E_ALL);
|
||||
//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']))
|
||||
if (!defined('e107_INIT'))
|
||||
{
|
||||
return;
|
||||
exit;
|
||||
}
|
||||
|
||||
$fb_pref = e107::getPlugConfig('facebook')->getPref();
|
||||
|
||||
|
||||
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 (($fb_pref['Facebook_Api-Key'] != '') && ($fb_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();">
|
||||
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- $Id: plugin.xml,v 1.1 2009-11-09 02:48:44 e107coders Exp $ -->
|
||||
<!-- $Id: plugin.xml,v 1.2 2009-11-10 06:28:19 e107coders Exp $ -->
|
||||
|
||||
<e107Plugin name="facebook" version="0.3" compatibility="0.8" installRequired="true">
|
||||
<e107Plugin name="Facebook" version="0.3" compatibility="0.8" installRequired="true">
|
||||
<author name="Luca Filosofi" url="http://ask.altervista.org" email="aseptik@gmail.com" />
|
||||
<description>Facebook Connect for e107</description>
|
||||
<copyright>Copyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt)</copyright>
|
||||
@@ -16,6 +16,6 @@
|
||||
<pref name="Facebook_App-Bundle" active='false'></pref>
|
||||
</mainPrefs>
|
||||
<extendedFields>
|
||||
<field name="facebookID" type='EUF_INTEGER' default='0' active="true" />
|
||||
<field name="ID" type='EUF_INTEGER' default='0' active="true" />
|
||||
</extendedFields>
|
||||
</e107Plugin>
|
Reference in New Issue
Block a user