<nav class="nav-bar">
<ul>
<li><a href="https://dpolakovic.space">About</a></li>
- <li><a href="https://dpolakovic.space/blog.html">Blog</a></li>
+ <li><a href="https://dpolakovic.space/blog.php">Blog</a></li>
<li><a href="https://dpolakovic.space/ad.html">Classified ad</a></li>
<li><a class="gitserver" href="https://git.dpolakovic.space">Git server</a>
</li>
<ul>
<!-- What I need -->
<li>
- Here I write some stuff.
+ I will buy board game Le Havre in any of these languages: EN, DE, CZE.
+ </li><br>
+ <li>
+ I am looking for Motorola F3 also known as Motofone. I will buy both
+ GSM variants, US and EU, as well as batteries for them.
</li><br>
<!-- What I offer -->
<li>
- Here I write some stuff.
+ I offer for sale original Nintendo NES classic edition with two controllers,
+ signed by Masayuki Uemura - console only, without box.
</li><br>
</ul>
<nav class="nav-bar">
<ul>
<li><a href="https://dpolakovic.space">About</a></li>
- <li><a href="https://dpolakovic.space/blog.html">Blog</a></li>
+ <li><a href="https://dpolakovic.space/blog.php">Blog</a></li>
<li><a href="https://dpolakovic.space/ad.html">Classified ad</a></li>
<li><a class="gitserver" href="https://git.dpolakovic.space">Git server</a>
</li>
for more than few seconds.<br><br>
</p>
<p>
- <!-- put links here -->
+ WHOOOPS! Nothing's here. You better check
+ <a href="https://dpolakovic.space/blog.php">blog.PHP</a></li>
</p>
</main>
<nav class="nav-bar">
<ul>
<li><a href="https://dpolakovic.space">About</a></li>
- <li><a href="https://dpolakovic.space/blog.php?sort=new">Blog</a></li>
+ <li><a href="https://dpolakovic.space/blog.php">Blog</a></li>
<li><a href="https://dpolakovic.space/ad.html">Classified ad</a></li>
<li><a class="gitserver" href="https://git.dpolakovic.space">Git server</a>
</li>
<br>
After eating and breathing, expressing opinions on the internet is the
most important humand need. Here are some of mine that occupied my mind
- for more than few seconds.<br><br>
+ for more than few seconds.
</p>
+ <?php
- <!-- These are hyper link buttons for sorting blogs
- NOTE: WIP see "PHP Blogs" lower
+ $sort = 'new';
+
+ // check if hyperlink has been clicked
+ if (isset($_GET['sort']))
+ {
+ $sort = $_GET['sort'];
+ }
+
+ // function to print file line by line
+ function printFile($filename)
+ {
+ $lines = file($filename);
+ foreach ($lines as $line)
+ {
+ echo $line . '<br>';
+ }
+ }
+
+ // function to print file line by line in reverse order
+ function printFileReversed($filename)
+ {
+ $lines = file($filename);
+ $reversedLines = array_reverse($lines);
+ foreach ($reversedLines as $line)
+ {
+ echo $line . '<br>';
+ }
+ }
+
+ // function to print file line by line which has "Edit" in them
+ function printFileEdited($filename)
+ {
+ $file = fopen($filename, "r");
+
+ while (($line = fgets($file)) !== false) {
+ if (strpos($line, 'Edited') !== false)
+ {
+ echo $line . '<br>';
+ }
+ }
+ fclose($file);
+ }
+ ?>
<p>
<center>
- Sorty by date:
- <a href="blog.php?sort=new">new first</a>
- <a href="blog.php?sort=old">old first</a>
- <a href="blog.php?sort=edt">edited first</a>
- <br>
+ Sort:
+ <a href="?sort=new">New first</a>
+ <a href="?sort=old">Old first</a>
+ <a href="?sort=edit">Edited only</a>
</center>
- </p>
- -->
-
+ </p>
<p>
- <!-- Blog list
- here I output html file with manually written html tags for each
- -->
- <?php
- echo "Seems empty here!"//file_get_contents("./bloglist.html");
-
- // this is for buttons
- //if ($_GET["sort"] == "new") {echo 'sort by new';}
- //if ($_GET["sort"] == "old") {echo 'sort by old';}
- //if ($_GET["sort"] == "edt") {echo 'sort by edited';}
-
- ?>
+ <?php
+ //debug
+ //echo "<br>Current value of key: $key <br>";
+ if ($sort == "new")
+ {
+ printFile("./Blogs/blog-list.html");
+ }
+ if ($sort == "old")
+ {
+ printFileReversed("./Blogs/blog-list.html");
+ }
+ if ($sort == "edit")
+ {
+ printFileEdited("./Blogs/blog-list.html");
+ }
+ ?>
</p>
- </main>
+ </main>
<!-- footer -->
<footer class="footer">
<nav class="nav-bar">
<ul>
<li><a href="https://dpolakovic.space">About</a></li>
- <li><a href="https://dpolakovic.space/blog.html">Blog</a></li>
+ <li><a href="https://dpolakovic.space/blog.php">Blog</a></li>
<li><a href="https://dpolakovic.space/ad.html">Classified ad</a></li>
<li><a class="gitserver" href="https://git.dpolakovic.space">Git server</a>
</li>
<p>
<!-- show my buttons button
buttons for PGP and Any browsers campaign
- -->
+ -->
+ <a class="gif-buttons" href="https://www.gnu.org/gnu40/">
+ <img src="./Pictures/gnu40.png" alt="GIF button: any browser campign">
+ </a>
<a class="gif-buttons" href="https://emailselfdefense.fsf.org/en/">
<img src="./Pictures/pgp-now.png" alt="GIF button: PGP set up guide">
</a>