This commit is contained in:
2025-09-18 13:29:43 +02:00
commit 164a89ea3e
14 changed files with 673 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
ini_set("display_errors", "On");
error_reporting(E_ALL);
include '../parts/header.php';
?>
<div id="top-bar">
<h1>> Blog</h1>
</div>
<article id="content">
<div class="post">Poniżej znajdziesz listę wszystkich postów na blogu ~<<USER>></div>
<?php
$posts_dir = 'posts/';
$posts = array_diff(scandir($posts_dir), array('..', '.'));
foreach ($posts as $post) {
$f = fopen("posts/$post", "r");
$line = fgets($f);
fclose($f);
$data = substr(substr($line, 4), 0, -4);
$post_data = explode(";%%%;", $data);
$title = $post_data[0];
$date = $post_data[1];
echo "<div class=\"post\"><i class=\"post_date\">$date</i> - <a href=\"posts/$post\" class=\"link\">$title</a></div>";
}
?>
</article>
<?php
include '../parts/footer.php';
?>

16
public_html/blog/newpost Normal file
View File

@@ -0,0 +1,16 @@
#title:Tytuł posta
Tutaj zaczyna się treść posta, dozwolony markdown
# Nagłówek
## Nagłówek 2
![alt](image.png)
> to
> jest
> cytat
```
a tu kod
```

View File

@@ -0,0 +1,11 @@
<!-- Witaj świecie!;%%%;2025-07-29 17:33:01 -->
<?php include '../../parts/header.php'; ?>
<div id="top-bar">
<h1>> Witaj świecie!</h1>
</div>
<i class="post_date">2025-07-29 17:33:01</i>
<article id="content">
<p>To jest pierwszy post na twojej stronie. Możesz go usunąć usuwając plik witaj-swiecie.php :)</p>
</article>
<?php include '../../parts/footer.php'; ?>