page: replace global variables by $Page object
[minimedit.git] / widget / linkref.php
index 1ac38864e15874727104fed296f9e1056ca33067..d3ab1eba0498a397d072a9aa4de25a1a3c25fe30 100644 (file)
@@ -1,11 +1,13 @@
 <?php
-       $article = new ArchiveArticle($Args);
+       $article = new ArchiveArticle($Page->path);
        printf('<a href="%s">%s</a>', $article->link, $article->name);
        if ($article->image) {
                printf("\n\t".'<img class="right" src="/%s" />', $article->thumb('100x100'));
        }
        if ($article->teaser) {
-               printf("\n\t<blockquote>%s</blockquote>",
-                       preg_replace('/\n(.*)/s', ' <small>\1</small>', $article->teaser)
-               );
+               printf("\n\t<blockquote>%s</blockquote>", preg_replace(
+                       ['/\n(.*)/s', '/<img[^>]*>/'],
+                       [' <small>\1</small>', ''],
+                       $article->teaser
+               ));
        }