Free "body" name to represent all contents as implied, instead of the more
appropriately named main "story" part until the first separator.
return showdate($this->dateparts);
}
- function body()
+ function story()
{
$this->title;
$rest = fread($this->file, filesize($this->page));
if ( preg_match('{
\n (?: < (?: p | figure [^>]* ) >\s* )+ (<img\ [^>]*>) | \n <hr\ />
}x', $rest, $img, PREG_OFFSET_CAPTURE) ) {
+ # strip part after matching divider (image)
if (isset($img[1])) {
$this->img = $img[1][0];
}
function teaser()
{
- if (preg_match('{<p>(.*?)</p>}s', $this->body, $bodyp)) {
+ if (preg_match('{<p>(.*?)</p>}s', $this->story, $bodyp)) {
return $bodyp[1];
}
}
function img()
{
$this->img = NULL;
- $this->body;
+ $this->story;
return $this->img;
}
'<h3><a href="/%s">%s <small class="date">%s</small></a></h3>',
$article->link, $article->title, $article->date
);
- print $article->body;
+ print $article->story;
print '</div>';
print "</article>\n\n";
<title><?= $article->title ?></title>
<published><?= $article->dateiso ?></published>
<updated><?= $article->dateiso ?></updated>
- <content type="html"><?= htmlspecialchars($article->body) ?>
+ <content type="html"><?= htmlspecialchars($article->story) ?>
</content>
<?php
if ($article->thumb) {