$homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False);
+ $about = ((x($profile,'about') == 1) ? t('About:') : False);
+
if(($profile['hidewall'] || $block) && (! local_user()) && (! remote_user())) {
- $location = $pdesc = $gender = $marital = $homepage = False;
+ $location = $pdesc = $gender = $marital = $homepage = $about = False;
}
$firstname = ((strpos($profile['name'],' '))
'$pdesc' => $pdesc,
'$marital' => $marital,
'$homepage' => $homepage,
+ '$about' => $about,
'$network' => t('Network:'),
'$diaspora' => $diaspora,
'$contact_block' => $contact_block,
dbesc(datetime_convert()),
intval($r[0]['id'])
);
- delete_thread($r[0]['id']);
+ delete_thread($r[0]['id'], $r[0]['parent-uri']);
}
}
}
dbesc(datetime_convert()),
intval($r[0]['id'])
);
- delete_thread($r[0]['id']);
+ delete_thread($r[0]['id'], $r[0]['parent-uri']);
// Now check if the retraction needs to be relayed by us
//
$name = unxmlify($xml->first_name) . ((strlen($xml->last_name)) ? ' ' . unxmlify($xml->last_name) : '');
$image_url = unxmlify($xml->image_url);
$birthday = unxmlify($xml->birthday);
+ $location = unxmlify($xml->location);
+ $about = diaspora2bb(unxmlify($xml->bio));
$handle_parts = explode("@", $diaspora_handle);
if($name === '') {
$name = $handle_parts[0];
}
-
-
+
if( preg_match("|^https?://|", $image_url) === 0) {
$image_url = "http://" . $handle_parts[1] . $image_url;
}
require_once('include/Photo.php');
$images = import_profile_photo($image_url,$importer['uid'],$contact['id']);
-
- // Generic birthday. We don't know the timezone. The year is irrelevant.
+
+ // Generic birthday. We don't know the timezone. The year is irrelevant.
$birthday = str_replace('1000','1901',$birthday);
$birthday = $contact['bd'];
// TODO: update name on item['author-name'] if the name changed. See consume_feed()
- // Not doing this currently because D* protocol is scheduled for revision soon.
+ // Not doing this currently because D* protocol is scheduled for revision soon.
- $r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s', `avatar-date` = '%s' , `bd` = '%s' WHERE `id` = %d AND `uid` = %d",
+ $r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s', `avatar-date` = '%s' , `bd` = '%s', `location` = '%s', `about` = '%s' WHERE `id` = %d AND `uid` = %d",
dbesc($name),
dbesc(datetime_convert()),
dbesc($images[0]),
dbesc($images[2]),
dbesc(datetime_convert()),
dbesc($birthday),
+ dbesc($location),
+ dbesc($about),
intval($contact['id']),
intval($importer['uid'])
- );
+ );
/* if($r) {
if($oldphotos) {
);
create_tags_from_item($item['id']);
create_files_from_item($item['id']);
- delete_thread($item['id']);
+ delete_thread($item['id'], $item['parent-uri']);
// clean up categories and tags so they don't end up as orphans
if(count($messages))
foreach ($messages as $message)
- delete_thread($message["id"]);
+ delete_thread($message["id"], $itemuri);
}
-function delete_thread($itemid) {
- // To-Do:
- // There is no "uri" in the thread table ...
- $item = q("SELECT `uri`, `uid` FROM `thread` WHERE `iid` = %d", intval($itemid));
+function delete_thread($itemid, $itemuri = "") {
+ $item = q("SELECT `uid` FROM `thread` WHERE `iid` = %d", intval($itemid));
$result = q("DELETE FROM `thread` WHERE `iid` = %d", intval($itemid));
logger("delete_thread: Deleted thread for item ".$itemid." - ".print_r($result, true), LOGGER_DEBUG);
- if (count($item)) {
+ if ($itemuri != "") {
$r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' AND NOT (`uid` IN (%d, 0))",
- dbesc($item["uri"]),
+ dbesc($itemuri),
intval($item["uid"])
);
if (!count($r)) {
$r = q("DELETE FROM `item` WHERE `uri` = '%s' AND `uid` = 0)",
- dbesc($item["uri"])
+ dbesc($itemuri)
);
- logger("delete_thread: Deleted shadow for item ".$item["uri"]." - ".print_r($result, true), LOGGER_DEBUG);
+ logger("delete_thread: Deleted shadow for item ".$itemuri." - ".print_r($result, true), LOGGER_DEBUG);
}
}
}
// Does the local user have this item?
if (local_user()) {
- $r = q("SELECT `id`, `parent`, `author-name`, `author-link`, `author-avatar`, `network`, `body` FROM `item`
+ $r = q("SELECT `id`, `parent`, `author-name`, `author-link`, `author-avatar`, `network`, `body`, `uid` FROM `item`
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
AND `guid` = '%s' AND `uid` = %d", $a->argv[1], local_user());
if (count($r)) {
}
if (count($r)) {
if ($r[0]["id"] != $r[0]["parent"])
- $r = q("SELECT `id`, `author-name`, `author-link`, `author-avatar`, `network`, `body` FROM `item`
+ $r = q("SELECT `id`, `author-name`, `author-link`, `author-avatar`, `network`, `body`, `uid` FROM `item`
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
AND `id` = %d", $r[0]["parent"]);
$profiledata["photo"] = proxy_url($item["author-avatar"]);
$profiledata["url"] = $item["author-link"];
$profiledata["network"] = $item["network"];
+ $profiledata["address"] = "Ort".print_r($item, true);
- // Fetching profile data from unique contacts
- // To-do: Extend "unique contacts" table for further contact data like location, ...
- $r = q("SELECT `avatar`, `nick` FROM `unique_contacts` WHERE `url` = '%s'", normalise_link($profiledata["url"]));
+ // Fetching further contact data from the contact table
+ $r = q("SELECT `photo`, `nick`, `location`, `about` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d",
+ normalise_link($profiledata["url"]), $item["uid"]);
if (count($r)) {
- $profiledata["photo"] = proxy_url($r[0]["avatar"]);
+ $profiledata["photo"] = proxy_url($r[0]["photo"]);
+ $profiledata["address"] = $r[0]["location"];
+ $profiledata["about"] = $r[0]["about"];
if ($r[0]["nick"] != "")
$profiledata["nickname"] = $r[0]["nick"];
} else {
- // Is this case possible?
- // Fetching further contact data from the contact table, when it isn't available in the "unique contacts"
- $r = q("SELECT `photo`, `nick` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d",
- normalise_link($profiledata["url"]), $itemuid);
+ // Fetching profile data from unique contacts
+ $r = q("SELECT `avatar`, `nick` FROM `unique_contacts` WHERE `url` = '%s'", normalise_link($profiledata["url"]));
if (count($r)) {
- $profiledata["photo"] = proxy_url($r[0]["photo"]);
+ $profiledata["photo"] = proxy_url($r[0]["avatar"]);
if ($r[0]["nick"] != "")
$profiledata["nickname"] = $r[0]["nick"];
}
{{if $homepage}}<dl class="homepage"><dt class="homepage-label">{{$homepage}}</dt><dd class="homepage-url u-url"><a href="{{$profile.homepage}}" rel="me" target="_blank">{{$profile.homepage}}</a></dd></dl>{{/if}}
+ {{if $about}}<dl class="about"><dt class="about-label">{{$about}}</dt><dd class="x-network">{{$profile.about}}</dd></dl>{{/if}}
+
{{include file="diaspora_vcard.tpl"}}
<div id="profile-extra-links">
{{if $homepage}}<dl class="homepage"><dt class="homepage-label">{{$homepage}}</dt><dd class="homepage-url"><a href="{{$profile.homepage}}" class="u-url" rel="me" target="_blank">{{$profile.homepage}}</a></dd></dl>{{/if}}
+ {{if $about}}<dl class="about"><dt class="about-label">{{$about}}</dt><dd class="x-network">{{$profile.about}}</dd></dl>{{/if}}
+
{{include file="diaspora_vcard.tpl"}}
<div id="profile-extra-links">