better handling of feed photos (e,g, google+)
This commit is contained in:
parent
d7154a4606
commit
8992c27fa6
1 changed files with 16 additions and 0 deletions
|
@ -467,6 +467,14 @@ function probe_url($url) {
|
||||||
if(strpos($vcard['fn'],'@') !== false)
|
if(strpos($vcard['fn'],'@') !== false)
|
||||||
$vcard['fn'] = substr($vcard['fn'],0,strpos($vcard['fn'],'@'));
|
$vcard['fn'] = substr($vcard['fn'],0,strpos($vcard['fn'],'@'));
|
||||||
$email = unxmlify($author->get_email());
|
$email = unxmlify($author->get_email());
|
||||||
|
if(! $vcard['photo']) {
|
||||||
|
$rawtags = $feed->get_feed_tags( SIMPLEPIE_NAMESPACE_ATOM_10, 'author');
|
||||||
|
if($rawtags) {
|
||||||
|
$elems = $rawtags[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10];
|
||||||
|
if((x($elems,'link')) && ($elems['link'][0]['attribs']['']['rel'] === 'photo'))
|
||||||
|
$vcard['photo'] = $elems['link'][0]['attribs']['']['href'];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$item = $feed->get_item(0);
|
$item = $feed->get_item(0);
|
||||||
|
@ -485,6 +493,14 @@ function probe_url($url) {
|
||||||
if($rawmedia && $rawmedia[0]['attribs']['']['url'])
|
if($rawmedia && $rawmedia[0]['attribs']['']['url'])
|
||||||
$vcard['photo'] = unxmlify($rawmedia[0]['attribs']['']['url']);
|
$vcard['photo'] = unxmlify($rawmedia[0]['attribs']['']['url']);
|
||||||
}
|
}
|
||||||
|
if(! $vcard['photo']) {
|
||||||
|
$rawtags = $item->get_feed_tags( SIMPLEPIE_NAMESPACE_ATOM_10, 'author');
|
||||||
|
if($rawtags) {
|
||||||
|
$elems = $rawtags[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10];
|
||||||
|
if((x($elems,'link')) && ($elems['link'][0]['attribs']['']['rel'] === 'photo'))
|
||||||
|
$vcard['photo'] = $elems['link'][0]['attribs']['']['href'];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if((! $vcard['photo']) && strlen($email))
|
if((! $vcard['photo']) && strlen($email))
|
||||||
|
|
Loading…
Reference in a new issue