From 40750028b3ea32fa6b8c233a8b891920a2872324 Mon Sep 17 00:00:00 2001 From: dev2 Date: Tue, 17 Dec 2024 07:57:12 +0000 Subject: [PATCH] s1 --- .hta_404.php | 28 +- .hta_footer.php | 5 +- .hta_header.php | 112 +-- .hta_header1.php | 597 +++++++++++++++ .hta_slug/about | 678 ++++++++++++++++++ .hta_slug/best-practices | 662 +++++++++++++++++ .hta_slug/favicon.ico | 656 +++++++++++++++++ .hta_slug/nss | 661 +++++++++++++++++ .../organogram | 119 ++- .hta_slug/teachers-council | 674 +++++++++++++++++ 10 files changed, 4061 insertions(+), 131 deletions(-) create mode 100644 .hta_header1.php create mode 100644 .hta_slug/about create mode 100644 .hta_slug/best-practices create mode 100644 .hta_slug/favicon.ico create mode 100644 .hta_slug/nss rename notice/sem-ii-admission-2024 => .hta_slug/organogram (90%) create mode 100644 .hta_slug/teachers-council diff --git a/.hta_404.php b/.hta_404.php index 7cb22b9..208fb9d 100644 --- a/.hta_404.php +++ b/.hta_404.php @@ -4,19 +4,19 @@ $headerContent = file_get_contents('./.hta_header.php'); $requestUri = $_SERVER['REQUEST_URI']; - $parts = explode('/', $requestUri); - $slug = $parts[2]; - $fileName = $slug; - $fileExtension = explode('.', $fileName); + // echo $requestUri; - $querySlug = ''; - if($fileExtension[1] && $fileExtension[1] === 'html'){ - $querySlug = $fileExtension[0]; + $urlParts = explode('/', $requestUri); + + if($urlParts[1] === 'notice'){ + $slug = $urlParts[2]; } else{ - $querySlug = $fileExtension[0]; + $slug = $urlParts[1]; } + $querySlug = explode('.', $slug)[0]; // echo $querySlug; + $fileName = $slug; try { $conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass); @@ -48,8 +48,16 @@ // } else{ // $filePath = __DIR__ . '/notice/' . $fileName . '.html'; // } - $filePath = __DIR__ . '/notice/' . $fileName; - $totalPageContent = $headerContent . $pageContent . $footerContent; + + + if($urlParts[1] === 'notice'){ + $filePath = __DIR__ . '/notice/' . $fileName; + $totalPageContent = $headerContent . $pageContent . $footerContent; + } else{ + $filePath = __DIR__ . '/.hta_slug/' . $fileName; + $totalPageContent = $headerContent . $pageContent . $footerContent; + } + file_put_contents($filePath, $totalPageContent); diff --git a/.hta_footer.php b/.hta_footer.php index ed58545..8e8327a 100644 --- a/.hta_footer.php +++ b/.hta_footer.php @@ -53,7 +53,4 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/.hta_header.php b/.hta_header.php index 52da0f2..1548a3a 100644 --- a/.hta_header.php +++ b/.hta_header.php @@ -249,37 +249,37 @@