mirror of
https://github.com/friendica/friendica
synced 2024-11-11 07:02:53 +00:00
Merge branch 'master' of git://github.com/friendika/friendika
This commit is contained in:
commit
ad32d85cfa
1 changed files with 32 additions and 0 deletions
32
mod/item.php
32
mod/item.php
|
@ -323,10 +323,42 @@ function item_post(&$a) {
|
||||||
proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"$notify_type\" \"$post_id\" &",
|
proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"$notify_type\" \"$post_id\" &",
|
||||||
array(),$foo));
|
array(),$foo));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Post to Facebook stream
|
||||||
|
*/
|
||||||
|
|
||||||
|
if((local_user()) && (local_user() == $profile_uid)) {
|
||||||
|
$appid = get_config('system', 'facebook_appid' );
|
||||||
|
$secret = get_config('system', 'facebook_secret' );
|
||||||
|
if($appid && $secret) {
|
||||||
|
$fb_post = get_pconfig($local_user(),'facebook','post');
|
||||||
|
if($fb_post) {
|
||||||
|
require_once('library/facebook.php');
|
||||||
|
require_once('include/bbcode.php');
|
||||||
|
|
||||||
|
$facebook = new Facebook(array(
|
||||||
|
'appId' => $appid,
|
||||||
|
'secret' => $secret,
|
||||||
|
'cookie' => true
|
||||||
|
));
|
||||||
|
try {
|
||||||
|
$statusUpdate = $facebook->api('/me/feed', 'post', array('message'=> bbcode($body), 'cb' => ''));
|
||||||
|
}
|
||||||
|
catch (FacebookApiException $e) {
|
||||||
|
notice( t('Facebook status update failed.') . EOL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
goaway($a->get_baseurl() . "/" . $_POST['return'] );
|
goaway($a->get_baseurl() . "/" . $_POST['return'] );
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function item_content(&$a) {
|
function item_content(&$a) {
|
||||||
|
|
||||||
if((! local_user()) && (! remote_user()))
|
if((! local_user()) && (! remote_user()))
|
||||||
|
|
Loading…
Reference in a new issue