SA Facebook Integration

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

Previous topic - Next topic

Buraaq

Oh, so all I have to do is change the restrictions so that every member can access the boards right? But then, what would be the use of requiring registration if everyone is allowed to access all the boards. Thanks anyways though, I guess I will leave it as it is..

And manual edits, I thought about that too but I wasn't sure. sounds risky, given that my current version is working fine (after much efforts) and since the board is new and active, I wouldn't want to cause trouble for my new users. Might try it later, or will post on SA forums they might have a safer way about it..

Thanks a lot Spoogs. You have been great help  :)

Spoogs

The guest dont have to be allowed to post .. .just allow to view should do the trick.

You're quite welcome... and if its working for ya then no need to mess with it. Easiest way to deal with it tho.. is download the necessary file (make a back up of your forum) copy the file you downloaded (just to be safe) make the edits upload to your server... if everything is working you're done... if not you still have the copy you made of the original just re-upload and you'll be back to where you were (in most cases)

Hj Ahmad Rasyid Hj Ismail


Buraaq

Quoteand if its working for ya then no need to mess with it. Easiest way to deal with it tho.. is download the necessary file (make a back up of your forum) copy the file you downloaded (just to be safe) make the edits upload to your server... if everything is working you're done... if not you still have the copy you made of the original just re-upload and you'll be back to where you were (in most cases)

Yup I usually do that, unless I am pretty much sure what I am doing. I guess I will give it a try in a day or two; you never know SA might introduce a new revision by then =p

And the guest thing is indeed the case, thanks a lot! Worked well. I just allowed guests in the boards settings, but I will set the permissions for Guests so they can only view it. Perfect. Thanks a bunch mate!  ;)


neliojesus

already installed the mod, I can login as an account associate from forum to facebook but I can not make records, can you help me?

Buraaq

QuoteI can login as an account associate from forum to facebook but I can not make records, can you help me?

Can you please elaborate a little on the above? I might be able to assist you if I can have a better picture of the problem you are facing.

neliojesus

the only problem is when trying to make a new account Across the facebook. When it appears that the text of the Privacy Policy or what it is, I click the button to proceguiu and it does refresh the page.

Besides all the features are working properly

Oldiesmann

Quote from: Sleepy Arcade on September 21, 2010, 12:16:48 PM
@ im looking into this

@ RAULVK confirmed as a bug

if you move it from where it is and put ifbefore this

}

if (isset($settings['use_default_images']) && $settings['use_default_images'] == 'defaults' && isset($settings['default_template']))


Sticking it there will put it inside a foreach loop, causing it to be echoed out once for every template layer that's defined. A better option would be to modify and move it a bit...

Find the global variables list inside setupThemeContext() (one function above the one where the code is currently placed) and add $boardurl to that list.

Then...

Find:
    // Set some specific vars.

And add this before it:
    $like_layout = empty($modSettings['liketopiclayout']) ? 'standard' : 'button_count';
    $like_verb = empty($modSettings['liketopicverb']) ? 'like' : 'recommend';
    $like_colour = empty($modSettings['liketopiccolour']) ? 'light' : 'dark';   

    $context['html_headers'] .= '
    <script src="'.$boardurl.'/fbc/fbconnect.js" type="text/javascript"></script>
    <script type="text/javascript">
        var mod_settings_fb_app_pageid = "'.$modSettings['fb_app_pageid'].'";   
        var mod_settings_fb_app_stream = "'.$modSettings['fb_app_stream'].'";
        var mod_settings_fb_app_connection = "'.$modSettings['fb_app_connection'].'";
        var mod_settings_fb_app_width = "'.$modSettings['fb_app_width'].'";
        var mod_settings_fb_com_xid = "'.$modSettings['fb_app_comments_boxid'].'";
        var mod_settings_fb_li_xid = "'.$modSettings['fb_app_stream_boxid'].'";
        var mod_settings_fb_com_show = "'.$modSettings['fb_admin_commets_post'].'";
        var forum_name = "'.$context['forum_name'].'";
        var site_slogan = "'.$settings['site_slogan'].'";
        var like_layout = "'. $like_layout. '";
        var like_verb = "'. $like_verb. '";
        var like_colour = "'. $like_colour. '";
        var live_hight = "'.$modSettings['fb_app_stream_hight'].'";
        var live_width = "'.$modSettings['fb_app_stream_width'].'";
        var fp_width = "'.$modSettings['fb_app_fp_width'].'";
        var fp_row = "'.$modSettings['fb_app_e_fp_row'].'";
        var rec_width = "'.$modSettings['fb_app_rec_width'].'";
        var rec_hight = "'.$modSettings['fb_app_rec_hight'].'";
    </script>';


Some notes:
Using $context['html_headers'] will ensure it gets echoed out in the <head> section for every theme.
Defining the "like" settings separately is done because the inline conditionals cause it to output "light" or "dark" after a </script> tag otherwise (though I'm not quite sure why).
Commas can't be used to concatenate strings, so you have to change those to periods instead.

Hope that helps. It worked for me :)
Michael Eshom
Christian Metal Fans

SA™

aha thanks Oldiesmann i only relised after further testing myself i will corect this in next revision
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Hj Ahmad Rasyid Hj Ismail


Buraaq

Hello again!

I have run into another problem, and this one is a major security risk!!

Here is the thing

My SA FC was working fine, but then I noticed that the IDs associated with my members were all jumbled up. Like there were total 18 members, and the last member who had joined us had an ID of 43 or something. So I wanted to fix it. I accessed my database, went to smf_members and changed the IDs there.

However, it seems that SA FC had associated FB profiles in relation to IDs, so now wrong FB profiles are associated with the wrong people!!

For example, this person abc had facebook profile http://www.facebook.com/abc and this other person xyz had profile http://www.facebook.com/xyz.
Lets say changing the IDs led to ABC's ID getting associated to XYZ. so now, if I visit XYZ's profile, his facebook profile link reads http://www.facebook.com/abc when it should be reading /xyz!!

This issue is because of IDs is my best guess, because before changing the IDs everything was fine.

How do I fix it, I have no clue. I have disabled the MOD for the meantime. I need to get this sorted out soon though. Any help please?? :'(

SA™

you can chnage the id's in the themes db table just like you did with the members

one question tho have you deleted any memebers cos it is usal for the id's to go out of whak i happens when you delete members it is not a bug :)

also it is very wise to always back up before editing things exspecily your db
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Buraaq

Quoteyou can chnage the id's in the themes db table just like you did with the members

Well I would, but I wouldn't remember which ID to assign in order to get SA FB profiles to match with their forum users. Yes I deleted many members; I was trying to change the email templates so was testing them by registering myself every now and then and then rejecting myself, approving and so on  :D

I am stuck =(



Spoogs

1. Disassociate your FB account from your forum account
2. Go to http://www.facebook.com/editapps.php?ref=mb and click the "x" to remove the app

3. Re-Integrate with FB on your forum

(see if that helps)

Buraaq

Sounds a good option. You always have good suggestions to make spoogs, will give it a shot. Should work!  :D Thanks!!

SA™

http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

neliojesus

Quote from: Oldiesmann on September 21, 2010, 07:35:54 PM
Quote from: Sleepy Arcade on September 21, 2010, 12:16:48 PM
@ im looking into this

@ RAULVK confirmed as a bug

if you move it from where it is and put ifbefore this

}

if (isset($settings['use_default_images']) && $settings['use_default_images'] == 'defaults' && isset($settings['default_template']))


Sticking it there will put it inside a foreach loop, causing it to be echoed out once for every template layer that's defined. A better option would be to modify and move it a bit...

Find the global variables list inside setupThemeContext() (one function above the one where the code is currently placed) and add $boardurl to that list.

Then...

Find:
    // Set some specific vars.

And add this before it:
    $like_layout = empty($modSettings['liketopiclayout']) ? 'standard' : 'button_count';
    $like_verb = empty($modSettings['liketopicverb']) ? 'like' : 'recommend';
    $like_colour = empty($modSettings['liketopiccolour']) ? 'light' : 'dark';   

    $context['html_headers'] .= '
    <script src="'.$boardurl.'/fbc/fbconnect.js" type="text/javascript"></script>
    <script type="text/javascript">
        var mod_settings_fb_app_pageid = "'.$modSettings['fb_app_pageid'].'";   
        var mod_settings_fb_app_stream = "'.$modSettings['fb_app_stream'].'";
        var mod_settings_fb_app_connection = "'.$modSettings['fb_app_connection'].'";
        var mod_settings_fb_app_width = "'.$modSettings['fb_app_width'].'";
        var mod_settings_fb_com_xid = "'.$modSettings['fb_app_comments_boxid'].'";
        var mod_settings_fb_li_xid = "'.$modSettings['fb_app_stream_boxid'].'";
        var mod_settings_fb_com_show = "'.$modSettings['fb_admin_commets_post'].'";
        var forum_name = "'.$context['forum_name'].'";
        var site_slogan = "'.$settings['site_slogan'].'";
        var like_layout = "'. $like_layout. '";
        var like_verb = "'. $like_verb. '";
        var like_colour = "'. $like_colour. '";
        var live_hight = "'.$modSettings['fb_app_stream_hight'].'";
        var live_width = "'.$modSettings['fb_app_stream_width'].'";
        var fp_width = "'.$modSettings['fb_app_fp_width'].'";
        var fp_row = "'.$modSettings['fb_app_e_fp_row'].'";
        var rec_width = "'.$modSettings['fb_app_rec_width'].'";
        var rec_hight = "'.$modSettings['fb_app_rec_hight'].'";
    </script>';


Some notes:
Using $context['html_headers'] will ensure it gets echoed out in the <head> section for every theme.
Defining the "like" settings separately is done because the inline conditionals cause it to output "light" or "dark" after a </script> tag otherwise (though I'm not quite sure why).
Commas can't be used to concatenate strings, so you have to change those to periods instead.

Hope that helps. It worked for me :)

where i do that? wich file?

SA™

http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

mikeymx5

code is a bit sloppy for custom themes...

                   
            show_facebook_like('','',6);

I suggest a better way would be

            //manual edit facebook mod
            if (function_exists("show_facebook_like"))
            {show_facebook_like('','',6); }


this way if the mod is uninstalled and doesnt remove itself from your theme it doesnt crash SMF


Advertisement: