X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=facebook%2Ffacebook.php;h=f977bef90192f469097bc26d3cb729aab93447f9;hb=9c00bd1608cea9aa86fd00691c23d838758607bc;hp=59acfa978181b8954e3aa4af346bf652a1cd3f70;hpb=33df3995742eba7f9a4936ae9d0807547164be0b;p=friendica-addons.git
diff --git a/facebook/facebook.php b/facebook/facebook.php
old mode 100755
new mode 100644
index 59acfa97..f977bef9
--- a/facebook/facebook.php
+++ b/facebook/facebook.php
@@ -1,41 +1,17 @@
- * Tobias HöÃl
+ * Author: Tobias HöÃl
+ *
*/
/**
* Installing the Friendica/Facebook connector
*
- * 1. register an API key for your site from developer.facebook.com
- * a. We'd be very happy if you include "Friendica" in the application name
- * to increase name recognition. The Friendica icons are also present
- * in the images directory and may be uploaded as a Facebook app icon.
- * Use images/friendica-16.jpg for the Icon and images/friendica-128.jpg for the Logo.
- * b. The url should be your site URL with a trailing slash.
- * Friendica is a software application and does not require a Privacy Policy
- * or Terms of Service, though your installation of it might. Facebook may require
- * that you provide a Privacy Policy, which we find ironic.
- * c. Set the following values in your .htconfig.php file
- * $a->config['facebook']['appid'] = 'xxxxxxxxxxx';
- * $a->config['facebook']['appsecret'] = 'xxxxxxxxxxxxxxx';
- * Replace with the settings Facebook gives you.
- * d. Navigate to Set Web->Site URL & Domain -> Website Settings. Set
- * Site URL to yoursubdomain.yourdomain.com. Set Site Domain to your
- * yourdomain.com.
- * 2. Visit the Facebook Settings section of the "Settings->Plugin Settings" page.
- * and click 'Install Facebook Connector'.
- * 3. Visit the Facebook Settings section of the "Settings->Plugin Settings" page.
- * and click 'Install Facebook Connector'.
- * 4. This will ask you to login to Facebook and grant permission to the
- * plugin to do its stuff. Allow it to do so.
- * 5. Optional step: If you want to use Facebook Real Time Updates (so new messages
- * and new contacts are added ~1min after they are postet / added on FB), go to
- * Settings -> plugins -> facebook and press the "Activate Real-Time Updates"-button.
- * 6. You're done. To turn it off visit the Plugin Settings page again and
- * 'Remove Facebook posting'.
+ * Detailed instructions how to use this plugin can be found at
+ * https://github.com/friendica/friendica/wiki/How-to:-Friendica%E2%80%99s-Facebook-connector
*
* Vidoes and embeds will not be posted if there is no other content. Links
* and images will be converted to a format suitable for the Facebook API and
@@ -58,7 +34,9 @@ define('FACEBOOK_MAXPOSTLEN', 63206);
define('FACEBOOK_SESSION_ERR_NOTIFICATION_INTERVAL', 259200); // 3 days
define('FACEBOOK_DEFAULT_POLL_INTERVAL', 60); // given in minutes
define('FACEBOOK_MIN_POLL_INTERVAL', 5);
+define('FACEBOOK_RTU_ERR_MAIL_AFTER_MINUTES', 180); // 3 hours
+require_once('include/security.php');
function facebook_install() {
register_hook('post_local', 'addon/facebook/facebook.php', 'facebook_post_local');
@@ -95,42 +73,45 @@ function facebook_module() {}
// If a->argv[1] is a nickname, this is a callback from Facebook oauth requests.
// If $_REQUEST["realtime_cb"] is set, this is a callback from the Real-Time Updates API
+/**
+ * @param App $a
+ */
function facebook_init(&$a) {
-
+
if (x($_REQUEST, "realtime_cb") && x($_REQUEST, "realtime_cb")) {
logger("facebook_init: Facebook Real-Time callback called", LOGGER_DEBUG);
-
+
if (x($_REQUEST, "hub_verify_token")) {
// this is the verification callback while registering for real time updates
-
+
$verify_token = get_config('facebook', 'cb_verify_token');
if ($verify_token != $_REQUEST["hub_verify_token"]) {
logger('facebook_init: Wrong Facebook Callback Verifier - expected ' . $verify_token . ', got ' . $_REQUEST["hub_verify_token"]);
return;
}
-
+
if (x($_REQUEST, "hub_challenge")) {
logger('facebook_init: Answering Challenge: ' . $_REQUEST["hub_challenge"], LOGGER_DATA);
echo $_REQUEST["hub_challenge"];
die();
}
}
-
+
require_once('include/items.php');
-
+
// this is a status update
$content = file_get_contents("php://input");
if (is_numeric($content)) $content = file_get_contents("php://input");
$js = json_decode($content);
logger(print_r($js, true), LOGGER_DATA);
-
+
if (!isset($js->object) || $js->object != "user" || !isset($js->entry)) {
logger('facebook_init: Could not parse Real-Time Update data', LOGGER_DEBUG);
return;
}
-
+
$affected_users = array("feed" => array(), "friends" => array());
-
+
foreach ($js->entry as $entry) {
$fbuser = $entry->uid;
foreach ($entry->changed_fields as $field) {
@@ -139,20 +120,20 @@ function facebook_init(&$a) {
continue;
}
if (in_array($fbuser, $affected_users[$field])) continue;
-
+
$r = q("SELECT `uid` FROM `pconfig` WHERE `cat` = 'facebook' AND `k` = 'self_id' AND `v` = '%s' LIMIT 1", dbesc($fbuser));
if(! count($r))
continue;
$uid = $r[0]['uid'];
-
+
$access_token = get_pconfig($uid,'facebook','access_token');
if(! $access_token)
return;
-
+
switch ($field) {
case "feed":
logger('facebook_init: FB-User ' . $fbuser . ' / feed', LOGGER_DEBUG);
-
+
if(! get_pconfig($uid,'facebook','no_wall')) {
$private_wall = intval(get_pconfig($uid,'facebook','private_wall'));
$s = fetch_url('https://graph.facebook.com/me/feed?access_token=' . $access_token);
@@ -166,11 +147,11 @@ function facebook_init(&$a) {
}
}
}
-
+
break;
case "friends":
logger('facebook_init: FB-User ' . $fbuser . ' / friends', LOGGER_DEBUG);
-
+
fb_get_friends($uid, false);
set_pconfig($uid,'facebook','friend_check',time());
break;
@@ -182,15 +163,16 @@ function facebook_init(&$a) {
}
}
-
if($a->argc != 2)
return;
+
$nick = $a->argv[1];
+
if(strlen($nick))
$r = q("SELECT `uid` FROM `user` WHERE `nickname` = '%s' LIMIT 1",
dbesc($nick)
);
- if(! count($r))
+ if(!(isset($r) && count($r)))
return;
$uid = $r[0]['uid'];
@@ -208,7 +190,7 @@ function facebook_init(&$a) {
$x = fetch_url('https://graph.facebook.com/oauth/access_token?client_id='
. $appid . '&client_secret=' . $appsecret . '&redirect_uri='
- . urlencode($a->get_baseurl() . '/facebook/' . $nick)
+ . urlencode($a->get_baseurl() . '/facebook/' . $nick)
. '&code=' . $auth_code);
logger('facebook_init: returned access token: ' . $x, LOGGER_DATA);
@@ -232,6 +214,9 @@ function facebook_init(&$a) {
}
+/**
+ * @param int $uid
+ */
function fb_get_self($uid) {
$access_token = get_pconfig($uid,'facebook','access_token');
if(! $access_token)
@@ -243,133 +228,177 @@ function fb_get_self($uid) {
}
}
-function fb_get_friends_sync_new($uid, $access_token, $person) {
- $link = 'http://facebook.com/profile.php?id=' . $person->id;
-
- $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' LIMIT 1",
- intval($uid),
- dbesc($link)
- );
-
- if (count($r) == 0) {
- logger('fb_get_friends: new contact found: ' . $link, LOGGER_DEBUG);
-
- fb_get_friends_sync_full($uid, $access_token, $person);
- }
+/**
+ * @param int $uid
+ * @param string $access_token
+ * @param array $persons
+ */
+function fb_get_friends_sync_new($uid, $access_token, $persons) {
+ $persons_todo = array();
+ foreach ($persons as $person) {
+ $link = 'http://facebook.com/profile.php?id=' . $person->id;
+
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' LIMIT 1",
+ intval($uid),
+ dbesc($link)
+ );
+
+ if (count($r) == 0) {
+ logger('fb_get_friends: new contact found: ' . $link, LOGGER_DEBUG);
+ $persons_todo[] = $person;
+ }
+
+ if (count($persons_todo) > 0) fb_get_friends_sync_full($uid, $access_token, $persons_todo);
+ }
}
-function fb_get_friends_sync_full($uid, $access_token, $person) {
- $s = fetch_url('https://graph.facebook.com/' . $person->id . '?access_token=' . $access_token);
- if($s) {
- $jp = json_decode($s);
- logger('fb_get_friends: info: ' . print_r($jp,true), LOGGER_DATA);
+/**
+ * @param int $uid
+ * @param object $contact
+ */
+function fb_get_friends_sync_parsecontact($uid, $contact) {
+ $contact->link = 'http://facebook.com/profile.php?id=' . $contact->id;
- // always use numeric link for consistency
+ // If its a page then set the first name from the username
+ if (!$contact->first_name and $contact->username)
+ $contact->first_name = $contact->username;
- $jp->link = 'http://facebook.com/profile.php?id=' . $person->id;
+ // check if we already have a contact
- // If its a page then set the first name from the username
- if (!$jp->first_name and $jp->username)
- $jp->first_name = $jp->username;
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' LIMIT 1",
+ intval($uid),
+ dbesc($contact->link)
+ );
- // check if we already have a contact
+ if(count($r)) {
- $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' LIMIT 1",
- intval($uid),
- dbesc($jp->link)
- );
+ // update profile photos once every two weeks as we have no notification of when they change.
- if(count($r)) {
+ $update_photo = (($r[0]['avatar-date'] < datetime_convert('','','now -14 days')) ? true : false);
- // check that we have all the photos, this has been known to fail on occasion
-
- if((! $r[0]['photo']) || (! $r[0]['thumb']) || (! $r[0]['micro'])) {
- require_once("Photo.php");
-
- $photos = import_profile_photo('https://graph.facebook.com/' . $jp->id . '/picture', $uid, $r[0]['id']);
-
- $r = q("UPDATE `contact` SET `photo` = '%s',
- `thumb` = '%s',
- `micro` = '%s',
- `name-date` = '%s',
- `uri-date` = '%s',
- `avatar-date` = '%s'
- WHERE `id` = %d LIMIT 1
- ",
- dbesc($photos[0]),
- dbesc($photos[1]),
- dbesc($photos[2]),
- dbesc(datetime_convert()),
- dbesc(datetime_convert()),
- dbesc(datetime_convert()),
- intval($r[0]['id'])
- );
- }
- return;
- }
- else {
+ // check that we have all the photos, this has been known to fail on occasion
- // create contact record
- $r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `alias`, `notify`, `poll`,
- `name`, `nick`, `photo`, `network`, `rel`, `priority`,
- `writable`, `blocked`, `readonly`, `pending` )
- VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, 0, 0, 0 ) ",
- intval($uid),
- dbesc(datetime_convert()),
- dbesc($jp->link),
- dbesc(normalise_link($jp->link)),
- dbesc(''),
- dbesc(''),
- dbesc($jp->id),
- dbesc('facebook ' . $jp->id),
- dbesc($jp->name),
- dbesc(($jp->nickname) ? $jp->nickname : strtolower($jp->first_name)),
- dbesc('https://graph.facebook.com/' . $jp->id . '/picture'),
- dbesc(NETWORK_FACEBOOK),
- intval(CONTACT_IS_FRIEND),
- intval(1),
- intval(1)
- );
- }
+ if((! $r[0]['photo']) || (! $r[0]['thumb']) || (! $r[0]['micro']) || ($update_photo)) {
+ require_once("Photo.php");
- $r = q("SELECT * FROM `contact` WHERE `url` = '%s' AND `uid` = %d LIMIT 1",
- dbesc($jp->link),
- intval($uid)
- );
+ $photos = import_profile_photo('https://graph.facebook.com/' . $contact->id . '/picture', $uid, $r[0]['id']);
- if(! count($r)) {
- return;
- }
+ q("UPDATE `contact` SET `photo` = '%s',
+ `thumb` = '%s',
+ `micro` = '%s',
+ `name-date` = '%s',
+ `uri-date` = '%s',
+ `avatar-date` = '%s'
+ WHERE `id` = %d LIMIT 1
+ ",
+ dbesc($photos[0]),
+ dbesc($photos[1]),
+ dbesc($photos[2]),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ intval($r[0]['id'])
+ );
+ }
+ return;
+ }
+ else {
+
+ // create contact record
+ q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `alias`, `notify`, `poll`,
+ `name`, `nick`, `photo`, `network`, `rel`, `priority`,
+ `writable`, `blocked`, `readonly`, `pending` )
+ VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, 0, 0, 0 ) ",
+ intval($uid),
+ dbesc(datetime_convert()),
+ dbesc($contact->link),
+ dbesc(normalise_link($contact->link)),
+ dbesc(''),
+ dbesc(''),
+ dbesc($contact->id),
+ dbesc('facebook ' . $contact->id),
+ dbesc($contact->name),
+ dbesc(($contact->nickname) ? $contact->nickname : mb_convert_case($contact->first_name, MB_CASE_LOWER, "UTF-8")),
+ dbesc('https://graph.facebook.com/' . $contact->id . '/picture'),
+ dbesc(NETWORK_FACEBOOK),
+ intval(CONTACT_IS_FRIEND),
+ intval(1),
+ intval(1)
+ );
+ }
- $contact = $r[0];
- $contact_id = $r[0]['id'];
-
- require_once("Photo.php");
-
- $photos = import_profile_photo($r[0]['photo'],$uid,$contact_id);
-
- $r = q("UPDATE `contact` SET `photo` = '%s',
- `thumb` = '%s',
- `micro` = '%s',
- `name-date` = '%s',
- `uri-date` = '%s',
- `avatar-date` = '%s'
- WHERE `id` = %d LIMIT 1
- ",
- dbesc($photos[0]),
- dbesc($photos[1]),
- dbesc($photos[2]),
- dbesc(datetime_convert()),
- dbesc(datetime_convert()),
- dbesc(datetime_convert()),
- intval($contact_id)
- );
+ $r = q("SELECT * FROM `contact` WHERE `url` = '%s' AND `uid` = %d LIMIT 1",
+ dbesc($contact->link),
+ intval($uid)
+ );
+ if(! count($r)) {
+ return;
+ }
+
+ $contact_id = $r[0]['id'];
+
+ $g = q("select def_gid from user where uid = %d limit 1",
+ intval($uid)
+ );
+ if($g && intval($g[0]['def_gid'])) {
+ require_once('include/group.php');
+ group_add_member($uid,'',$contact_id,$g[0]['def_gid']);
}
+
+ require_once("Photo.php");
+
+ $photos = import_profile_photo($r[0]['photo'],$uid,$contact_id);
+
+ q("UPDATE `contact` SET `photo` = '%s',
+ `thumb` = '%s',
+ `micro` = '%s',
+ `name-date` = '%s',
+ `uri-date` = '%s',
+ `avatar-date` = '%s'
+ WHERE `id` = %d LIMIT 1
+ ",
+ dbesc($photos[0]),
+ dbesc($photos[1]),
+ dbesc($photos[2]),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ intval($contact_id)
+ );
}
+/**
+ * @param int $uid
+ * @param string $access_token
+ * @param array $persons
+ */
+function fb_get_friends_sync_full($uid, $access_token, $persons) {
+ if (count($persons) == 0) return;
+ $nums = Ceil(count($persons) / 50);
+ for ($i = 0; $i < $nums; $i++) {
+ $batch_request = array();
+ for ($j = $i * 50; $j < ($i+1) * 50 && $j < count($persons); $j++) $batch_request[] = array('method'=>'GET', 'relative_url'=>$persons[$j]->id);
+ $s = post_url('https://graph.facebook.com/', array('access_token' => $access_token, 'batch' => json_encode($batch_request)));
+ if($s) {
+ $results = json_decode($s);
+ logger('fb_get_friends: info: ' . print_r($results,true), LOGGER_DATA);
+ foreach ($results as $contact) {
+ if ($contact->code != 200) logger('fb_get_friends: not found: ' . print_r($contact,true), LOGGER_DEBUG);
+ else fb_get_friends_sync_parsecontact($uid, json_decode($contact->body));
+ }
+ }
+ }
+}
+
+
+
// if $fullsync is true, only new contacts are searched for
+/**
+ * @param int $uid
+ * @param bool $fullsync
+ */
function fb_get_friends($uid, $fullsync = true) {
$r = q("SELECT `uid` FROM `user` WHERE `uid` = %d AND `account_expired` = 0 LIMIT 1",
@@ -381,6 +410,7 @@ function fb_get_friends($uid, $fullsync = true) {
$access_token = get_pconfig($uid,'facebook','access_token');
$no_linking = get_pconfig($uid,'facebook','no_linking');
+
if($no_linking)
return;
@@ -388,27 +418,37 @@ function fb_get_friends($uid, $fullsync = true) {
return;
$s = fetch_url('https://graph.facebook.com/me/friends?access_token=' . $access_token);
if($s) {
- logger('facebook: fb_get_friends: ' . $s, LOGGER_DATA);
+ logger('facebook: fb_gwet_friends: ' . $s, LOGGER_DATA);
$j = json_decode($s);
logger('facebook: fb_get_friends: json: ' . print_r($j,true), LOGGER_DATA);
if(! $j->data)
return;
- foreach($j->data as $person)
- if ($fullsync)
- fb_get_friends_sync_full($uid, $access_token, $person);
- else
- fb_get_friends_sync_new($uid, $access_token, $person);
+
+ $persons_todo = array();
+ foreach($j->data as $person) $persons_todo[] = $person;
+
+ if ($fullsync)
+ fb_get_friends_sync_full($uid, $access_token, $persons_todo);
+ else
+ fb_get_friends_sync_new($uid, $access_token, $persons_todo);
}
}
// This is the POST method to the facebook settings page
-// Content is posted to Facebook in the function facebook_post_hook()
+// Content is posted to Facebook in the function facebook_post_hook()
+/**
+ * @param App $a
+ */
function facebook_post(&$a) {
$uid = local_user();
if($uid){
+
+ $fb_limited = get_config('facebook','crestrict');
+
+
$value = ((x($_POST,'post_by_default')) ? intval($_POST['post_by_default']) : 0);
set_pconfig($uid,'facebook','post_by_default', $value);
@@ -419,12 +459,18 @@ function facebook_post(&$a) {
$private_wall = ((x($_POST,'facebook_private_wall')) ? intval($_POST['facebook_private_wall']) : 0);
set_pconfig($uid,'facebook','private_wall',$private_wall);
-
+
set_pconfig($uid,'facebook','blocked_apps',escape_tags(trim($_POST['blocked_apps'])));
$linkvalue = ((x($_POST,'facebook_linking')) ? intval($_POST['facebook_linking']) : 0);
- set_pconfig($uid,'facebook','no_linking', (($linkvalue) ? 0 : 1));
+
+ if($fb_limited) {
+ if($linkvalue == 0)
+ set_pconfig($uid,'facebook','no_linking', 1);
+ }
+ else
+ set_pconfig($uid,'facebook','no_linking', (($linkvalue) ? 0 : 1));
// FB linkage was allowed but has just been turned off - remove all FB contacts and posts
@@ -454,6 +500,10 @@ function facebook_post(&$a) {
// Facebook settings form
+/**
+ * @param App $a
+ * @return string
+ */
function facebook_content(&$a) {
if(! local_user()) {
@@ -461,6 +511,13 @@ function facebook_content(&$a) {
return '';
}
+
+ if(! service_class_allows(local_user(),'facebook_connect')) {
+ notice( t('Permission denied.') . EOL);
+ return upgrade_bool_message();
+ }
+
+
if($a->argc > 1 && $a->argv[1] === 'remove') {
del_pconfig(local_user(),'facebook','post');
info( t('Facebook disabled') . EOL);
@@ -471,13 +528,15 @@ function facebook_content(&$a) {
info( t('Updating contacts') . EOL);
}
+
+ $fb_limited = get_config('facebook','restrict');
+
$o = '';
$fb_installed = false;
if (get_pconfig(local_user(),'facebook','post')) {
$access_token = get_pconfig(local_user(),'facebook','access_token');
if ($access_token) {
- $private_wall = intval(get_pconfig($uid,'facebook','private_wall'));
$s = fetch_url('https://graph.facebook.com/me/feed?access_token=' . $access_token);
if($s) {
$j = json_decode($s);
@@ -493,7 +552,7 @@ function facebook_content(&$a) {
return '';
}
- $a->page['htmlhead'] .= '' . "\r\n";
$o .= '
' . t('Facebook Connect') . '
';
@@ -525,6 +584,15 @@ function facebook_content(&$a) {
$no_linking = get_pconfig(local_user(),'facebook','no_linking');
$checked = (($no_linking) ? '' : ' checked="checked" ');
+ if($fb_limited) {
+ if($no_linking) {
+ $o .= EOL . '' . t('Facebook friend linking has been disabled on this site. The following settings will have no effect.') . '' . EOL;
+ $checked .= " disabled ";
+ }
+ else {
+ $o .= EOL . '' . t('Facebook friend linking has been disabled on this site. If you disable it, you will be unable to re-enable it.') . '' . EOL;
+ }
+ }
$o .= '' . ' ' . t('Link all your Facebook friends and conversations on this website') . EOL ;
$o .= '
' . t('Facebook conversations consist of your profile wall and your friend stream.');
@@ -555,7 +623,11 @@ function facebook_content(&$a) {
}
-
+/**
+ * @param App $a
+ * @param null|object $b
+ * @return mixed
+ */
function facebook_cron($a,$b) {
$last = get_config('facebook','last_poll');
@@ -565,7 +637,7 @@ function facebook_cron($a,$b) {
$poll_interval = FACEBOOK_DEFAULT_POLL_INTERVAL;
if($last) {
- $next = $last + $poll_interval;
+ $next = $last + ($poll_interval * 60);
if($next > time())
return;
}
@@ -596,6 +668,8 @@ function facebook_cron($a,$b) {
$last_friend_check = get_pconfig($rr['uid'],'facebook','friend_check');
if($last_friend_check)
$next_friend_check = $last_friend_check + 86400;
+ else
+ $next_friend_check = 0;
if($next_friend_check <= time()) {
fb_get_friends($rr['uid'], true);
set_pconfig($rr['uid'],'facebook','friend_check',time());
@@ -614,9 +688,16 @@ function facebook_cron($a,$b) {
logger('facebook_cron: Successful', LOGGER_NORMAL);
else {
logger('facebook_cron: Failed', LOGGER_NORMAL);
-
- if(strlen($a->config['admin_email']) && !get_config('facebook', 'realtime_err_mailsent')) {
- $res = mail($a->config['admin_email'], t('Problems with Facebook Real-Time Updates'),
+
+ $first_err = get_config('facebook', 'realtime_first_err');
+ if (!$first_err) {
+ $first_err = time();
+ set_config('facebook', 'realtime_first_err', $first_err);
+ }
+ $first_err_ago = (time() - $first_err);
+
+ if(strlen($a->config['admin_email']) && !get_config('facebook', 'realtime_err_mailsent') && $first_err_ago > (FACEBOOK_RTU_ERR_MAIL_AFTER_MINUTES * 60)) {
+ mail($a->config['admin_email'], t('Problems with Facebook Real-Time Updates'),
"Hi!\n\nThere's a problem with the Facebook Real-Time Updates that cannot be solved automatically. Maybe a permission issue?\n\nPlease try to re-activate it on " . $a->config["system"]["url"] . "/admin/plugins/facebook\n\nThis e-mail will only be sent once.",
'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
. 'Content-type: text/plain; charset=UTF-8' . "\n"
@@ -628,6 +709,7 @@ function facebook_cron($a,$b) {
}
} else { // !facebook_check_realtime_active()
del_config('facebook', 'realtime_err_mailsent');
+ del_config('facebook', 'realtime_first_err');
}
}
@@ -636,7 +718,10 @@ function facebook_cron($a,$b) {
}
-
+/**
+ * @param App $a
+ * @param null|object $b
+ */
function facebook_plugin_settings(&$a,&$b) {
$b .= '