X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FUser_group.php;h=310ecff1ef766726197eaa06457b6a3c5cfcc405;hb=38409f1683351ae2b9bc932d441c6021a8b2aae7;hp=e6e79ca6a3daa066c7e253d2124bea8a86d64917;hpb=92ef4895b40498d97150a40b2f24fe9604e4c944;p=quix0rs-gnu-social.git diff --git a/classes/User_group.php b/classes/User_group.php index e6e79ca6a3..310ecff1ef 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -313,4 +313,45 @@ class User_group extends Memcached_DataObject $desclimit = self::maxDescription(); return ($desclimit > 0 && !empty($desc) && (mb_strlen($desc) > $desclimit)); } + + function asAtomEntry($namespace=false, $source=false) + { + $xs = new XMLStringer(true); + + if ($namespace) { + $attrs = array('xmlns' => 'http://www.w3.org/2005/Atom', + 'xmlns:thr' => 'http://purl.org/syndication/thread/1.0'); + } else { + $attrs = array(); + } + + $xs->elementStart('entry', $attrs); + + if ($source) { + $xs->elementStart('source'); + $xs->element('title', null, $profile->nickname . " - " . common_config('site', 'name')); + $xs->element('link', array('href' => $this->permalink())); + } + + if ($source) { + $xs->elementEnd('source'); + } + + $xs->element('title', null, $this->nickname); + $xs->element('summary', null, $this->description); + + $xs->element('link', array('rel' => 'alternate', + 'href' => $this->permalink())); + + $xs->element('id', null, $this->permalink()); + + $xs->element('published', null, common_date_w3dtf($this->created)); + $xs->element('updated', null, common_date_w3dtf($this->modified)); + + $xs->element('content', array('type' => 'html'), $this->description); + + $xs->elementEnd('entry'); + + return $xs->getString(); + } }