aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@diekershoff.homeunix.net>2010-12-18 10:56:44 +0100
committerroot <root@diekershoff.homeunix.net>2010-12-18 10:56:44 +0100
commitad32d85cfaa775efbd89b273bd51c82f4e45baab (patch)
tree26aed2c91349e763113e28d217648884df9a965a
parentf6ee615a79eaab03adc540704ab17b8a44a3d9e8 (diff)
parentd3987416c50396fdb4881240f15b563a68c43ab6 (diff)
downloadvolse-hubzilla-ad32d85cfaa775efbd89b273bd51c82f4e45baab.tar.gz
volse-hubzilla-ad32d85cfaa775efbd89b273bd51c82f4e45baab.tar.bz2
volse-hubzilla-ad32d85cfaa775efbd89b273bd51c82f4e45baab.zip
Merge branch 'master' of git://github.com/friendika/friendika
-rw-r--r--mod/item.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/mod/item.php b/mod/item.php
index ea88e6c31..99721794a 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -323,10 +323,42 @@ function item_post(&$a) {
proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"$notify_type\" \"$post_id\" &",
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'] );
return; // NOTREACHED
}
+
+
+
+
function item_content(&$a) {
if((! local_user()) && (! remote_user()))