Include source client's related URL (if any) in source attribution for
Atom notice feeds
This commit is contained in:
parent
a6ce4eef0d
commit
105c1a22d6
@ -1238,9 +1238,25 @@ class Notice extends Memcached_DataObject
|
|||||||
$xs->element('published', null, common_date_w3dtf($this->created));
|
$xs->element('published', null, common_date_w3dtf($this->created));
|
||||||
$xs->element('updated', null, common_date_w3dtf($this->created));
|
$xs->element('updated', null, common_date_w3dtf($this->created));
|
||||||
|
|
||||||
|
$source = null;
|
||||||
|
|
||||||
|
$ns = $this->getSource();
|
||||||
|
|
||||||
|
if ($ns) {
|
||||||
|
if (!empty($ns->name) && !empty($ns->url)) {
|
||||||
|
$source = '<a href="'
|
||||||
|
. htmlspecialchars($ns->url)
|
||||||
|
. '" rel="nofollow">'
|
||||||
|
. htmlspecialchars($ns->name)
|
||||||
|
. '</a>';
|
||||||
|
} else {
|
||||||
|
$source = $ns->code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$noticeInfoAttr = array(
|
$noticeInfoAttr = array(
|
||||||
'local_id' => $this->id, // local notice ID (useful to clients for ordering)
|
'local_id' => $this->id, // local notice ID (useful to clients for ordering)
|
||||||
'source' => $this->source, // the client name (source attribution)
|
'source' => $source, // the client name (source attribution)
|
||||||
);
|
);
|
||||||
|
|
||||||
$ns = $this->getSource();
|
$ns = $this->getSource();
|
||||||
@ -1252,8 +1268,8 @@ class Notice extends Memcached_DataObject
|
|||||||
|
|
||||||
if (!empty($cur)) {
|
if (!empty($cur)) {
|
||||||
$noticeInfoAttr['favorite'] = ($cur->hasFave($this)) ? "true" : "false";
|
$noticeInfoAttr['favorite'] = ($cur->hasFave($this)) ? "true" : "false";
|
||||||
$profile = $cur->getProfile();
|
$profile = $cur->getProfile();
|
||||||
$noticeInfoAttr['repeated'] = ($profile->hasRepeated($this->id)) ? "true" : "false";
|
$noticeInfoAttr['repeated'] = ($profile->hasRepeated($this->id)) ? "true" : "false";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($this->repeat_of)) {
|
if (!empty($this->repeat_of)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user