SA Facebook Integration

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

Previous topic - Next topic

shorepower

Quote from: distante on March 09, 2012, 09:43:56 PM
After the fix for the UTF-8 content in the post I was having a problem with The titles


So I was messing around with the code, and add a simple function in the file FacebookHooks.php
Code (Find) Select

$context['fb_publish_subject'] = $cleaned[0]['subject'];


Code (Replace) Select
$context['fb_publish_subject'] = html_entity_decode($cleaned[0]['subject']);


Result :


Now I'm still on the search of
  • How to remember my log position when the forum send me to FB to log in order to log in the forum.
  • How to publish posts where I have pictures added, with [nobb][img][/nobbc] tag or [attach] tag (of the ILA mod)
It's interesting that the first fix SA did for me did not work for you. I will try your changes to the UTF-8 and see if it work if my system
Ἐν οἴνῳ ἀλήθεια -- www.finewines.se

SA™

distante is correct $context['fb_publish_subject'] = $cleaned[0]['subject']; was never cleaned poperly i missed this:D
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 -___-

distante

To be added to the next realease! hehe :P




SA™, when I try to log into my forum and I'm no logged into facebook, witch function is used? because I still can't figure it out how to grab the page where I am to get back to there after go to the facebook page to login.

SA™

sources/facebook/facebookintergrate.php

this function handals the login part

public function fb_log(){
       
global $fb_hook_object, $smcFunc, $fb_object, $user_info, $scripturl, $modSettings, $sourcedir;

$face_userid['id_member'] = $fb_hook_object->face_USettings($fb_object->user_info_fbid,'id_member','fbid');
        $face_pass['passwd'] = $fb_hook_object->face_USettings($face_userid['id_member'],'passwd','id_member');
        $face_passsalt['password_salt'] = $fb_hook_object->face_USettings($face_userid['id_member'],'password_salt','id_member');
 
        $modSettings['cookieTime'] = 3153600;
 
        require_once($sourcedir.'/Subs-Auth.php');
        include_once($sourcedir.'/LogInOut.php');
        setLoginCookie(60 * $modSettings['cookieTime'], $face_userid['id_member'], sha1($face_pass['passwd'].$face_passsalt['password_salt']));
 
        $face_pwp['fbpw'] = $fb_hook_object->face_USettings($face_userid['id_member'],'fbpw','id_member');
 
        if(!empty($face_pwp['fbpw'])){setcookie("pwdone", 1);}else{setcookie("pwdone", 0);}
       
if (empty($_SESSION['login_url'])){
           
    $fb_log_url = !empty($fb_hook_object->modSettings['fb_log_url']) ? $fb_hook_object->modSettings['fb_log_url'] : $fb_hook_object->scripturl;
header('Location: '.$fb_log_url.'');
            }
    else{
           
      $temp = $_SESSION['login_url'];
    $fb_log_url = !empty($fb_hook_object->modSettings['fb_log_url']) ? $fb_hook_object->modSettings['fb_log_url'] : $temp;
            unset($_SESSION['login_url']);
header('Location: '.$fb_log_url.'');
            }

    }
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 -___-

distante

I'm trying to do some test, but I'm getting this error:
QuoteThe database value you're trying to insert does not exist: mem

Any Idea what it is?

distante

Other thing (sorry for been so annoying)

When I put in the Publisher admin panel "New topics" for publish, it supposed to auto publish in my fan page the news of the new topic don't?

Because I have no automatic posts into facebook when a new topic is created. I configured the Facebook page ID, and my Facebook user ID, establish grand permissions and the Access tokens are filled.

What I'm doing wrong?

SA™

did you leave this
Publish to facebook?
to the default value? if so chnage it to profile and save it then put it back to page save it should work then

QuoteI'm trying to do some test, but I'm getting this error:
Quote
The database value you're trying to insert does not exist: mem

Any Idea what it is?

if you are changing the function i posted yesterday it ill be once if these

$face_userid['id_member'] = $fb_hook_object->face_USettings($fb_object->user_info_fbid,'id_member','fbid');
$face_pass['passwd'] = $fb_hook_object->face_USettings($face_userid['id_member'],'passwd','id_member');
$face_passsalt['password_salt'] = $fb_hook_object->face_USettings($face_userid['id_member'],'password_salt','id_member');
 
$face_pwp['fbpw'] = $fb_hook_object->face_USettings($face_userid['id_member'],'fbpw','id_member');

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 -___-

distante

#2387
Quote from: SA™ on March 11, 2012, 05:55:53 PM
did you leave this
Publish to facebook?
to the default value? if so chnage it to profile and save it then put it back to page save it should work then

Yeap, now that is working, thanks! And it is taking the image that I use in the post with the img tag, but I still have the problem that when I use the "publish" button, no Image is showing in fb.

I will continue looking up for the redirect login problem with Pretty Urls. How do you catch the actual URL where The user clicks "login with facebook" ?

distante

This is a little fix for the FB icon in the "publish" link

Problem: When you see a forum with SA Facebook Integration installed, you saw the publish link in this way:



But, when you are logged, you see this:



So, the fix it's very simple, just add this in the index.css of your theme:

li.fbpub_button  {
display: inline;
font-weight: bold;
background: url(../images/facebook.png) no-repeat left;
padding-left: 18px;
}


Live example: http://www.desadaptados.net/chicas-hot/zahia-dehar-de-prostituta-vip-a-las-paginas-de-vanity-fair/
(sorry the example is in spanish!)

SA™

new version

Quotefixed issue unable to connect
fixed undefined index: fb_admin_pid
fixed undefined index: fb_admin_uid
fixed issue with publish button image not showing for guest [thanks distante]
fixed issue with publishing topic not working correct with utf-8
fixed issue with logic when getting keys
fixed issue publish button showing where it shouldent be
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 -___-

distante

Do I have to uninstall the previous version first?

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 -___-

distante

I installed the new version but now the reference for the publish icon (when I'm a guest) I can't see the facebook icon in the publish button, since I'm using pretty Urls is the icon is been searching in forum/topicname/images/facebook.png

Where can I changed this?

distante

#2393
* distante other personality takes over.

Search in FacebookHooks.php

Code (Search) Select
background: url(../images/facebook.png) no-repeat left;


Code (Replace) Select
background: url('.$settings['images_url'].'/facebook.png) no-repeat 0 0;

It work without any additional css files edits ;)




SA, I'm still not able to recognize where the "back url" is generated or saved when I have to go to the FB page to log, also, maybe an IF statement will be good in the facebookhooks.php to check if the url have the board.topic form, or the /forum/topicname prettyUrls form (because I had to make the change in the file again for the login)

And One more thing, In the hooks, is a possibility to put or create a button "what are you thinking" in a specific place?

SA™

QuoteSearch in FacebookHooks.php

Code: (Search) [Select]
background: url(../images/facebook.png) no-repeat left;



Code: (Replace) [Select]
background: url('.$settings['images_url'].'/facebook.png) no-repeat 0 0;

It work without any additional css files edits

just fixed this and updated the package

QuoteAnd One more thing, In the hooks, is a possibility to put or create a button "what are you thinking" in a specific place?

yes you can use the facebook_showPub function

example

if (class_exists('SAFacebookhooks')) {
    echo
SAFacebookhooks::facebook_showPub(
    array(
'subject' =>'subject',
'body' => 'body',
'href' =>href,
'isPost' => false,
        )
);
    }
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 -___-

distante

But that is for "publish" don't?

I want to put a floating button of "what are you thinking", like the button in the facebook action

SA™

yes that button in th facebook action is using the above function it can be used for both
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 -___-

distante

well I will dig into that tomorrow then, Now is 3.41 am in my country! ZzZZZz

trekkie2444

I've got an issue with REV49...

When someone is logged out of Facebook and they use the connect to Facebook button (I linked the button and code for it from the register button to the top of my forum), it has them login on Facebook, and then when redirected back to my forum, I get this:

An Error Has Occurred!
The database value you're trying to insert does not exist: mem

Interestingly it only happened the first time I tested it, the second time it just worked as it should.


trekkie2444

This error popped up in my error log as critical:

http://e-p1.net/index.php?action=facebookintegrate;area=connectlog
The database value you're trying to insert does not exist: mem
Function: face_USettings
File: [...]/Facebook/FacebookHooks.php
Line: 872

Advertisement: