diff --git a/index.php b/index.php new file mode 100644 index 0000000..2e94e63 --- /dev/null +++ b/index.php @@ -0,0 +1,75 @@ + + +
' . translate($lang["index"]["errortitle"]) . '
' . translate($lang["index"]["errorsubtitle"]) . '
'; + +// ******* +// METHODS +// ******* + +function showNews($path) { + global $parsedown; + + $files = array_diff(scandir($path), array('..', '.')); + foreach ($files as $newsFile) { + + if(!endsWith($newsFile, ".md")) + continue; + + $file = readFileContent($path . "/" . $newsFile); + $lines = explode("\n", $file); + + $title = $lines[0]; + $author = $lines[1]; + $text = implode("\n", array_slice($lines, 3)); + + generateNewsBox($title, $author, $parsedown->text($text)); + } +} + +function generateNewsBox($title, $author, $text) { ?> +