use Friendica\App;
use Friendica\Core\Config;
-require_once("include/Scrape.php");
use Friendica\Network\Probe;
require_once 'include/Contact.php';
require_once 'include/enotify.php';
require_once 'include/socgraph.php';
require_once 'include/Photo.php';
+require_once 'include/probe.php';
require_once 'include/follow.php';
require_once 'include/api.php';
require_once 'mod/proxy.php';
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `nurl` IN ('%s', '%s') AND `network` != '%s'",
intval($importer["uid"]), dbesc(normalise_link($author["author-link"])),
dbesc(normalise_link($aliaslink)), dbesc(NETWORK_STATUSNET));
+
if (dbm::is_result($r)) {
$contact = $r[0];
$author["contact-id"] = $r[0]["id"];
// Should not happen
$contact = dba::fetch_first("SELECT * FROM `contact` WHERE `uid` = ? AND `addr` = ? AND `network` != ?",
$importer["uid"], $addr, NETWORK_STATUSNET);
+
if (dbm::is_result($contact)) {
$author["contact-id"] = $contact["id"];
$author["author-link"] = $contact["url"];
$avatarlist = array();
$avatars = $xpath->query("atom:author/atom:link[@rel='avatar']", $context);
- foreach($avatars AS $avatar) {
+ foreach ($avatars AS $avatar) {
$href = "";
$width = 0;
- foreach($avatar->attributes AS $attributes) {
- if ($attributes->name == "href")
+ foreach ($avatar->attributes AS $attributes) {
+ if ($attributes->name == "href") {
$href = $attributes->textContent;
- if ($attributes->name == "width")
+ }
+ if ($attributes->name == "width") {
$width = $attributes->textContent;
+ }
}
- if (($width > 0) AND ($href != ""))
+ if (($width > 0) AND ($href != "")) {
$avatarlist[$width] = $href;
+ }
}
if (count($avatarlist) > 0) {
krsort($avatarlist);
- $author["author-avatar"] = Probe::fix_avatar(current($avatarlist), $author["author-link"]);
+ $author["author-avatar"] = Probe::fixAvatar(current($avatarlist), $author["author-link"]);
}
$displayname = $xpath->evaluate('atom:author/poco:displayName/text()', $context)->item(0)->nodeValue;
- if ($displayname != "")
+ if ($displayname != "") {
$author["author-name"] = $displayname;
+ }
$author["owner-name"] = $author["author-name"];
$author["owner-link"] = $author["author-link"];
foreach ($category->attributes AS $attributes) {
if ($attributes->name == "term") {
$term = $attributes->textContent;
- if(strlen($item["tag"])) {
+ if (strlen($item["tag"])) {
$item["tag"] .= ',';
}
$item["tag"] .= "#[url=".App::get_baseurl()."/search?tag=".$term."]".$term."[/url]";
continue;
}
+ /// @TODO One statment is okay (until if () )
$arr = array();
$arr["network"] = $details["network"];
$arr["uri"] = $single_conv->id;
$arr["owner-name"] = $single_conv->actor->portablecontacts_net->displayName;
$arr["owner-link"] = $actor;
- $arr["owner-avatar"] = Probe::fix_avatar($single_conv->actor->image->url, $arr["owner-link"]);
+ $arr["owner-avatar"] = Probe::fixAvatar($single_conv->actor->image->url, $arr["owner-link"]);
$arr["author-name"] = $arr["owner-name"];
$arr["author-link"] = $arr["owner-link"];
$arr["author-name"] = $single_conv->object->actor->contact->displayName;
}
$arr["author-link"] = $single_conv->object->actor->url;
- $arr["author-avatar"] = Probe::fix_avatar($single_conv->object->actor->image->url, $arr["author-link"]);
+ $arr["author-avatar"] = Probe::fixAvatar($single_conv->object->actor->image->url, $arr["author-link"]);
$arr["app"] = $single_conv->object->provider->displayName."#";
//$arr["verb"] = $single_conv->object->verb;
$owner = $r[0];
- if(!strlen($last_update))
+ if (!strlen($last_update))
$last_update = 'now -30 days';
$check_date = datetime_convert('UTC','UTC',$last_update,'Y-m-d H:i:s');