lots of fixes - most recent photo updates for contacts
This commit is contained in:
parent
0bcd552231
commit
d11c1c63c0
15 changed files with 231 additions and 47 deletions
23
boot.php
23
boot.php
|
@ -177,19 +177,20 @@ function replace_macros($s,$r) {
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
if(! function_exists('load_translation_table')) {
|
||||||
function load_translation_table($lang) {
|
function load_translation_table($lang) {
|
||||||
global $a;
|
global $a;
|
||||||
|
|
||||||
}
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
if(! function_exists('t')) {
|
||||||
function t($s) {
|
function t($s) {
|
||||||
global $a;
|
global $a;
|
||||||
|
|
||||||
if($a->strings[$s])
|
if($a->strings[$s])
|
||||||
return $a->strings[$s];
|
return $a->strings[$s];
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}}
|
||||||
|
|
||||||
if(! function_exists('fetch_url')) {
|
if(! function_exists('fetch_url')) {
|
||||||
function fetch_url($url,$binary = false) {
|
function fetch_url($url,$binary = false) {
|
||||||
|
@ -423,17 +424,20 @@ function xmlify($str) {
|
||||||
return($buffer);
|
return($buffer);
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
if(! function_exists('unxmlify')) {
|
||||||
function unxmlify($s) {
|
function unxmlify($s) {
|
||||||
$ret = str_replace('&','&', $s);
|
$ret = str_replace('&','&', $s);
|
||||||
$ret = str_replace(array('<','>','"','''),array('<','>','"',"'"),$ret);
|
$ret = str_replace(array('<','>','"','''),array('<','>','"',"'"),$ret);
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}}
|
||||||
|
|
||||||
|
if(! function_exists('hex2bin')) {
|
||||||
function hex2bin($s) {
|
function hex2bin($s) {
|
||||||
return(pack("H*",$s));
|
return(pack("H*",$s));
|
||||||
}
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
if(! function_exists('paginate')) {
|
||||||
function paginate(&$a) {
|
function paginate(&$a) {
|
||||||
$o = '';
|
$o = '';
|
||||||
$stripped = ereg_replace("(&page=[0-9]*)","",$_SERVER['QUERY_STRING']);
|
$stripped = ereg_replace("(&page=[0-9]*)","",$_SERVER['QUERY_STRING']);
|
||||||
|
@ -483,8 +487,9 @@ function paginate(&$a) {
|
||||||
$o .= '</div>'."\r\n";
|
$o .= '</div>'."\r\n";
|
||||||
}
|
}
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}}
|
||||||
|
|
||||||
|
if(! function_exists('expand_acl')) {
|
||||||
function expand_acl($s) {
|
function expand_acl($s) {
|
||||||
|
|
||||||
if(strlen($s)) {
|
if(strlen($s)) {
|
||||||
|
@ -495,9 +500,9 @@ function expand_acl($s) {
|
||||||
return $a;
|
return $a;
|
||||||
}
|
}
|
||||||
return array();
|
return array();
|
||||||
}
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
if(! function_exists('sanitise_acl')) {
|
||||||
function sanitise_acl(&$item) {
|
function sanitise_acl(&$item) {
|
||||||
$item = '<' . intval(notags(trim($item))) . '>';
|
$item = '<' . intval(notags(trim($item))) . '>';
|
||||||
}
|
}}
|
||||||
|
|
|
@ -60,6 +60,9 @@ CREATE TABLE IF NOT EXISTS `contact` (
|
||||||
`ret-id` char(255) NOT NULL,
|
`ret-id` char(255) NOT NULL,
|
||||||
`ret-pubkey` text NOT NULL,
|
`ret-pubkey` text NOT NULL,
|
||||||
`last-update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
`last-update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||||
|
`name-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||||
|
`uri-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||||
|
`avatar-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||||
`priority` tinyint(3) NOT NULL,
|
`priority` tinyint(3) NOT NULL,
|
||||||
`blocked` tinyint(1) NOT NULL DEFAULT '1',
|
`blocked` tinyint(1) NOT NULL DEFAULT '1',
|
||||||
`readonly` tinyint(1) NOT NULL DEFAULT '0',
|
`readonly` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
|
|
@ -61,6 +61,7 @@ function get_feed_for(&$a,$dfrn_id,$owner_id,$last_update) {
|
||||||
|
|
||||||
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
||||||
`contact`.`name`, `contact`.`photo`, `contact`.`url`,
|
`contact`.`name`, `contact`.`photo`, `contact`.`url`,
|
||||||
|
`contact`.`name-date`, `contact`.`uri-date`, `contact`.`avatar-date`,
|
||||||
`contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
|
`contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
|
||||||
`contact`.`id` AS `contact-id`, `contact`.`uid` AS `contact-uid`
|
`contact`.`id` AS `contact-id`, `contact`.`uid` AS `contact-uid`
|
||||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||||
|
@ -91,7 +92,12 @@ function get_feed_for(&$a,$dfrn_id,$owner_id,$last_update) {
|
||||||
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , 'Y-m-d\TH:i:s\Z')) ,
|
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , 'Y-m-d\TH:i:s\Z')) ,
|
||||||
'$name' => xmlify($owner['name']),
|
'$name' => xmlify($owner['name']),
|
||||||
'$profile_page' => xmlify($owner['url']),
|
'$profile_page' => xmlify($owner['url']),
|
||||||
'$photo' => xmlify($owner['photo'])
|
'$photo' => xmlify($owner['photo']),
|
||||||
|
'$picdate' => xmlify(datetime_convert('UTC','UTC',$owner['avatar-date'] . '+00:00' , 'Y-m-d\TH:i:s\Z')) ,
|
||||||
|
'$uridate' => xmlify(datetime_convert('UTC','UTC',$owner['uri-date'] . '+00:00' , 'Y-m-d\TH:i:s\Z')) ,
|
||||||
|
'$namdate' => xmlify(datetime_convert('UTC','UTC',$owner['name-date'] . '+00:00' , 'Y-m-d\TH:i:s\Z')) ,
|
||||||
|
|
||||||
|
|
||||||
));
|
));
|
||||||
|
|
||||||
foreach($items as $item) {
|
foreach($items as $item) {
|
||||||
|
|
|
@ -123,6 +123,51 @@ echo "Length:" . strlen($xml) . "\r\n";
|
||||||
$feed->enable_order_by_date(false);
|
$feed->enable_order_by_date(false);
|
||||||
$feed->init();
|
$feed->init();
|
||||||
|
|
||||||
|
$photo_rawupdate = $feed->get_feed_tags(NAMESPACE_DFRN,'icon-updated');
|
||||||
|
if($photo_rawupdate) {
|
||||||
|
$photo_timestamp = datetime_convert('UTC','UTC',$photo_rawupdate[0]['data']);
|
||||||
|
$photo_url = $feed->get_image_url();
|
||||||
|
if(strlen($photo_url) && $photo_timestamp > $contact['avatar-date']) {
|
||||||
|
|
||||||
|
require_once("Photo.php");
|
||||||
|
|
||||||
|
$photo_failure = false;
|
||||||
|
|
||||||
|
$r = q("SELECT `resource-id` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d LIMIT 1",
|
||||||
|
intval($contact['id']),
|
||||||
|
intval($contact['uid'])
|
||||||
|
);
|
||||||
|
if(count($r)) {
|
||||||
|
$resource_id = $r[0]['resource-id'];
|
||||||
|
$img_str = fetch_url($photo_url,true);
|
||||||
|
$img = new Photo($img_str);
|
||||||
|
if($img) {
|
||||||
|
q("DELETE FROM `photo` WHERE `resource-id` = '%s' AND contact-id` = %d AND `uid` = %d",
|
||||||
|
dbesc($resource_id),
|
||||||
|
intval($contact['id']),
|
||||||
|
intval($contact['uid'])
|
||||||
|
);
|
||||||
|
|
||||||
|
$img->scaleImageSquare(175);
|
||||||
|
|
||||||
|
$hash = $resource_id;
|
||||||
|
|
||||||
|
$r = $img->store($contact['uid'], $contact['id'], $hash, basename($photo_url), t('Contact Photos') , 4);
|
||||||
|
|
||||||
|
$img->scaleImage(80);
|
||||||
|
$r = $img->store($contact['uid'], $contact['id'], $hash, basename($photo_url), t('Contact Photos') , 5);
|
||||||
|
if($r)
|
||||||
|
q("UPDATE `contact` SET `avatar-date` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1",
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
intval($contact['uid']),
|
||||||
|
intval($contact['id'])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach($feed->get_items() as $item) {
|
foreach($feed->get_items() as $item) {
|
||||||
|
|
||||||
$deleted = false;
|
$deleted = false;
|
||||||
|
@ -145,14 +190,16 @@ echo "Length:" . strlen($xml) . "\r\n";
|
||||||
);
|
);
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
if($r[0]['uri'] == $r[0]['parent-uri']) {
|
if($r[0]['uri'] == $r[0]['parent-uri']) {
|
||||||
$r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s'
|
$r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s',
|
||||||
|
`body` = '', `title` = ''
|
||||||
WHERE `parent-uri` = '%s'",
|
WHERE `parent-uri` = '%s'",
|
||||||
dbesc($when),
|
dbesc($when),
|
||||||
dbesc($r[0]['uri'])
|
dbesc($r[0]['uri'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s'
|
$r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s',
|
||||||
|
`body` = '', `title` = ''
|
||||||
WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
|
WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
dbesc($when),
|
dbesc($when),
|
||||||
dbesc($uri),
|
dbesc($uri),
|
||||||
|
|
|
@ -36,6 +36,7 @@ if(strlen($a->module)) {
|
||||||
$a->module_loaded = true;
|
$a->module_loaded = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found'));
|
||||||
notice( t('Page not found' ) . EOL);
|
notice( t('Page not found' ) . EOL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,6 +89,11 @@ if(x($_SESSION,'sysmsg')) {
|
||||||
unset($_SESSION['sysmsg']);
|
unset($_SESSION['sysmsg']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(stristr($_SESSION['sysmsg'], t('Permission denied'))) {
|
||||||
|
header($_SERVER["SERVER_PROTOCOL"] . ' 403 ' . t('Permission denied.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Feel free to comment out this line on production sites.
|
// Feel free to comment out this line on production sites.
|
||||||
$a->page['content'] .= $debug_text;
|
$a->page['content'] .= $debug_text;
|
||||||
|
|
||||||
|
|
|
@ -116,9 +116,12 @@ function dfrn_confirm_post(&$a) {
|
||||||
$thumb = $a->get_baseurl() . '/images/default-profile-sm.jpg';
|
$thumb = $a->get_baseurl() . '/images/default-profile-sm.jpg';
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `blocked` = 0, `pending` = 0 WHERE `id` = %d LIMIT 1",
|
$r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `name-date` = '%s', `uri-date` = '%s', `avatar-date` = '%s', `blocked` = 0, `pending` = 0 WHERE `id` = %d LIMIT 1",
|
||||||
dbesc($photo),
|
dbesc($photo),
|
||||||
dbesc($thumb),
|
dbesc($thumb),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
intval($dfrn_record)
|
intval($dfrn_record)
|
||||||
);
|
);
|
||||||
if($r === false)
|
if($r === false)
|
||||||
|
@ -322,9 +325,12 @@ function dfrn_confirm_post(&$a) {
|
||||||
$thumb = $a->get_baseurl() . '/images/default-profile-sm.jpg';
|
$thumb = $a->get_baseurl() . '/images/default-profile-sm.jpg';
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `blocked` = 0, `pending` = 0 WHERE `id` = %d LIMIT 1",
|
$r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `name-date` = '%s', `uri-date` = '%s', `avatar-date` = '%s', `blocked` = 0, `pending` = 0 WHERE `id` = %d LIMIT 1",
|
||||||
dbesc($photo),
|
dbesc($photo),
|
||||||
dbesc($thumb),
|
dbesc($thumb),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
intval($contact_id)
|
intval($contact_id)
|
||||||
);
|
);
|
||||||
if($r === false)
|
if($r === false)
|
||||||
|
|
|
@ -47,6 +47,9 @@ function dfrn_notify_post(&$a) {
|
||||||
$feed->init();
|
$feed->init();
|
||||||
|
|
||||||
$ismail = false;
|
$ismail = false;
|
||||||
|
$photo_time = $feed->get_feed_tags( NAMESPACE_DFRN, 'icon-updated');
|
||||||
|
if($photo_time)
|
||||||
|
$avatar_update = $photo_time[0]['data'];
|
||||||
|
|
||||||
$rawmail = $feed->get_feed_tags( NAMESPACE_DFRN, 'mail' );
|
$rawmail = $feed->get_feed_tags( NAMESPACE_DFRN, 'mail' );
|
||||||
if(isset($rawmail[0]['child'][NAMESPACE_DFRN])) {
|
if(isset($rawmail[0]['child'][NAMESPACE_DFRN])) {
|
||||||
|
@ -57,7 +60,7 @@ function dfrn_notify_post(&$a) {
|
||||||
$msg['uid'] = $importer['uid'];
|
$msg['uid'] = $importer['uid'];
|
||||||
$msg['from-name'] = notags(unxmlify($base['sender'][0]['child'][NAMESPACE_DFRN]['name'][0]['data']));
|
$msg['from-name'] = notags(unxmlify($base['sender'][0]['child'][NAMESPACE_DFRN]['name'][0]['data']));
|
||||||
$msg['from-photo'] = notags(unxmlify($base['sender'][0]['child'][NAMESPACE_DFRN]['avatar'][0]['data']));
|
$msg['from-photo'] = notags(unxmlify($base['sender'][0]['child'][NAMESPACE_DFRN]['avatar'][0]['data']));
|
||||||
$msg['from-url'] = notags(unxmlify($base['sender'][0]['child'][NAMESPACE_DFRN]['avatar'][0]['data']));
|
$msg['from-url'] = notags(unxmlify($base['sender'][0]['child'][NAMESPACE_DFRN]['uri'][0]['data']));
|
||||||
$msg['contact-id'] = $importer['id'];
|
$msg['contact-id'] = $importer['id'];
|
||||||
$msg['title'] = notags(unxmlify($base['subject'][0]['data']));
|
$msg['title'] = notags(unxmlify($base['subject'][0]['data']));
|
||||||
$msg['body'] = escape_tags(unxmlify($base['content'][0]['data']));
|
$msg['body'] = escape_tags(unxmlify($base['content'][0]['data']));
|
||||||
|
|
|
@ -375,7 +375,7 @@ function photos_post(&$a) {
|
||||||
$dups = false;
|
$dups = false;
|
||||||
$item_hash = random_string();
|
$item_hash = random_string();
|
||||||
|
|
||||||
$uri = "urn:X-dfrn:" . $a->get_hostname() . ':' . $profile_uid . ':' . $item_hash;
|
$uri = "urn:X-dfrn:" . $a->get_hostname() . ':' . $_SESSION['uid'] . ':' . $item_hash;
|
||||||
|
|
||||||
$r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1",
|
$r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1",
|
||||||
dbesc($uri));
|
dbesc($uri));
|
||||||
|
|
|
@ -74,6 +74,11 @@ function profile_photo_post(&$a) {
|
||||||
intval($_SESSION['uid'])
|
intval($_SESSION['uid'])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$r = q("UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
intval($_SESSION['uid'])
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
goaway($a->get_baseurl() . '/profiles');
|
goaway($a->get_baseurl() . '/profiles');
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
|
|
|
@ -7,16 +7,19 @@ function profiles_post(&$a) {
|
||||||
notice( "Permission denied." . EOL);
|
notice( "Permission denied." . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$namechanged = false;
|
||||||
|
|
||||||
if(($a->argc > 1) && ($a->argv[1] != "new") && intval($a->argv[1])) {
|
if(($a->argc > 1) && ($a->argv[1] != "new") && intval($a->argv[1])) {
|
||||||
$r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($a->argv[1]),
|
intval($a->argv[1]),
|
||||||
intval($_SESSION['uid'])
|
intval($_SESSION['uid'])
|
||||||
);
|
);
|
||||||
if(! count($r)) {
|
if(! count($orig)) {
|
||||||
$_SESSION['sysmsg'] .= "Profile not found." . EOL;
|
$_SESSION['sysmsg'] .= "Profile not found." . EOL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$is_default = (($r[0]['is-default']) ? 1 : 0);
|
$is_default = (($orig[0]['is-default']) ? 1 : 0);
|
||||||
|
|
||||||
$profile_name = notags(trim($_POST['profile_name']));
|
$profile_name = notags(trim($_POST['profile_name']));
|
||||||
if(! strlen($profile_name)) {
|
if(! strlen($profile_name)) {
|
||||||
|
@ -39,6 +42,10 @@ function profiles_post(&$a) {
|
||||||
|
|
||||||
|
|
||||||
$name = notags(trim($_POST['name']));
|
$name = notags(trim($_POST['name']));
|
||||||
|
|
||||||
|
if($orig[0]['name'] != $name)
|
||||||
|
$namechanged = true;
|
||||||
|
|
||||||
$gender = notags(trim($_POST['gender']));
|
$gender = notags(trim($_POST['gender']));
|
||||||
$address = notags(trim($_POST['address']));
|
$address = notags(trim($_POST['address']));
|
||||||
$locality = notags(trim($_POST['locality']));
|
$locality = notags(trim($_POST['locality']));
|
||||||
|
@ -132,7 +139,12 @@ function profiles_post(&$a) {
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if($namechanged && $is_default) {
|
||||||
|
$r = q("UPDATE `contact` SET `name-date` = '%s' WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
intval($_SESSION['uid'])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,8 +138,8 @@ function register_post(&$a) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$r = q("INSERT INTO `contact` ( `uid`, `created`, `self`, `name`, `photo`, `thumb`, `blocked`, `pending`, `url`,
|
$r = q("INSERT INTO `contact` ( `uid`, `created`, `self`, `name`, `photo`, `thumb`, `blocked`, `pending`, `url`,
|
||||||
`request`, `notify`, `poll`, `confirm` )
|
`request`, `notify`, `poll`, `confirm`, `name-date`, `uri-date`, `avatar-date` )
|
||||||
VALUES ( %d, '%s', 1, '%s', '%s', '%s', 0, 0, '%s', '%s', '%s', '%s', '%s' ) ",
|
VALUES ( %d, '%s', 1, '%s', '%s', '%s', 0, 0, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
|
||||||
intval($newuid),
|
intval($newuid),
|
||||||
datetime_convert(),
|
datetime_convert(),
|
||||||
dbesc($username),
|
dbesc($username),
|
||||||
|
@ -149,8 +149,10 @@ function register_post(&$a) {
|
||||||
dbesc($a->get_baseurl() . "/dfrn_request/$nickname"),
|
dbesc($a->get_baseurl() . "/dfrn_request/$nickname"),
|
||||||
dbesc($a->get_baseurl() . "/dfrn_notify/$nickname"),
|
dbesc($a->get_baseurl() . "/dfrn_notify/$nickname"),
|
||||||
dbesc($a->get_baseurl() . "/dfrn_poll/$nickname"),
|
dbesc($a->get_baseurl() . "/dfrn_poll/$nickname"),
|
||||||
dbesc($a->get_baseurl() . "/dfrn_confirm/$nickname")
|
dbesc($a->get_baseurl() . "/dfrn_confirm/$nickname"),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc(datetime_convert())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2432,6 +2432,10 @@ class SimplePie
|
||||||
$uri = null;
|
$uri = null;
|
||||||
$email = null;
|
$email = null;
|
||||||
$avatar = null;
|
$avatar = null;
|
||||||
|
$name_date = null;
|
||||||
|
$uri_date = null;
|
||||||
|
$avatar_date = null;
|
||||||
|
|
||||||
if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
|
if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
|
||||||
{
|
{
|
||||||
$name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
|
$name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
|
||||||
|
@ -2446,11 +2450,24 @@ class SimplePie
|
||||||
}
|
}
|
||||||
if (isset($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]['data']))
|
if (isset($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]['data']))
|
||||||
{
|
{
|
||||||
$avatar = $this->sanitize($$author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]));
|
$avatar = $this->sanitize($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]));
|
||||||
}
|
}
|
||||||
if ($name !== null || $email !== null || $uri !== null || $avatar !== null)
|
if (isset($author['child']['http://purl.org/macgirvin/dfrn/1.0']['name-updated'][0]['data']))
|
||||||
{
|
{
|
||||||
$authors[] = new $this->author_class($name, $uri, $email, $avatar);
|
$name_date = $author['child']['http://purl.org/macgirvin/dfrn/1.0']['name-updated'][0]['data'];
|
||||||
|
}
|
||||||
|
if (isset($author['child']['http://purl.org/macgirvin/dfrn/1.0']['uri-updated'][0]['data']))
|
||||||
|
{
|
||||||
|
$uri_date = $author['child']['http://purl.org/macgirvin/dfrn/1.0']['uri-updated'][0]['data'];
|
||||||
|
}
|
||||||
|
if (isset($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar-updated'][0]['data']))
|
||||||
|
{
|
||||||
|
$avatar_date = $author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar-updated'][0]['data'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($name !== null || $email !== null || $uri !== null || $avatar !== null || $name_date !== null || $uri_date !== null || $avatar_date !== null )
|
||||||
|
{
|
||||||
|
$authors[] = new $this->author_class($name, $uri, $email, $avatar, $name_date, $uri_date, $avatar_date);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($author = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
|
if ($author = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
|
||||||
|
@ -3481,6 +3498,9 @@ class SimplePie_Item
|
||||||
$uri = null;
|
$uri = null;
|
||||||
$email = null;
|
$email = null;
|
||||||
$avatar = null;
|
$avatar = null;
|
||||||
|
$name_date = null;
|
||||||
|
$uri_date = null;
|
||||||
|
$avatar_date = null;
|
||||||
if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
|
if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
|
||||||
{
|
{
|
||||||
$name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
|
$name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
|
||||||
|
@ -3497,10 +3517,22 @@ class SimplePie_Item
|
||||||
{
|
{
|
||||||
$avatar = $this->sanitize($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]));
|
$avatar = $this->sanitize($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]));
|
||||||
}
|
}
|
||||||
if ($name !== null || $email !== null || $uri !== null || $avatar !== null)
|
if (isset($author['child']['http://purl.org/macgirvin/dfrn/1.0']['name-updated'][0]['data']))
|
||||||
{
|
{
|
||||||
$authors[] = new $this->feed->author_class($name, $uri, $email, $avatar);
|
$name_date = $author['child']['http://purl.org/macgirvin/dfrn/1.0']['name-updated'][0]['data'];
|
||||||
|
}
|
||||||
|
if (isset($author['child']['http://purl.org/macgirvin/dfrn/1.0']['uri-updated'][0]['data']))
|
||||||
|
{
|
||||||
|
$uri_date = $author['child']['http://purl.org/macgirvin/dfrn/1.0']['uri-updated'][0]['data'];
|
||||||
|
}
|
||||||
|
if (isset($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar-updated'][0]['data']))
|
||||||
|
{
|
||||||
|
$avatar_date = $author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar-updated'][0]['data'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($name !== null || $email !== null || $uri !== null || $avatar !== null || $name_date !== null || $uri_date !== null || $avatar_date !== null )
|
||||||
|
{
|
||||||
|
$authors[] = new $this->feed->author_class($name, $uri, $email, $avatar, $name_date, $uri_date, $avatar_date);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
|
if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
|
||||||
|
@ -5909,6 +5941,10 @@ class SimplePie_Source
|
||||||
$uri = null;
|
$uri = null;
|
||||||
$email = null;
|
$email = null;
|
||||||
$avatar = null;
|
$avatar = null;
|
||||||
|
$name_date = null;
|
||||||
|
$uri_date = null;
|
||||||
|
$avatar_date = null;
|
||||||
|
|
||||||
if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
|
if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
|
||||||
{
|
{
|
||||||
$name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
|
$name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
|
||||||
|
@ -5921,13 +5957,26 @@ class SimplePie_Source
|
||||||
{
|
{
|
||||||
$email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
|
$email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
|
||||||
}
|
}
|
||||||
|
if (isset($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]['data']))
|
||||||
{
|
{
|
||||||
$avatar = $this->sanitize($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]));
|
$avatar = $this->sanitize($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]));
|
||||||
}
|
}
|
||||||
if ($name !== null || $email !== null || $uri !== null || $avatar !== null)
|
if (isset($author['child']['http://purl.org/macgirvin/dfrn/1.0']['name-updated'][0]['data']))
|
||||||
{
|
{
|
||||||
$authors[] = new $this->item->feed->author_class($name, $uri, $email, $avatar);
|
$name_date = $author['child']['http://purl.org/macgirvin/dfrn/1.0']['name-updated'][0]['data'];
|
||||||
|
}
|
||||||
|
if (isset($author['child']['http://purl.org/macgirvin/dfrn/1.0']['uri-updated'][0]['data']))
|
||||||
|
{
|
||||||
|
$uri_date = $author['child']['http://purl.org/macgirvin/dfrn/1.0']['uri-updated'][0]['data'];
|
||||||
|
}
|
||||||
|
if (isset($author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar-updated'][0]['data']))
|
||||||
|
{
|
||||||
|
$avatar_date = $author['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar-updated'][0]['data'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($name !== null || $email !== null || $uri !== null || $avatar !== null || $name_date !== null || $uri_date !== null || $avatar_date !== null )
|
||||||
|
{
|
||||||
|
$authors[] = new $this->item->feed->author_class($name, $uri, $email, $avatar, $name_date, $uri_date, $avatar_date);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($author = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
|
if ($author = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
|
||||||
|
@ -6300,14 +6349,20 @@ class SimplePie_Author
|
||||||
var $link;
|
var $link;
|
||||||
var $email;
|
var $email;
|
||||||
var $avatar;
|
var $avatar;
|
||||||
|
var $name_date;
|
||||||
|
var $uri_date;
|
||||||
|
var $avatar_date;
|
||||||
|
|
||||||
// Constructor, used to input the data
|
// Constructor, used to input the data
|
||||||
function SimplePie_Author($name = null, $link = null, $email = null, $avatar = null)
|
function SimplePie_Author($name = null, $link = null, $email = null, $avatar = null, $name_date = null, $uri_date = null, $avatar_date = null)
|
||||||
{
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
$this->link = $link;
|
$this->link = $link;
|
||||||
$this->email = $email;
|
$this->email = $email;
|
||||||
$this->avatar = $avatar;
|
$this->avatar = $avatar;
|
||||||
|
$this->name_date = $name_date;
|
||||||
|
$this->uri_date = $uri_date;
|
||||||
|
$this->avatar_date = $avatar_date;
|
||||||
}
|
}
|
||||||
|
|
||||||
function __toString()
|
function __toString()
|
||||||
|
@ -6364,6 +6419,40 @@ class SimplePie_Author
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_name_date()
|
||||||
|
{
|
||||||
|
if ($this->name_date !== null)
|
||||||
|
{
|
||||||
|
return $this->name_date;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function get_uri_date()
|
||||||
|
{
|
||||||
|
if ($this->uri_date !== null)
|
||||||
|
{
|
||||||
|
return $this->uri_date;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function get_avatar_date()
|
||||||
|
{
|
||||||
|
if ($this->avatar_date !== null)
|
||||||
|
{
|
||||||
|
return $this->avatar_date;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
<id>$feed_id</id>
|
<id>$feed_id</id>
|
||||||
<title>$feed_title</title>
|
<title>$feed_title</title>
|
||||||
<icon>$photo</icon>
|
<icon>$photo</icon>
|
||||||
<dfrn:icon-updated>0000-00-00T00:00:00Z</dfrn:icon-updated>
|
<dfrn:icon-updated>$picdate</dfrn:icon-updated>
|
||||||
<updated>$feed_updated</updated>
|
<updated>$feed_updated</updated>
|
||||||
|
|
||||||
<author>
|
<author>
|
||||||
<name>$name</name>
|
<name>$name</name>
|
||||||
<dfrn:name-updated>0000-00-00T00:00:00Z</dfrn:name-updated>
|
<dfrn:name-updated>$namdate</dfrn:name-updated>
|
||||||
<uri>$profile_page</uri>
|
<uri>$profile_page</uri>
|
||||||
<dfrn:uri-updated>0000-00-00T00:00:00Z</dfrn:uri-updated>
|
<dfrn:uri-updated>$uridate</dfrn:uri-updated>
|
||||||
<dfrn:avatar>$thumb</dfrn:avatar>
|
<dfrn:avatar>$thumb</dfrn:avatar>
|
||||||
<dfrn:avatar-updated>0000-00-00T00:00:00Z</dfrn:avatar-updated>
|
<dfrn:avatar-updated>$picdate</dfrn:avatar-updated>
|
||||||
</author>
|
</author>
|
||||||
|
|
|
@ -60,7 +60,7 @@ EOT;
|
||||||
if($a->profile['marital']) {
|
if($a->profile['marital']) {
|
||||||
$o .= <<< EOT
|
$o .= <<< EOT
|
||||||
<div id="advanced-profile-marital-wrapper" >
|
<div id="advanced-profile-marital-wrapper" >
|
||||||
<div id="advanced-profile-marital-text">Status:</div>
|
<div id="advanced-profile-marital-text"><span class="heart">♥</span> Status:</div>
|
||||||
<div id="advanced-profile-marital">{$a->profile['marital']}</div>
|
<div id="advanced-profile-marital">{$a->profile['marital']}</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="advanced-profile-marital-end"></div>
|
<div id="advanced-profile-marital-end"></div>
|
||||||
|
@ -90,7 +90,7 @@ EOT;
|
||||||
if($a->profile['politic']) {
|
if($a->profile['politic']) {
|
||||||
$o .= <<< EOT
|
$o .= <<< EOT
|
||||||
<div id="advanced-profile-politic-wrapper" >
|
<div id="advanced-profile-politic-wrapper" >
|
||||||
<div id="advanced-profile-politic-text">Political Leaning:</div>
|
<div id="advanced-profile-politic-text">Political Views:</div>
|
||||||
<div id="advanced-profile-politic">{$a->profile['politic']}</div>
|
<div id="advanced-profile-politic">{$a->profile['politic']}</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="advanced-profile-politic-end"></div>
|
<div id="advanced-profile-politic-end"></div>
|
||||||
|
@ -121,7 +121,7 @@ EOT;
|
||||||
if($txt = bbcode($a->profile['interest'])) {
|
if($txt = bbcode($a->profile['interest'])) {
|
||||||
$o .= <<< EOT
|
$o .= <<< EOT
|
||||||
<div id="advanced-profile-interest-wrapper" >
|
<div id="advanced-profile-interest-wrapper" >
|
||||||
<div id="advanced-profile-interest-text">Interests/Hobbies:</div>
|
<div id="advanced-profile-interest-text">Hobbies/Interests:</div>
|
||||||
<br />
|
<br />
|
||||||
<div id="advanced-profile-interest">$txt</div>
|
<div id="advanced-profile-interest">$txt</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -132,7 +132,7 @@ EOT;
|
||||||
if($txt = bbcode($a->profile['contact'])) {
|
if($txt = bbcode($a->profile['contact'])) {
|
||||||
$o .= <<< EOT
|
$o .= <<< EOT
|
||||||
<div id="advanced-profile-contact-wrapper" >
|
<div id="advanced-profile-contact-wrapper" >
|
||||||
<div id="advanced-profile-contact-text">Contact:</div>
|
<div id="advanced-profile-contact-text">Contact information and Social Networks:</div>
|
||||||
<br />
|
<br />
|
||||||
<div id="advanced-profile-contact">$txt</div>
|
<div id="advanced-profile-contact">$txt</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -143,7 +143,7 @@ EOT;
|
||||||
if($txt = bbcode($a->profile['music'])) {
|
if($txt = bbcode($a->profile['music'])) {
|
||||||
$o .= <<< EOT
|
$o .= <<< EOT
|
||||||
<div id="advanced-profile-music-wrapper" >
|
<div id="advanced-profile-music-wrapper" >
|
||||||
<div id="advanced-profile-music-text">Music:</div>
|
<div id="advanced-profile-music-text">Musical interests:</div>
|
||||||
<br />
|
<br />
|
||||||
<div id="advanced-profile-music">$txt</div>
|
<div id="advanced-profile-music">$txt</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -154,7 +154,7 @@ EOT;
|
||||||
if($txt = bbcode($a->profile['book'])) {
|
if($txt = bbcode($a->profile['book'])) {
|
||||||
$o .= <<< EOT
|
$o .= <<< EOT
|
||||||
<div id="advanced-profile-book-wrapper" >
|
<div id="advanced-profile-book-wrapper" >
|
||||||
<div id="advanced-profile-book-text">Books:</div>
|
<div id="advanced-profile-book-text">Books, literature:</div>
|
||||||
<br />
|
<br />
|
||||||
<div id="advanced-profile-book">$txt</div>
|
<div id="advanced-profile-book">$txt</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -176,7 +176,7 @@ EOT;
|
||||||
if($txt = bbcode($a->profile['film'])) {
|
if($txt = bbcode($a->profile['film'])) {
|
||||||
$o .= <<< EOT
|
$o .= <<< EOT
|
||||||
<div id="advanced-profile-film-wrapper" >
|
<div id="advanced-profile-film-wrapper" >
|
||||||
<div id="advanced-profile-film-text">Film:</div>
|
<div id="advanced-profile-film-text">Film/dance/culture/entertainment:</div>
|
||||||
<br />
|
<br />
|
||||||
<div id="advanced-profile-film">$txt</div>
|
<div id="advanced-profile-film">$txt</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -187,7 +187,7 @@ EOT;
|
||||||
if($txt = bbcode($a->profile['romance'])) {
|
if($txt = bbcode($a->profile['romance'])) {
|
||||||
$o .= <<< EOT
|
$o .= <<< EOT
|
||||||
<div id="advanced-profile-romance-wrapper" >
|
<div id="advanced-profile-romance-wrapper" >
|
||||||
<div id="advanced-profile-romance-text">Romance:</div>
|
<div id="advanced-profile-romance-text">Love/romance:</div>
|
||||||
<br />
|
<br />
|
||||||
<div id="advanced-profile-romance">$txt</div>
|
<div id="advanced-profile-romance">$txt</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -198,7 +198,7 @@ EOT;
|
||||||
if($txt = bbcode($a->profile['work'])) {
|
if($txt = bbcode($a->profile['work'])) {
|
||||||
$o .= <<< EOT
|
$o .= <<< EOT
|
||||||
<div id="advanced-profile-work-wrapper" >
|
<div id="advanced-profile-work-wrapper" >
|
||||||
<div id="advanced-profile-work-text">work:</div>
|
<div id="advanced-profile-work-text">Work/employment:</div>
|
||||||
<br />
|
<br />
|
||||||
<div id="advanced-profile-work">$txt</div>
|
<div id="advanced-profile-work">$txt</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -209,7 +209,7 @@ EOT;
|
||||||
if($txt = bbcode($a->profile['education'])) {
|
if($txt = bbcode($a->profile['education'])) {
|
||||||
$o .= <<< EOT
|
$o .= <<< EOT
|
||||||
<div id="advanced-profile-education-wrapper" >
|
<div id="advanced-profile-education-wrapper" >
|
||||||
<div id="advanced-profile-education-text">Education:</div>
|
<div id="advanced-profile-education-text">School/education:</div>
|
||||||
<br />
|
<br />
|
||||||
<div id="advanced-profile-education">$txt</div>
|
<div id="advanced-profile-education">$txt</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -832,7 +832,7 @@ input#dfrn-url {
|
||||||
#advanced-profile-romance-text,
|
#advanced-profile-romance-text,
|
||||||
#advanced-profile-work-text,
|
#advanced-profile-work-text,
|
||||||
#advanced-profile-education-text {
|
#advanced-profile-education-text {
|
||||||
width: 250px;
|
width: 300px;
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue