From 5fe1a3ae5cc9ea16f9575620ff322fe6e197994b Mon Sep 17 00:00:00 2001 From: Subhamoy Biswas Date: Wed, 22 Nov 2023 23:49:21 +0530 Subject: [PATCH] (feat): made page titles dynamic --- htdocs/assets/style.css | 8 -------- htdocs/blog.php | 2 +- htdocs/contact.php | 2 +- htdocs/core/query_functions.php | 10 ++++++++++ htdocs/home.php | 2 +- htdocs/projects.php | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/assets/style.css b/htdocs/assets/style.css index cfe7cec..5bad5ea 100644 --- a/htdocs/assets/style.css +++ b/htdocs/assets/style.css @@ -918,10 +918,6 @@ video { height: 100vh; } -.h-\[45dvh\] { - height: 45dvh; -} - .w-0 { width: 0px; } @@ -1606,10 +1602,6 @@ video { height: 60vh; } - .md\:h-\[60dvh\] { - height: 60dvh; - } - .md\:w-\[44vw\] { width: 44vw; } diff --git a/htdocs/blog.php b/htdocs/blog.php index eff4bf6..f082e40 100644 --- a/htdocs/blog.php +++ b/htdocs/blog.php @@ -10,7 +10,7 @@ require 'core/query_functions.php'; - My Blog - @neo_subhamoy + <?php echo fetch_page_title($conn, "Blog");?> diff --git a/htdocs/contact.php b/htdocs/contact.php index 9c1cc04..1bb6e80 100644 --- a/htdocs/contact.php +++ b/htdocs/contact.php @@ -10,7 +10,7 @@ require 'core/query_functions.php'; - Contact Me - @neo_subhamoy + <?php echo fetch_page_title($conn, "Contact");?> diff --git a/htdocs/core/query_functions.php b/htdocs/core/query_functions.php index 4fba194..55ff544 100644 --- a/htdocs/core/query_functions.php +++ b/htdocs/core/query_functions.php @@ -51,6 +51,16 @@ function fetch_social_icon($conn, $platform_name) { } } +//function to fetch page title +function fetch_page_title($conn, $page_name) { + $sql = "SELECT title FROM pages WHERE name = '$page_name'"; + $result = $conn -> query($sql); + if($result -> num_rows > 0){ + $row = $result -> fetch_assoc(); + return $row['title']; + } +} + //---functions to fetch search results starts here--- //from projects table function fetch_search_results_projects($conn, $keyword) { diff --git a/htdocs/home.php b/htdocs/home.php index 03a02d3..0b8c87e 100644 --- a/htdocs/home.php +++ b/htdocs/home.php @@ -10,7 +10,7 @@ require 'core/query_functions.php'; - @neo_subhamoy - official website + <?php echo fetch_page_title($conn, "Home");?> diff --git a/htdocs/projects.php b/htdocs/projects.php index e0a5a3f..2504ed8 100644 --- a/htdocs/projects.php +++ b/htdocs/projects.php @@ -12,7 +12,7 @@ $years = create_project_years_array($conn); - My Projects - @neo_subhamoy + <?php echo fetch_page_title($conn, "Projects");?>