nieuws: ignore missing image/contents of new articles
[minimedit.git] / nieuws / index.php
index 1a520112da6663f1805f602829469f6c65a1ee99..18f44660d24312bf194fdeea9db70752d8070e96 100644 (file)
@@ -13,7 +13,7 @@ if ($page and !is_numeric($page)) {
        $article = new ArchiveArticle("$Page$Args.html");
        $Place[1] = ' <small class="date">'.$article->date.'</small>';
        print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', ob_get_clean());
-       if ($article->image) {
+       if ($article->file and $article->image) {
                $Place['image'] = "https://lijtweg.nl/".$article->thumb('600x');
        }
        if (!empty($User['admin'])) {
@@ -24,14 +24,14 @@ if ($page and !is_numeric($page)) {
                        $tagtarget = is_writable($tagpath);
                        $taglist[] = sprintf(
                                '<input type="checkbox" name="%s" value="%s" id="%s"%s%s />' .
-                               '<label for="%2$s"> %s</label>',
+                               '<label for="%3$s"> %s</label>',
                                "tags[$tagname]", $tagname, "tag-$tagname",
                                $tagvalue ? ' checked' : '',
-                               ' onclick="return false"',
+                               ' disabled',
                                ucfirst($tagname)
                        );
                }
-               printf("<p><strong>Tags:</strong> %s</p>\n",
+               printf('<p class="tags"><strong>Tags:</strong> %s</p>'."\n",
                        implode("\n\t", $taglist)
                );
        }