Beispiel #1
0
    public function summary($value)
    {
        $this->params[] = array('name' => 'summary', 'value' => $value, 'attributes' => array('type' => 'html'), 'cdata' => true);
    }
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
$contents2 = dbSortedContents(array());
extract($contents2[0]);
global $blog;
//
$atom = new AtomFeed(array('xml:lang' => 'ja'));
$atom->title($blog);
$atom->link("{$_SERVER['SCRIPT_NAME']}");
$atom->link("{$_SERVER['REQUEST_URI']}", 'self');
$atom->id("{$_SERVER['SCRIPT_NAME']}/feed");
$atom->updated($moddate);
$atom->author(array('name' => 'nyankoPress'));
$cnt = 0;
foreach ($contents2 as $value) {
    extract($value);
    $entry = new AtomEntry();
    $entry->title($title);
    $entry->link("{$_SERVER['SCRIPT_NAME']}?p={$page}");
    $entry->id("{$_SERVER['SCRIPT_NAME']}/p{$page}");
    $entry->summary(mb_strimwidth(strip_tags($contents), 0, 80, '…', 'utf-8'));
    $entry->updated($moddate);
    $entry->author(array('name' => $author));
    $atom->addEntry($entry);
    $cnt++;
    if ($cnt >= 10) {
        break;