]> git.bochard.net Git - mysite.git/commitdiff
better logic for head.php
authorbochard <mail@bochard.net>
Sat, 12 Jul 2025 11:34:32 +0000 (19:34 +0800)
committerbochard <mail@bochard.net>
Sat, 12 Jul 2025 11:58:29 +0000 (19:58 +0800)
index.php
parts/head.php
parts/sidebar.php
robots.txt

index 3e8d21d7574e0088ec528ba1ec4e209255e2fca6..ef598df7e22c2b1538cef741f99f2ef2a7861edb 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -1,6 +1,5 @@
 <?php\r
-  $parts = $_SERVER['DOCUMENT_ROOT'] . '/parts';\r
-  require_once($parts . '/head.php');\r
+  require_once("{$_SERVER['DOCUMENT_ROOT']}/parts/head.php");\r
   $pgtitle = "bochard's net home";\r
   $pgdescription = "Welcome to my net home! this website are my space to show my hobbies, thoughts, and other fun stuffs. I am an 18 years old who learned how to code just by myself. Hope you enjoy visiting my site! :)";\r
   head($pgtitle, $pgdescription);\r
@@ -8,7 +7,7 @@
 <body>    \r
   <table>\r
     <tr>\r
-      <?php include_once($parts . '/sidebar.php');?>\r
+      <?php include_once("$parts/sidebar.php");?>\r
       \r
       <!-- ...and this is for the content -->\r
       <td id="body">\r
index 608e05a647474e485a21c61838e1ad61fdd03e72..24dd4234ddc775b552971f36273ff3e41f3c1fff 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+$parts = "{$_SERVER['DOCUMENT_ROOT']}/parts";
 function head($pgtitle, $pgdescription, $pgcss = []){ ?>
   <!DOCTYPE html>
   <html lang="en">
@@ -11,9 +12,9 @@ function head($pgtitle, $pgdescription, $pgcss = []){ ?>
     <meta name="description" content="<?= htmlspecialchars($pgdescription, ENT_COMPAT); ?>">
 
     <!-- stylesheet/s i use -->
-    <link rel="stylesheet" href="/stylesheets/root.css?v=<?= filemtime($_SERVER['DOCUMENT_ROOT']. '/stylesheets/root.css'); ?>">
+    <link rel="stylesheet" href="/stylesheets/root.css?v=<?= filemtime("{$_SERVER['DOCUMENT_ROOT']}/stylesheets/root.css"); ?>">
     <?php foreach($pgcss as $filepath): ?>
-      <link rel="stylesheet" href="<?= htmlspecialchars($filepath) . '?v=' . filemtime($filepath); ?>">
+      <link rel="stylesheet" href="<?= htmlspecialchars("$filepath?v="), filemtime($filepath); ?>">
     <?php endforeach; ?>
   </head>
 <?php }
index 0ccb966d23f903197312e95553313a771468f660..ec2e5d68e038f6b45665010f7e17b4a37f6006f2 100644 (file)
@@ -16,7 +16,7 @@
     <li><a href="mailto:mail@bochard.net">email me!</a></li>
   </ul>
   <hr>
-  <?php include_once($parts . '/scribbles.php');?>
+  <?php include_once("$parts/scribbles.php");?>
   <hr>
   <!-- cute badges and other cool things goes here -->
     <!-- hitwebcounter Code START -->
index f8c46f961651ca9c44622d473d25ee434eec6038..3644f2860a0ec8e09b7b3d5cba50f4700e37d9b9 100755 (executable)
@@ -20,7 +20,7 @@
 User-agent: *
 Disallow:
 
-Sitemap: https://bochard.net/sitemap.xml
+Sitemap: http://www.bochard.net/sitemap.xml
 
 #              ________
 #   __,_,     |        |