X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=facebook%2Ffacebook.php;h=b6e40654cd41c536b8905731cde3221a78d9fbc3;hb=0f6f6bd0f149fcf39dfe742fc841030dba7b7084;hp=70a353dd2ee5f4cfe42876c1c1fb8f9ac768de06;hpb=d06df8bed045983ef2ad7918905dbf714ba2739a;p=friendica-addons.git
diff --git a/facebook/facebook.php b/facebook/facebook.php
index 70a353dd..b6e40654 100755
--- a/facebook/facebook.php
+++ b/facebook/facebook.php
@@ -59,6 +59,7 @@ define('FACEBOOK_SESSION_ERR_NOTIFICATION_INTERVAL', 259200); // 3 days
define('FACEBOOK_DEFAULT_POLL_INTERVAL', 60); // given in minutes
define('FACEBOOK_MIN_POLL_INTERVAL', 5);
+require_once('include/security.php');
function facebook_install() {
register_hook('post_local', 'addon/facebook/facebook.php', 'facebook_post_local');
@@ -648,6 +649,8 @@ function facebook_plugin_settings(&$a,&$b) {
function facebook_plugin_admin(&$a, &$o){
+
+
$o = '';
$o .= '
' . t('Facebook API Key') . '
';
@@ -1423,10 +1426,19 @@ function fb_consume_stream($uid,$j,$wall = false) {
}
}
+ if (($datarray['app'] == "Events") and $entry->actions)
+ foreach ($entry->actions as $action)
+ if ($action->name == "View")
+ $datarray['body'] .= " [url=".$action->link."]".$entry->story."[/url]";
+
// Just as a test - to see if these are the missing entries
//if(trim($datarray['body']) == '')
// $datarray['body'] = $entry->story;
+ // Adding the "story" text to see if there are useful data in it (testing)
+ //if (($datarray['app'] != "Events") and $entry->story)
+ // $datarray['body'] .= "\n".$entry->story;
+
if(trim($datarray['body']) == '') {
logger('facebook: empty body '.$entry->id.' '.print_r($entry, true));
continue;
@@ -1447,11 +1459,13 @@ function fb_consume_stream($uid,$j,$wall = false) {
//if(($datarray['body'] != '') and ($uid == 1))
// $datarray['body'] .= "[noparse]".print_r($entry, true)."[/noparse]";
- if ($entry->place->name)
- $datarray['coord'] = $entry->place->name;
- else if ($entry->place->location->street or $entry->place->location->city or $entry->place->location->Denmark) {
+ if ($entry->place->name or $entry->place->location->street or
+ $entry->place->location->city or $entry->place->location->Denmark) {
+ $datarray['coord'] = '';
+ if ($entry->place->name)
+ $datarray['coord'] .= $entry->place->name;
if ($entry->place->location->street)
- $datarray['coord'] = $entry->place->location->street;
+ $datarray['coord'] .= $entry->place->location->street;
if ($entry->place->location->city)
$datarray['coord'] .= " ".$entry->place->location->city;
if ($entry->place->location->country)