SA Facebook Integration

Started by SMFHacks.com Team, February 12, 2010, 01:36:11 PM

Previous topic - Next topic

samborabora

Okay, I'm getting somewhere. I just need to know what the check is if you are connected with facebook or not. Is it:

Logged in:empty($user_settings['fbname'])
Not logged in:!empty($user_settings['fbname'])

Or:

Logged in:empty($modSettings['fb_app_enabled'])
Not logged in:!empty($modSettings['fb_app_enabled'])

Or:

Logged in:$modSettings['fb_dfbreg2'] == 1
Not logged in:$modSettings['fb_dfbreg2'] == 0
Or even:
Not logged in:$modSettings['fb_dfbreg2'] == 2

I can't seem to find a way that works so I can display a hook ONLY if you are not connected/associated to facebook.

vbgamer45

This one below
Quote from: samborabora on August 13, 2014, 10:04:48 AM
Not Logged in:empty($user_settings['fbname'])
Logged in:!empty($user_settings['fbname'])



Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

samborabora

Quote from: vbgamer45 on August 13, 2014, 10:24:29 AM
This one below
Quote from: samborabora on August 13, 2014, 10:04:48 AM
Not Logged in:empty($user_settings['fbname'])
Logged in:!empty($user_settings['fbname'])



This should work, but it just isn't. I'm trying this:
  if(empty($user_settings['fbname']) ){
$buffer = preg_replace('~(' . preg_quote('<span name=facebookwhereabouts></span>') . ')~','<a href="'.$loginUrl.'"><span style="color: #c00;
text-decoration: underline;">login with facebook</span></a>', $buffer);
  }


And yet whether or not my account is associated or disassociated, it keeps displaying the message. I obviously only want it to offer the login option if the account is not associated with facebook (Ie: the same check that switches in and out the "associate account with facebook" to "settings" in the profile menu. It seems that just uses:
if(empty($user_settings['fbname']) && !empty($modSettings['fb_app_enabled']))
If the account is NOT associated and:
if(!empty($user_settings['fbname']) && !empty($modSettings['fb_app_enabled']))
if the account IS associated. So I can't see why this wouldn't work?

samborabora

Quote from: samborabora on August 13, 2014, 12:28:23 PM
Quote from: vbgamer45 on August 13, 2014, 10:24:29 AM
This one below
Quote from: samborabora on August 13, 2014, 10:04:48 AM
Not Logged in:empty($user_settings['fbname'])
Logged in:!empty($user_settings['fbname'])



This should work, but it just isn't. I'm trying this:
  if(empty($user_settings['fbname']) ){
$buffer = preg_replace('~(' . preg_quote('<span name=facebookwhereabouts></span>') . ')~','<a href="'.$loginUrl.'"><span style="color: #c00;
text-decoration: underline;">login with facebook</span></a>', $buffer);
  }


And yet whether or not my account is associated or disassociated, it keeps displaying the message. I obviously only want it to offer the login option if the account is not associated with facebook (Ie: the same check that switches in and out the "associate account with facebook" to "settings" in the profile menu. It seems that just uses:
if(empty($user_settings['fbname']) && !empty($modSettings['fb_app_enabled']))
If the account is NOT associated and:
if(!empty($user_settings['fbname']) && !empty($modSettings['fb_app_enabled']))
if the account IS associated. So I can't see why this wouldn't work?

Tried some more, I can't see why this function isn't working when hooked into display.template. There's no question that it changed dependent on association with facebook, because the exact same call works in the array that hooks into the menu taht switches between 'settings' and 'associate account with facebook'. The call should be available when hooked into display.template, shouldn't it?

backgoes

great mod but cant import fb avatar,  try manual but nothing happen... this great if auto import fb avatar too...

m62power

Hi all,

First off all i need to say that i am new on this forum. I read it for a while now and already have found allot answers to my questions for early problems i have with the setup for my forum (modifications)

But now i have a problem with the mod (SA Facebook integration)

I am running SMF 2.0.8
I have installed this package : SA Facebook Integration 2.0.4
I have done the setup by the info page in the forum
I have filled in the Facebook Application ID & Facebook Application Secret
I have enabled the function in my smf forum
I have set it public on facebook developers (app) page.


But now the problem is next: When somebody tried to sign up with facebook.
It goes to facebook, ask autorization, next it goes back to my smf forum and gives this error: no connection to facebook found

I have read already allot off topics but the answer is not given anywhere that i can see.
I have found someonene said there is a fix for this with a link. Only the link is dead!

He said this:

Quote from: SA™ on February 15, 2012, 02:15:15 PM
there is a fix fo that here

Dead link


But on the end this is unsolved.

Is there someone who can help me out with this ore maybe have the link to the fix for this issue?
Sorry but i am unable to post any links at the moment.   :(

Thanks in advance!

samborabora

Quote from: m62power on August 17, 2014, 03:46:34 PM
Hi all,

First off all i need to say that i am new on this forum. I read it for a while now and already have found allot answers to my questions for early problems i have with the setup for my forum (modifications)

But now i have a problem with the mod (SA Facebook integration)

I am running SMF 2.0.8
I have installed this package : SA Facebook Integration 2.0.4
I have done the setup by the info page in the forum
I have filled in the Facebook Application ID & Facebook Application Secret
I have enabled the function in my smf forum
I have set it public on facebook developers (app) page.


But now the problem is next: When somebody tried to sign up with facebook.
It goes to facebook, ask autorization, next it goes back to my smf forum and gives this error: no connection to facebook found

I have read already allot off topics but the answer is not given anywhere that i can see.
I have found someonene said there is a fix for this with a link. Only the link is dead!

He said this:

Quote from: SA™ on February 15, 2012, 02:15:15 PM
there is a fix fo that here

Dead link


But on the end this is unsolved.

Is there someone who can help me out with this ore maybe have the link to the fix for this issue?
Sorry but i am unable to post any links at the moment.   :(

Thanks in advance!

If you didn't register your app before April this year, it wont work, this mod only works with v1 apps registered at facebook currently.

m62power

Quote from: samborabora on August 17, 2014, 04:54:50 PM
Quote from: m62power on August 17, 2014, 03:46:34 PM
Hi all,

First off all i need to say that i am new on this forum. I read it for a while now and already have found allot answers to my questions for early problems i have with the setup for my forum (modifications)

But now i have a problem with the mod (SA Facebook integration)

I am running SMF 2.0.8
I have installed this package : SA Facebook Integration 2.0.4
I have done the setup by the info page in the forum
I have filled in the Facebook Application ID & Facebook Application Secret
I have enabled the function in my smf forum
I have set it public on facebook developers (app) page.


But now the problem is next: When somebody tried to sign up with facebook.
It goes to facebook, ask autorization, next it goes back to my smf forum and gives this error: no connection to facebook found

I have read already allot off topics but the answer is not given anywhere that i can see.
I have found someonene said there is a fix for this with a link. Only the link is dead!

He said this:

Quote from: SA™ on February 15, 2012, 02:15:15 PM
there is a fix fo that here

Dead link


But on the end this is unsolved.

Is there someone who can help me out with this ore maybe have the link to the fix for this issue?
Sorry but i am unable to post any links at the moment.   :(

Thanks in advance!

If you didn't register your app before April this year, it wont work, this mod only works with v1 apps registered at facebook currently.


Thank you very much for fast answer! Is there any possibility to fix it anyway? Or do you have an idea if this mod will be updated again soon?

samborabora

Quote from: m62power on August 17, 2014, 05:43:48 PM
Quote from: samborabora on August 17, 2014, 04:54:50 PM
Quote from: m62power on August 17, 2014, 03:46:34 PM
Hi all,

First off all i need to say that i am new on this forum. I read it for a while now and already have found allot answers to my questions for early problems i have with the setup for my forum (modifications)

But now i have a problem with the mod (SA Facebook integration)

I am running SMF 2.0.8
I have installed this package : SA Facebook Integration 2.0.4
I have done the setup by the info page in the forum
I have filled in the Facebook Application ID & Facebook Application Secret
I have enabled the function in my smf forum
I have set it public on facebook developers (app) page.


But now the problem is next: When somebody tried to sign up with facebook.
It goes to facebook, ask autorization, next it goes back to my smf forum and gives this error: no connection to facebook found

I have read already allot off topics but the answer is not given anywhere that i can see.
I have found someonene said there is a fix for this with a link. Only the link is dead!

He said this:

Quote from: SA™ on February 15, 2012, 02:15:15 PM
there is a fix fo that here

Dead link


But on the end this is unsolved.

Is there someone who can help me out with this ore maybe have the link to the fix for this issue?
Sorry but i am unable to post any links at the moment.   :(

Thanks in advance!

If you didn't register your app before April this year, it wont work, this mod only works with v1 apps registered at facebook currently.


Thank you very much for fast answer! Is there any possibility to fix it anyway? Or do you have an idea if this mod will be updated again soon?

No problem! I think the author is considering doing a paid update, if he gets the time, I know a lot of people have been requesting it to be compatible with v2 apps.

m62power

Quote from: samborabora on August 17, 2014, 05:50:38 PM
Quote from: m62power on August 17, 2014, 05:43:48 PM
Quote from: samborabora on August 17, 2014, 04:54:50 PM
Quote from: m62power on August 17, 2014, 03:46:34 PM
Hi all,

First off all i need to say that i am new on this forum. I read it for a while now and already have found allot answers to my questions for early problems i have with the setup for my forum (modifications)

But now i have a problem with the mod (SA Facebook integration)

I am running SMF 2.0.8
I have installed this package : SA Facebook Integration 2.0.4
I have done the setup by the info page in the forum
I have filled in the Facebook Application ID & Facebook Application Secret
I have enabled the function in my smf forum
I have set it public on facebook developers (app) page.


But now the problem is next: When somebody tried to sign up with facebook.
It goes to facebook, ask autorization, next it goes back to my smf forum and gives this error: no connection to facebook found

I have read already allot off topics but the answer is not given anywhere that i can see.
I have found someonene said there is a fix for this with a link. Only the link is dead!

He said this:

Quote from: SA™ on February 15, 2012, 02:15:15 PM
there is a fix fo that here

Dead link


But on the end this is unsolved.

Is there someone who can help me out with this ore maybe have the link to the fix for this issue?
Sorry but i am unable to post any links at the moment.   :(

Thanks in advance!

If you didn't register your app before April this year, it wont work, this mod only works with v1 apps registered at facebook currently.


Thank you very much for fast answer! Is there any possibility to fix it anyway? Or do you have an idea if this mod will be updated again soon?

No problem! I think the author is considering doing a paid update, if he gets the time, I know a lot of people have been requesting it to be compatible with v2 apps.


Okay, Thanks again for the information!

Can you answer my latest question as last.

1. Do  you know if the rest off the Facebook app is functional or not. I mean the like buttons etc.. in topics and messages.
2. There is another social app modification. "Social Login Version 3.1". Do you know if this is about the same mod and is still functional?

Thanks again!

samborabora

Quote from: m62power on August 17, 2014, 06:03:19 PM
Quote from: samborabora on August 17, 2014, 05:50:38 PM
Quote from: m62power on August 17, 2014, 05:43:48 PM
Quote from: samborabora on August 17, 2014, 04:54:50 PM
Quote from: m62power on August 17, 2014, 03:46:34 PM
Hi all,

First off all i need to say that i am new on this forum. I read it for a while now and already have found allot answers to my questions for early problems i have with the setup for my forum (modifications)

But now i have a problem with the mod (SA Facebook integration)

I am running SMF 2.0.8
I have installed this package : SA Facebook Integration 2.0.4
I have done the setup by the info page in the forum
I have filled in the Facebook Application ID & Facebook Application Secret
I have enabled the function in my smf forum
I have set it public on facebook developers (app) page.


But now the problem is next: When somebody tried to sign up with facebook.
It goes to facebook, ask autorization, next it goes back to my smf forum and gives this error: no connection to facebook found

I have read already allot off topics but the answer is not given anywhere that i can see.
I have found someonene said there is a fix for this with a link. Only the link is dead!

He said this:

Quote from: SA™ on February 15, 2012, 02:15:15 PM
there is a fix fo that here

Dead link


But on the end this is unsolved.

Is there someone who can help me out with this ore maybe have the link to the fix for this issue?
Sorry but i am unable to post any links at the moment.   :(

Thanks in advance!

If you didn't register your app before April this year, it wont work, this mod only works with v1 apps registered at facebook currently.


Thank you very much for fast answer! Is there any possibility to fix it anyway? Or do you have an idea if this mod will be updated again soon?

No problem! I think the author is considering doing a paid update, if he gets the time, I know a lot of people have been requesting it to be compatible with v2 apps.


Okay, Thanks again for the information!

Can you answer my latest question as last.

1. Do  you know if the rest off the Facebook app is functional or not. I mean the like buttons etc.. in topics and messages.
2. There is another social app modification. "Social Login Version 3.1". Do you know if this is about the same mod and is still functional?

Thanks again!

I'm not sure, I registered my app before v2 became available, so I'm not sure how much works on v2. I haven't used Social Login, but it appears that this may be the only facebook mod for smf at this time, although I may be wrong? :D

samborabora

So, just need to know how to call ($user_settings['fbname']) outside of the admin menus? If absolutely not, can I set a flag that can be checked in display.template when the user associates?

sYsguard

Hello, great plugin.

However, I find some errors that i cant be resolved yet with your help:

check: hxxp:goo.gl/9jEo7u [nonactive]

domain.com / /index.php?action=facebookintegrate;area=auto;agree#_=_
error message: You have not entered a valid email address

if i logged in (conventionally) and i syncronie with fb profile my account it is work fine (of course without fb avatar)

If you help me, of course I'll give you 3-1 years old apps. )i have more than 30 pieces)

pls help me any info, thank you

samborabora

I've globalized:

$modSettings, $fb_hook_object, $user_settings

Into display template. I just simply cannot find a combination that will check if the account is associated with facebook or not, nothing works! Ive tried:

if(!empty($user_settings['fbname']) && !empty($modSettings['fb_mode1']) && !empty($modSettings['fb_app_enabled'])){
and
if (($user_settings['fbname']) == 0){ including all numbers
and
if (!empty($user_settings['fbname'])){

and
if (empty($user_settings['fbname'])){

It's just crazy, it's working fine with:
if(empty($user_settings['fbname']) && !empty($modSettings['fb_app_enabled'])){
         self::facebook_array_insert($profile_areas, 'profile_action',
        array(
        'profile_fb' => array(
            'title' => $txt['fb_main5'],
            'areas' => array(
            'fsettings' => array(
            'label' => $txt['fb_sync1'],
            'custom_url' => $loginUrl.'" onclick="return confirm(\''.$txt['fb_sync2'].'\');"',
            'sc' => $sc,
            'permission' => array(
            'own' => 'profile_view_own',
            'any' => '',
                ),
            ),
            ),
            ),
        )
        );
        }


So, what's causing it not to recognize this in display.template, with everything globalized?!

samborabora


These are the actual members table columns. Notice how when an account has been deactivated from facebook, it appears as blank, but if it has never been associated with facebook before, it's init value is 0? Would this have any effect on how I should call this? As I said, I have every variable globalized in display.template, and those are the same variables globalized in the hooks file. Now, is there a different section of the hooks file I should be including these hooks in? Currently mine are in public static function ob_facebook(&$buffer) with all of the other facebook hooks of this sort, but I suppose they could go somewhere else. I don't know why though, since the login screen hooks and the hooks I have for accounts that aren't logged into SMF work fine and dandy.

Literally, anyone has any idea why it either shows my hook or it doesn't, regardless of whether or not the user is logged in or not?

Oh, I also usedprint_r($user_settings['fbname']); in display.template just to guarantee that the topic display template knows exactly which template to display. The problem is, I have to use hooks for this, cause just putting this stuff in display.template means that <a href="'.$loginUrl.'"> doesn't mean anything to the display.template, unless there's some way of having it understand what loginurl is without the hooks?

samborabora

Phew, done. With a nasty hack, but okay...

in Sources/Facebook/facebookhooks.php
$buffer = preg_replace('~(' . preg_quote('<span name="facebooknotloggedin"></span>') . ')~','<a href="'.$loginUrl.'"><span style="color: #c00;
text-decoration: underline;">login with facebook</span></a>', $buffer);
 
   $buffer = preg_replace('~(' . preg_quote('<span name="facebookloggedin"></span>') . ')~','IN', $buffer);


In display.template:
if (empty($user_settings['fbname']))
echo '<span name="facebooknotloggedin"></span>';

  if (!empty($user_settings['fbname']))
echo '<span name="facebookloggedin"></span>';


Andfunction template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings, $fb_hook_object, $user_settings, $loginUrl;


You just need $fb_hook_object, $user_settings and $loginUrl globalized.

hunger

I just installed this mod into a fresh SMF forum that uses  the "connect " them style.

After installation, my forum aint loading anymore. It just doesn load. any pages.

Anyway to uninstall this mod via ftp?

vbgamer45

Yeah you would need to follow the manual uninstall instructions on the mod's page reverse the install instructions for the mod
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

hunger

#3838
Is there any updated guided into how to sync this mod with the facebook app? cuz the OP guide talks about options and things that i just cant find in the current facebook page

im getting this error Exception: 12: REST API is deprecated for versions v2.1 and higher

ben sisko

I just reinstalled the mod after a big upgrade from SMF 2.0.2 to 2.0.8, but there is no link in the Admin CP for FB Integration.
I checked the installation. every new file/folder is in place, the modification to the files also made.
Also tried uninstall and reinstall, this time i had to made manually 2 file edits (installed other mods in between: PortaMX, AevaMedia, Menu Editor Lite, Downloads, Articles). still no success.

Any ideas?

Advertisement: