first
This commit is contained in:
30
public_html/blog/index.php
Normal file
30
public_html/blog/index.php
Normal 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
16
public_html/blog/newpost
Normal file
@@ -0,0 +1,16 @@
|
||||
#title:Tytuł posta
|
||||
Tutaj zaczyna się treść posta, dozwolony markdown
|
||||
|
||||
# Nagłówek
|
||||
|
||||
## Nagłówek 2
|
||||
|
||||

|
||||
|
||||
> to
|
||||
> jest
|
||||
> cytat
|
||||
|
||||
```
|
||||
a tu kod
|
||||
```
|
||||
11
public_html/blog/posts/witaj-swiecie.php
Normal file
11
public_html/blog/posts/witaj-swiecie.php
Normal 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'; ?>
|
||||
Reference in New Issue
Block a user