<?php
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
- $pgtitle = "email";
- $pgdescription = "";
- $pgcss = [];
- $pgjs = [];
- head($pgtitle, $pgdescription, $pgcss, $pgjs);
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
+head([
+ "title" => "email",
+ "meta" => [
+ ["name" => "description", "content" => "send me an email"]
+ ]
+]);
?>
+
<body background="/image/background/stars.gif" style="color: white;">
<center>
<table>
<?php
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
- $pgtitle = "guestbook";
- $pgdescription = "sign my guestbook";
- $pgcss = [];
- $pgjs = [];
- head($pgtitle, $pgdescription, $pgcss, $pgjs);
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
+head([
+ "title" => "guestbook",
+ "meta" => [
+ ["name" => "description", "content" => "sign my guestbook"]
+ ]
+]);
?>
+
<body background="/image/background/bluesky.jpg">
<center>
<table>
<?php
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
- $pgtitle = "bochard's tutorials";
- $pgdescription = "";
- $pgcss = [];
- $pgjs = [];
- head($pgtitle, $pgdescription, $pgcss, $pgjs);
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
+head([
+ "title" => "tutorials"
+]);
?>
+
<body>
<center>
<table>
<?php\r
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");\r
- $pgtitle = "bochard's net home";\r
- $pgdescription = "";\r
- $pgcss = [];\r
- $pgjs = [];\r
- head($pgtitle, $pgdescription, $pgcss, $pgjs);\r
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");\r
+head([\r
+ "title" => "bochard's net home",\r
+ "meta" => [\r
+ ["name" => "robots", "content" => "index,follow"],\r
+ ["name" => "description", "content" => "the internet home of bochard - computers, pics, weblogs, and more..."]\r
+ ]\r
+]);\r
?>\r
+\r
<body background="/image/background/clouds.gif">\r
<center>\r
<table width="900">\r
<?php
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
- $pgtitle = "about me";
- $pgdescription = "";
- $pgcss = [];
- $pgjs = [];
- head($pgtitle, $pgdescription, $pgcss, $pgjs);
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
+head([
+ "title" => "about me",
+ "meta" => [
+ ["name" => "description", "content" => "wanna know more about the creator of this site???"]
+ ]
+]);
?>
+
<body background="/image/background/bg1.gif">
<center>
<table>
<?php
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
- $pgtitle = "cool links";
- $pgdescription = "";
- $pgcss = [];
- $pgjs = [];
- head($pgtitle, $pgdescription, $pgcss, $pgjs);
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
+head([
+ "title" => "cool links",
+ "meta" => [
+ ["name" => "description", "content" => "some links that I found awesome."]
+ ]
+]);
?>
-<body bgcolor="#f7f7f7">
- <center>
- <table width="600" cellspacing="0" cellpadding="5" bgcolor="#f7f7f7">
- <tr>
- <td>
- <h1>here are some really cool links I found...</h1>
- I seldomly update this page. If you have a cool web site and would like to add here in the list, consider sending me an <a href="/email.php">email</a>.
- <br><br>
- 2025, Dec. 17 - <em><a href="https://www.fieggen.com">Ian Feggen's website</a></em> - <small>"Professor Shoelace"</small>
- <br>
- 2025, Dec. 17 - <em><a href="https://www.dvd3000.ca">dvd3000</a></em> - <small>I think, this is best web site I found XD</small>
- </td>
- </tr>
- </table>
- </center>
+
+<body>
+<center>
+ <table width="600" cellspacing="0" cellpadding="5">
+ <tr>
+ <td>
+ <h1>here are some really cool links I found...</h1>
+ I seldomly update this page. If you have a cool web site and would like to add here in the list, consider sending me an <a href="/email.php">email</a>.
+ <br><br>
+ 2025, Dec. 17 - <em><a href="https://www.fieggen.com">Ian Feggen's website</a></em> - <small>"Professor Shoelace"</small>
+ <br>
+ 2025, Dec. 17 - <em><a href="https://www.dvd3000.ca">dvd3000</a></em> - <small>I think, this is best web site I found XD</small>
+ </td>
+ </tr>
+ </table>
+</center>
</body>
</html>
<?php
$part = "{$_SERVER['DOCUMENT_ROOT']}/part";
-function head($pgtitle, $pgdescription = null, $pgcss = [], $pgjs = []){?>
- <!doctype html>
- <html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
- <meta name="robots" content="index,follow">
- <link rel="shortcut icon" href="/image/icon/pink-chair.png">
- <meta name="viewport" content="width=1200,initial-scale=1.0,shrink-to-fit=no">
- <title><?= htmlspecialchars($pgtitle, ENT_COMPAT);?></title>
- <?php
- if($pgdescription){
- $content = htmlspecialchars($pgdescription, ENT_COMPAT);
- echo "<meta name=\"description\" content=\"$content\">";
+function head(array $head = []) {
+ $title = $head['title'] ?? "no title";
+ $meta = $head['meta'] ?? [];
+ $css = $head['css'] ?? [];
+ $js = $head['js'] ?? [];
+ $favicon = $head['favicon'] ?? "/image/icon/pink-chair.png";
+
+ // default meta tags
+ $defaultMeta = [
+ ["name" => "robots", "content" => "index, follow"],
+ ["name" => "description", "content" => "no description..."]
+ ];
+
+ foreach($defaultMeta as $default) {
+ $doesExist = false;
+ foreach($meta as $tag) {
+ if(isset($tag['name']) && strtolower($tag['name']) === strtolower($default['name'])) {
+ $doesExist = true;
+ break;
}
- ?>
-
- <link rel="stylesheet" href="/part/stylesheet/root.css?v=<?= filemtime("{$_SERVER['DOCUMENT_ROOT']}/part/stylesheet/root.css");?>">
- <?php foreach($pgcss as $filename):?>
- <link rel="stylesheet" href="<?= htmlspecialchars("/part/stylesheet/$filename?v="), filemtime("{$_SERVER['DOCUMENT_ROOT']}/stylesheet/$filename");?>">
- <?php endforeach;?>
-
- <script type="text/javascript" src="/part/script/root.js?v=<?= filemtime("{$_SERVER['DOCUMENT_ROOT']}/part/script/root.js");?>"></script>
- <?php foreach($pgjs as $filename):?>
- <script type="text/javascript" src="<?= htmlspecialchars("/part/script/$filename?v="), filemtime("{$_SERVER['DOCUMENT_ROOT']}/script/$filename");?>"></script>
- <?php endforeach;?>
- </head>
-<?php }
+ }
+ if(!$doesExist) {
+ $meta[] = $default;
+ }
+ }
+?>
+<!doctype html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ <title><?= htmlspecialchars($title, ENT_COMPAT);?></title>
+ <link rel="shortcut icon" href="<?= htmlspecialchars($favicon, ENT_COMPAT);?>?v=<?= filemtime("{$_SERVER['DOCUMENT_ROOT']}/$favicon");?>">
+ <?php
+ foreach($meta as $tag) {
+ $output = "";
+ foreach($tag as $key => $val) {
+ $output .= " " . htmlspecialchars($key, ENT_COMPAT) . "=\"" . htmlspecialchars($val, ENT_COMPAT) . "\"";
+ }
+ echo "<meta$output>\n\t";
+ }
+ ?>
+
+ <!-- stylesheets -->
+ <link rel="stylesheet" href="/part/stylesheet/root.css?v=<?= filemtime("{$_SERVER['DOCUMENT_ROOT']}/part/stylesheet/root.css");?>">
+ <?php foreach($css as $file):?>
+ <?php
+ $filepath = $_SERVER['DOCUMENT_ROOT'] . $file;
+ if(!file_exists($filepath)) continue;
+ $version = filemtime($filepath);
+ ?>
+ <link rel="stylesheet" href="<?= htmlspecialchars("$file?v=$version", ENT_COMPAT);?>">
+ <?php endforeach;?>
+
+ <!-- scripts -->
+ <script src="/part/script/root.js?v=<?= filemtime("{$_SERVER['DOCUMENT_ROOT']}/part/script/root.js");?>"></script>
+ <?php foreach($js as $file):?>
+ <?php
+ $filepath = $_SERVER['DOCUMENT_ROOT'] . $file;
+ if(!file_exists($filepath)) continue;
+ $version = filemtime($filepath);
+ ?>
+ <script src="<?= htmlspecialchars("$file?v=$version", ENT_COMPAT);?>"></script>
+ <?php endforeach;?>
+</head>
+<?php
+}
<?php
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
- $pgtitle = "my photo album";
- $pgdescription = "";
- $pgcss = [];
- $pgjs = [];
- head($pgtitle, $pgdescription, $pgcss, $pgjs);
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
+head([
+ "title" => "my photo album"
+]);
?>
+
<body>
<center>
<table>
<?php
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
- $pgtitle = "";
- $pgdescription = "";
- $pgcss = [];
- $pgjs = [];
- head($pgtitle, $pgdescription, $pgcss, $pgjs);
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
+head([
+ "title" => ""
+]);
?>
+
<body>
<center>
<table width="490">
<?php
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
- $pgtitle = "A dream.";
- $pgdescription = "";
- $pgcss = [];
- $pgjs = [];
- head($pgtitle, $pgdescription, $pgcss, $pgjs);
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
+head([
+ "title" => "A dream."
+]);
?>
+
<body>
<center>
<table width="490">
<?php
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
- $pgtitle = "The rain.";
- $pgdescription = "";
- $pgcss = [];
- $pgjs = [];
- head($pgtitle, $pgdescription, $pgcss, $pgjs);
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
+head([
+ "title" => "The rain."
+]);
?>
+
<body>
<center>
<table width="490">
<?php
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
- $pgtitle = "New haircut";
- $pgdescription = "";
- $pgcss = [];
- $pgjs = [];
- head($pgtitle, $pgdescription, $pgcss, $pgjs);
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
+head([
+ "title" => "New haircut"
+]);
?>
+
<body>
<center>
<table width="490">
<?php
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
- $pgtitle = "University orientation";
- $pgdescription = "";
- $pgcss = [];
- $pgjs = [];
- head($pgtitle, $pgdescription, $pgcss, $pgjs);
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
+head([
+ "title" => "University orientation"
+]);
?>
+
<body>
<center>
<table width="490">
<?php
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
- $pgtitle = "Our kitten died";
- $pgdescription = "";
- $pgcss = [];
- $pgjs = [];
- head($pgtitle, $pgdescription, $pgcss, $pgjs);
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
+head([
+ "title" => "Our kitten died"
+]);
?>
+
<body>
<center>
<table width="490">
<?php
- require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
- $pgtitle = "my thoughts";
- $pgdescription = "";
- $pgcss = [];
- $pgjs = [];
- head($pgtitle, $pgdescription, $pgcss, $pgjs);
+require_once("{$_SERVER['DOCUMENT_ROOT']}/part/head.php");
+head([
+ "title" => "weblog",
+ "meta" => [
+ ["name" => "description", "content" => "my thoughts..."]
+ ]
+]);
?>
+
<body>
<center>
<table width="490">