1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Class working. Add friend filter.

This commit is contained in:
CaMer0n
2009-11-11 16:00:44 +00:00
parent 9c75f4766f
commit d7a0825cab
4 changed files with 520 additions and 209 deletions

View File

@@ -2,6 +2,7 @@
//error_reporting(E_ALL); //error_reporting(E_ALL);
e107::getEvent()->register('logout',array('e_facebook','fb_logout'),e_PLUGIN.'facebook/facebook_function.php'); e107::getEvent()->register('logout',array('e_facebook','fb_logout'),e_PLUGIN.'facebook/facebook_function.php');
global $fb;
$fb = e107::getSingleton('e_facebook',e_PLUGIN.'facebook/facebook_function.php'); $fb = e107::getSingleton('e_facebook',e_PLUGIN.'facebook/facebook_function.php');
@@ -33,7 +34,7 @@ if (USER_AREA)
if (e_QUERY == 'login') // simple Re-Login after logged out from e107 if (e_QUERY == 'login') // simple Re-Login after logged out from e107
{ {
Fb_LogIn(); $fb->fb_login(); // Fb_LogIn();
} }
if (e_QUERY == 'logout') // simulate Facebook logOut when logged out from e107 if (e_QUERY == 'logout') // simulate Facebook logOut when logged out from e107
@@ -61,7 +62,7 @@ if (USER_AREA)
function theme_foot() function theme_foot()
{ {
global $fb;
/** /**
* the init js needs to be at the bottom of the document, within the </body> tag * the init js needs to be at the bottom of the document, within the </body> tag
* this is so that any xfbml elements are already rendered by the time the xfbml * this is so that any xfbml elements are already rendered by the time the xfbml
@@ -71,7 +72,7 @@ if (USER_AREA)
global $onload_js; global $onload_js;
$text .= render_facebook_init_js(is_fb()); $text .= render_facebook_init_js($fb->fb_uid);
// Print out all onload function calls // Print out all onload function calls
if ($onload_js) if ($onload_js)

File diff suppressed because it is too large Load Diff

View File

@@ -18,12 +18,14 @@ if (!defined('e107_INIT'))
include_once(e_PLUGIN.'facebook/facebook_function.php'); include_once(e_PLUGIN.'facebook/facebook_function.php');
global $fb;
if (isset($_POST['fb_sig_in_canvas'])) if (isset($_POST['fb_sig_in_canvas']))
{ {
return; return;
} }
if (is_fb()) if ($this->fb_uid)
{ {
$html = ''; $html = '';

View File

@@ -35,25 +35,26 @@ $fb_pref = e107::getPlugConfig('facebook')->getPref();
if (($fb_pref['Facebook_Api-Key'] != '') && ($fb_pref['Facebook_Secret-Key'] != '')) if (($fb_pref['Facebook_Api-Key'] != '') && ($fb_pref['Facebook_Secret-Key'] != ''))
{ {
$fb = e107::getSingleton('e_facebook',e_PLUGIN.'facebook/facebook_function.php');
$html = ''; $html = '';
if (USER) if (USER)
{ {
if (USERID == get_id_from_uid(is_fb())) if (USERID == $fb->e107_userid)
{ {
if (Facebook_User_Is_Connected() === true) if ($fb->isConnected() === true)
{ {
///$html .= Render_Facebook_Profile(); ///$html .= Render_Facebook_Profile();
//$caption = 'Welcome, ' . Get_Facebook_Info ( 'name' ); //$caption = 'Welcome, ' . Get_Facebook_Info ( 'name' );
$html .= Render_Facebook_Friends_Table(); $html .= $fb->Render_Facebook_Friends_Table();
$html .= Render_Connect_Invite_Friends(); $html .= $fb->Render_Connect_Invite_Friends();
$caption = 'Friends'; $caption = 'Friends';
// $text = $tp->parseTemplate($html, true, $facebook_shortcodes); // $text = $tp->parseTemplate($html, true, $facebook_shortcodes);