]> git.mxchange.org Git - friendica-addons.git/blobdiff - facebook/facebook.php
Merge remote branch 'upstream/master'
[friendica-addons.git] / facebook / facebook.php
index 5990a99e834ab0308d55481be175cf7751730d99..b6e40654cd41c536b8905731cde3221a78d9fbc3 100755 (executable)
@@ -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 = '<input type="hidden" name="form_security_token" value="' . get_form_security_token("fbsave") . '">';
        
        $o .= '<h4>' . t('Facebook API Key') . '</h4>';
@@ -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;