page: rename article method "body" to "story"
[minimedit.git] / article.inc.php
index c6f3be9680d34b5d331cbf1c52c0c2f342add3d1..5de149226130e35fff49633a3fcb3cda3d8f9e35 100644 (file)
@@ -75,13 +75,14 @@ class ArchiveArticle
                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];
                        }
@@ -92,7 +93,7 @@ class ArchiveArticle
 
        function teaser()
        {
-               if (preg_match('{<p>(.*?)</p>}s', $this->body, $bodyp)) {
+               if (preg_match('{<p>(.*?)</p>}s', $this->story, $bodyp)) {
                        return $bodyp[1];
                }
        }
@@ -100,7 +101,7 @@ class ArchiveArticle
        function img()
        {
                $this->img = NULL;
-               $this->body;
+               $this->story;
                return $this->img;
        }