PHP Source Code: common.php
<?php
//----------------------------------------------------------
// The Web Language Project
// Mark Brautigam
// May-June 2015
// http://www.mixed-up.com/markb/
//----------------------------------------------------------
//-------------------------------------------------------
function headers1 ()
//-------------------------------------------------------
{
// Draw the part of the top stuff before possible custom styles.
// Put custom styles between the two header sections.
//
?>
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<link rel="icon" href="../images/puzzle2.png" />
<title>Web Programming Languages</title>
<link href='http://fonts.googleapis.com/css?family=Share+Tech+Mono' rel='stylesheet' type='text/css'>
<style type='text/css'>
@import "../common.css";
<?php
}
//-------------------------------------------------------
function headers2 ()
//-------------------------------------------------------
{
// Draw the part of the top stuff after possible custom styles.
// Put custom styles between the two header sections.
//
?>
</style>
</head>
<body>
<h1 class='brown'>Web Programming Languages</h1>
<div id="container">
<?php
}
//-------------------------------------------------------
function footers () {
//-------------------------------------------------------
?>
</div>
<div id="footer" class='brown'>
© 2015 · Mark Brautigam
</div>
<script type='text/javascript' src='../scripts/icons.js'></script>
<script type='text/javascript' src='../scripts/whereami.js'></script>
<!-- !3 -->
</body>
</html>
<?php
}
//-------------------------------------------------------
function sidebar ($langauge, $activity, $ext)
//-------------------------------------------------------
{
// Replace the placeholders in the sidebar files with the actual star
// by the language (PHP), activity (whichever), and file extension (php).
//
$src = file_get_contents ("../sidebar/sidebar.html");
$src = str_replace ("{#" . $langauge . "}", " <b>★</b>", $src);
$src = str_replace ("{#" . $activity . "}", " <b>★</b>", $src);
$src = str_replace ("{ext}", $ext, $src);
$src = preg_replace ('/{.*}/', "", $src);
return $src;
}
?>