This repository has been archived on 2021-12-22. You can view files and clone it, but cannot push or open issues or pull requests.
blog-legacy/views/article.php

19 lines
501 B
PHP
Raw Normal View History

2020-03-06 09:37:56 +01:00
<?php
if(isset($_GET["ID"])){
if(!empty($_GET["ID"])){
include_once("lib/articles.php");
include_once("lib/users.php");
2020-03-08 13:48:17 +01:00
include_once("lib/md.php");
2020-03-06 09:37:56 +01:00
$article = getArticle($_GET["ID"]);
$authorName = getUserName($article["author"]);
2020-03-08 13:54:29 +01:00
$content = "<h1>".$article["title"]."</h1><article>".md2html($article["content"])."</article><span>written by ".$authorName." on ".$article["date"]."</span>";
2020-03-06 09:37:56 +01:00
}else{
$content = "Article ID is empty";
}
}else{
$content = "No article ID set";
}