diff --git a/include/footer.php b/include/footer.php deleted file mode 100644 index 062b9f4142f7e56bc5beabff0e41d76436bb5cbb..0000000000000000000000000000000000000000 --- a/include/footer.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -include "../internal/mysql.php"; - -?> -<div id="blueBar"></div> -<div id="footerContent"> - <div> - <a href="/datenschutzerklaerung.php">Datenschutzerklärung</a><br> - <a href="/bildquellen.php">Bildquellen</a><br> - <a href="/impressum.php">Impressum</a><br> - </div> - <div id="newestPost"> - <h3>Neueste Beiträge:</h3> - <?php - $result = $conn->query("SELECT * FROM posts order by id desc limit $footerMaxPost"); - if ($result->num_rows > 0) { - while($row = $result->fetch_assoc()) { - $title = $row["title"]; - $id = $row["id"]; - echo("<a href=\"/post.php?id=$id\">$title</a><br>"); - } - } - - - ?> - </div> - <div class="center"> - <p class="center"> - <a href="https://www.instagram.com/jonasled1/"><i class="fab fa-instagram fa-2x"></i></a><i class="footerIconSpacer"></i> - <a href="https://www.thingiverse.com/jonasled/designs/"><i class="fas fa-cubes fa-2x"></i></a><i class="footerIconSpacer"></i> - <a href="https://paypal.me/jonasled/"><i class="fab fa-paypal fa-2x"></i></a> - </p> - </div> -</div> \ No newline at end of file diff --git a/include/menue.php b/include/menue.php deleted file mode 100644 index f2f8a6c27f41c436e5fc6c622f87e4dbb3876622..0000000000000000000000000000000000000000 --- a/include/menue.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php -$page = $_GET["page"]; -?> - -<a href="/" <?php echo($page == "home" ? "class=\"menueSelected\"" : "");?>>Startseite</a> -<div class="dropdown"> - <a href="#" <?php echo($page == "projekte" ? "class=\"menueSelected\"" : "");?>>Projekte</a> - <div class="dropdown-content"> - <a href="/Projekte/proxdroid.php">Proxdroid - Proxmox Android App</a><br> - <a href="/Projekte/websitecloner.php">Website Cloner</a><br> - <a href="/Projekte/youtubedownloader.php">YouTube Downloader</a><br> - <a href="/Projekte/mqttpush.php">MQTT Push</a><br> - <a href="/Projekte/gclogLink.php">Geocaching Premium Log link Generator</a><br> - <a href="/Projekte/ledtisch1.php">LED Tisch Version 1</a><br> - <a href="/Projekte/ledtisch2.php">LED Tisch Version 2</a><br> - <a href="/Projekte/regensensor.php">Regensensor</a><br> - <a href="/Projekte/blitzortung.php">Blitzortung</a><br> - <a href="/Projekte/insecam.php">Insecam</a><br> - <a href="/Projekte/URLkuerzer1.php">URL Kürzer V1</a><br> - <a href="/Projekte/URLkuerzer2.php">URL Kürzer V2</a><br> - <a href="/Projekte/smartmirror.php">Smart Mirror</a><br> - <a href="/Projekte/snowboy.php">Installation von Snowboy</a><br> - </div> -</div> -<a href="//kurz.ml">URL Kürzer</a> -<div class="dropdown"> - <a href="#" <?php echo($page == "status" ? "class=\"menueSelected\"" : "");?>>Status</a> - <div class="dropdown-content"> - <a href="//status.jonasled.de">Server</a><br> - <a href="/ntpstatus.php">NTP Server</a><br> - </div> -</div> diff --git a/internal/footer.php b/internal/footer.php index a7b035643cb2686cef67b81322a20b661fe07e2d..1e69ef43621ea2be1535efcfc237dc9c9e7d6120 100644 --- a/internal/footer.php +++ b/internal/footer.php @@ -1,8 +1,43 @@ <?php + function getFooter(){ - echo(<<<EOF + include "mysql.php"; + include "config.php"; + + $newestPost = ""; + + $result = $conn->query("SELECT * FROM posts order by id desc limit $footerMaxPost"); + if ($result->num_rows > 0) { + while ($row = $result->fetch_assoc()) { + $title = $row["title"]; + $id = $row["id"]; + $newestPost .= "<a href=\"/post.php?id=$id\">$title</a><br>"; + } + } + + + echo (<<<EOF + </div> + <footer> + <div id="blueBar"></div> + <div id="footerContent"> + <div> + <a href="/datenschutzerklaerung.php">Datenschutzerklärung</a><br> + <a href="/bildquellen.php">Bildquellen</a><br> + <a href="/impressum.php">Impressum</a><br> + </div> + <div id="newestPost"> + <h3>Neueste Beiträge:</h3> + $newestPost + </div> + <div class="center"> + <p class="center"> + <a href="https://www.instagram.com/jonasled1/"><i class="fab fa-instagram fa-2x"></i></a><i class="footerIconSpacer"></i> + <a href="https://www.thingiverse.com/jonasled/designs/"><i class="fas fa-cubes fa-2x"></i></a><i class="footerIconSpacer"></i> + <a href="https://paypal.me/jonasled/"><i class="fab fa-paypal fa-2x"></i></a> + </p> + </div> </div> - <footer includeHTML="/include/footer.php"> </footer> <script src="/js/includeHTML.js"></script> </body> diff --git a/internal/header.php b/internal/header.php index e49b121f150683b5c1697843e8b69c29b2680479..fccb8192c4a7b816ef4dafc7f7770bb8a31461ab 100644 --- a/internal/header.php +++ b/internal/header.php @@ -1,7 +1,9 @@ <?php +include "menue.php"; function getHeader($pagetitle, $navselect) { + $menu = getMenu($navselect); echo( <<<EOF <!DOCTYPE html > <html lang = "de" > @@ -39,7 +41,7 @@ function getHeader($pagetitle, $navselect) </svg > </div > </div > - <div id = "mainMenu" includeHTML = "/include/menue.php?page=$navselect" ></div > + <div id = "mainMenu">$menu</div > </header > <!--Matomo Image Tracker --> <img src = "https://matomo.jonasled.de/matomo.php?idsite=1&rec=1" style = "border:0" alt = "" /> diff --git a/internal/menue.php b/internal/menue.php new file mode 100644 index 0000000000000000000000000000000000000000..14b2f27cce118445543a63c6d7553cae99431a7f --- /dev/null +++ b/internal/menue.php @@ -0,0 +1,38 @@ +<?php +function getMenu($page){ + $startpage = $page == "home" ? "class=\"menueSelected\"" : ""; + $projects = $page == "projekte" ? "class=\"menueSelected\"" : ""; + $status = $page == "status" ? "class=\"menueSelected\"" : ""; + + return <<<EOF + <a href="/" $startpage>Startseite</a> + <div class="dropdown"> + <a href="#" $projects>Projekte</a> + <div class="dropdown-content"> + <a href="/Projekte/proxdroid.php">Proxdroid - Proxmox Android App</a><br> + <a href="/Projekte/websitecloner.php">Website Cloner</a><br> + <a href="/Projekte/youtubedownloader.php">YouTube Downloader</a><br> + <a href="/Projekte/mqttpush.php">MQTT Push</a><br> + <a href="/Projekte/gclogLink.php">Geocaching Premium Log link Generator</a><br> + <a href="/Projekte/ledtisch1.php">LED Tisch Version 1</a><br> + <a href="/Projekte/ledtisch2.php">LED Tisch Version 2</a><br> + <a href="/Projekte/regensensor.php">Regensensor</a><br> + <a href="/Projekte/blitzortung.php">Blitzortung</a><br> + <a href="/Projekte/insecam.php">Insecam</a><br> + <a href="/Projekte/URLkuerzer1.php">URL Kürzer V1</a><br> + <a href="/Projekte/URLkuerzer2.php">URL Kürzer V2</a><br> + <a href="/Projekte/smartmirror.php">Smart Mirror</a><br> + <a href="/Projekte/snowboy.php">Installation von Snowboy</a><br> + </div> + </div> + <a href="//kurz.ml">URL Kürzer</a> + <div class="dropdown"> + <a href="#" $status>Status</a> + <div class="dropdown-content"> + <a href="//status.jonasled.de">Server</a><br> + <a href="/ntpstatus.php">NTP Server</a><br> + </div> + </div> +EOF; +} +?>