From: Michael Vogel Date: Sun, 3 Mar 2013 11:25:05 +0000 (+0100) Subject: gpluspost: Atom-Feed is now working. Add-On is ready to use X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=543c456110c79c965c786c8029d6c85c9c58a18f;p=friendica-addons.git gpluspost: Atom-Feed is now working. Add-On is ready to use --- diff --git a/gpluspost/gpluspost.php b/gpluspost/gpluspost.php index 327f9f32..586e4254 100644 --- a/gpluspost/gpluspost.php +++ b/gpluspost/gpluspost.php @@ -107,7 +107,7 @@ function gpluspost_post_local(&$a,&$b) { function gpluspost_send(&$a,&$b) { - logger('gpluspost_send: invoked for post '.$b['id']); + logger('gpluspost_send: invoked for post '.$b['id']." ".$b['app']); if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) return; @@ -119,8 +119,8 @@ function gpluspost_send(&$a,&$b) { return; // if post comes from Google+ don't send it back - if($b['app'] == "Google+") - return; + //if($b['app'] == "Google+") + // return; $itemlist = get_pconfig($b["uid"],'gpluspost','itemlist'); $items = explode(",", $itemlist); @@ -149,19 +149,25 @@ function gpluspost_init() { $uid = (int)$a->argv[1]; if ($uid == 0) { $contacts = q("SELECT `name`, `id` FROM contact WHERE `nick` = '%s' LIMIT 1", dbesc($a->argv[1])); - if ($contacts) + if ($contacts) { $uid = $contacts[0]["id"]; - } else + $nick = $a->argv[1]; + } + } else { $contacts = q("SELECT `name` FROM contact WHERE ID=%d LIMIT 1", intval($uid)); + $nick = $uid; + } } header("content-type: application/atom+xml"); echo ''."\n"; echo ''."\n"; echo "\t".'<![CDATA['.$a->config['sitename'].']]>'."\n"; - if ($uid != 0) + if ($uid != 0) { echo "\t".'\n"; - echo "\t".''."\n"; + echo "\t".''."\n"; + } else + echo "\t".''."\n"; echo "\t".$a->get_baseurl()."/\n"; echo "\t".''."\n"; echo "\t".date("c")."\n"; // To-Do @@ -169,8 +175,7 @@ function gpluspost_init() { echo "\t".''.$a->config['sitename'].''."\n"; if ($uid != 0) { - $itemlist = get_pconfig(local_user(),'gpluspost','itemlist'); - //$itemlist = "262568,262567,269154,271508,270121,273721,314735,312616,311570,308771,308247,306100,295372,291096,290390,290389,283242,283060,280465,273725"; + $itemlist = get_pconfig($uid,'gpluspost','itemlist'); $items = explode(",", $itemlist); foreach ($items AS $item)