diff --git a/articles/2015-03-27-09-34-Version-2.0.md b/articles/main/2015-03-27-09-34-Version-2.0.md similarity index 100% rename from articles/2015-03-27-09-34-Version-2.0.md rename to articles/main/2015-03-27-09-34-Version-2.0.md diff --git a/articles/2015-03-29-18-23-Version-2.1.md b/articles/main/2015-03-29-18-23-Version-2.1.md similarity index 100% rename from articles/2015-03-29-18-23-Version-2.1.md rename to articles/main/2015-03-29-18-23-Version-2.1.md diff --git a/articles/2015-03-29-21-34-About-the-Future-of-pBlog.md b/articles/main/2015-03-29-21-34-About-the-Future-of-pBlog.md similarity index 96% rename from articles/2015-03-29-21-34-About-the-Future-of-pBlog.md rename to articles/main/2015-03-29-21-34-About-the-Future-of-pBlog.md index 3b4bb67..67b6ca2 100644 --- a/articles/2015-03-29-21-34-About-the-Future-of-pBlog.md +++ b/articles/main/2015-03-29-21-34-About-the-Future-of-pBlog.md @@ -1,4 +1,5 @@ %TITLE: About the Future of pBlog %DATE: 29 March 2015 +%AUTHOR: Marcel Michael Kapfer I figured out that there will be many changes in the engine which will require many changes in the files (especially the posts file) and in the filestructure. I can't say right now which things will change and what you have to change. Out of this reason. I change the Version numbers and add an zero in front of them. So instead of 2.1 the latest version is now 0.2.1. The 0.2.x series is now on GitHub as an own branch and will recive bugfix updates. The series 0.3, 0.4, 0.5 and so own will be development releases which won't be compatible to the 0.2 series. I recommend current users to stay on 0.2.x - at least until the 1.0 release. I'm verry sorry for this and in case that there are requests I may write a small script that will help you switch to version 1.0. \ No newline at end of file diff --git a/articles/other-projects/2015-06-11-15-55-What-else-we-are-developing.md b/articles/other-projects/2015-06-11-15-55-What-else-we-are-developing.md new file mode 100644 index 0000000..fba42ee --- /dev/null +++ b/articles/other-projects/2015-06-11-15-55-What-else-we-are-developing.md @@ -0,0 +1,9 @@ +%TITLE: What else are we working on? +%DATE: 11 June 2015 + +Near the Rangitaki PHP blogging engine there are other projects were working on or where we will start development soon: + + - Rangitaki JavaScript blogging engine + - Rangitaki PHP framework + - Rangitaki JavaScript framework + - Rangitaki Polymer elements \ No newline at end of file diff --git a/blogs/main.md b/blogs/main.md new file mode 100644 index 0000000..c2744c3 --- /dev/null +++ b/blogs/main.md @@ -0,0 +1,14 @@ +%TITLE: main + +This is the Blog of the Blog Engine **Rangitaki** + +Rangitaki is based on PHP, XML and Markdown. It is easy to install and to configure. + +The latest Version of the 0.2 series is **0.2.2** + +The latest Version of the development stream isn' ready yet. + + +** !IMPORTANT! Please read [this](index.php?article=About-the-Future-of-pBlog) for more information about the different versions of pBlog.** + +You can find the source code on [GitHub](https://github.com/mmk2410/Rangitaki). \ No newline at end of file diff --git a/blogs/other-projects.md b/blogs/other-projects.md new file mode 100644 index 0000000..5a15b36 --- /dev/null +++ b/blogs/other-projects.md @@ -0,0 +1 @@ +%TITLE: Other projects \ No newline at end of file diff --git a/index.php b/index.php index 6c39ee8..04e49f3 100644 --- a/index.php +++ b/index.php @@ -51,13 +51,42 @@ THE SOFTWARE. + "; + echo "

Blogs of $blogtitle:

"; + require_once './res/php/BlogListGenerator.php'; + $blogs = scandir("./blogs/"); + foreach ($blogs as $blog){ + if(strlen($blog) >= 3 && substr($blog, -3) == ".md"){ + if($_GET['blog'] == ""){ + if($blog != "main.md"){ + BlogListGenerator::listBlog("./blogs/", $blog, $blogtitle); + } + } else { + if($_GET['blog'] . ".md" != $blog){ + BlogListGenerator::listBlog("./blogs/", $blog, $blogtitle); + } + } + } + } + echo ""; + } + if($_GET['blog'] == ""){ + $blog = "main"; + } else { + $blog = $_GET['blog']; + } + ?>
setBreaksEnabled(true) ->text($file); @@ -67,15 +96,16 @@ THE SOFTWARE.
= 3 && substr($article, -3) == ".md"){ - ArticleGenerator::newArticle("./articles/", $article); + ArticleGenerator::newArticle($articlesdir, $article, $_GET['blog']); } } } else { - ArticleGenerator::newArticle("./articles/", $_GET['article'] . ".md"); + ArticleGenerator::newArticle($articlesdir, $_GET['article'] . ".md", $_GET['blog']); include './res/php/SocialBar.php'; include './res/php/Disqus.php'; } diff --git a/res/php/ArticleGenerator.php b/res/php/ArticleGenerator.php index 2c433e1..e2f1ebd 100644 --- a/res/php/ArticleGenerator.php +++ b/res/php/ArticleGenerator.php @@ -31,7 +31,7 @@ */ class ArticleGenerator { - function newArticle($directory, $articlefile) + function newArticle($directory, $articlefile, $blog) { $article = file_get_contents($directory . $articlefile); @@ -40,7 +40,11 @@ class ArticleGenerator { if(substr($article, 0, 6) == "%TITLE"){ $title = substr($article, 8, strpos($article, "\n") - 8); - $link = "./?article=" . substr($articlefile, 0, -3); + if($blog == ""){ + $link = "./?article=" . substr($articlefile, 0, -3); + } else { + $link = "./?blog=$blog&article=" . substr($articlefile, 0, -3); + } echo "

$title

"; $article = substr($article, strpos($article, "\n") + 1); } @@ -51,12 +55,19 @@ class ArticleGenerator { $article = substr($article, strpos($article, "\n") + 1); } + if(substr($article, 0, 7) == "%AUTHOR"){ + $author = substr($article, 9, strpos($article, "\n") - 9); + $article = substr($article, strpos($article, "\n") + 1); + } + //TODO Code detection echo Parsedown::instance() ->setBreaksEnabled(true) ->text($article); + echo "$author"; + echo "" . "\n"; } diff --git a/res/php/BlogListGenerator.php b/res/php/BlogListGenerator.php new file mode 100644 index 0000000..a5d6188 --- /dev/null +++ b/res/php/BlogListGenerator.php @@ -0,0 +1,52 @@ +"; + $blog = file_get_contents($directory . $blogname); + $blog = $blog . "\n"; + if(substr($blog, 0, 6) == "%TITLE"){ + $blog = substr($blog, 8, strpos($blog, "\n") - 8); + if($blog == "main"){ + echo "$blogmaintitle"; + } else { + $link = "./?blog=" . substr($blogname, 0, -3); + echo "$blog"; + } + } + echo "

"; + + } + +}