diff options
-rw-r--r-- | archives.php | 8 | ||||
-rw-r--r-- | dopost.php | 1 | ||||
-rw-r--r-- | functions.php | 14 | ||||
-rw-r--r-- | index.php | 9 | ||||
-rw-r--r-- | post.php | 10 | ||||
-rw-r--r-- | styles.css | 16 | ||||
-rw-r--r-- | title.php | 11 | ||||
-rw-r--r-- | viewpost.php | 29 | ||||
-rw-r--r-- | widget.php | 1 |
9 files changed, 70 insertions, 29 deletions
diff --git a/archives.php b/archives.php index 4a41f18..fbb76c7 100644 --- a/archives.php +++ b/archives.php @@ -1,5 +1,6 @@ <?php require("settings.php"); + require("functions.php"); ?> <!DOCTYPE html> <html> @@ -11,12 +12,7 @@ <body> -<div id="title"> -<h1><?php echo $blogHead; ?></h1> -<a class="toplink" href="<?php echo $blogRoot; ?>">Home</a> -<a class="toplink" href="<?php echo $blogRoot; ?>archives.php">Archives</a> -<a class="toplink" href="<?php echo $blogRoot; ?>post.php">Post</a> -</div> +<?php title(); ?> <?php $ls = explode("\n", `ls -1t {$blogPosts}/`); @@ -1,5 +1,6 @@ <?php require("settings.php"); + require("functions.php"); if (!isset($_POST['title']) || !isset($_POST['content'])) { header("location: {$blogRoot}post.php"); diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..ec1ef28 --- /dev/null +++ b/functions.php @@ -0,0 +1,14 @@ +<?php + +function summarise($post) { + $post = preg_replace('/(\r?\n|\t)/', " ", $post); + $post = preg_replace('/"/', """, $post); + $post = preg_replace('/<.*?>/', " ", $post); + return substr($post, 0, 196) . "..."; +} + +function title() { + require("title.php"); +} + +?> @@ -1,5 +1,6 @@ <?php require("settings.php"); + require("functions.php"); ?> <!DOCTYPE html> <html> @@ -7,16 +8,12 @@ <head> <title><?php echo $blogTitle; ?></title> <link rel="stylesheet" type="text/css" href="<?php echo $blogRoot; ?>styles.css" /> + <link href="feed" type="applictaion/atom+xml" rel=alternate" title="Atom Feed" /> </head> <body> -<div id="title"> -<h1><?php echo $blogHead; ?></h1> -<a class="toplink" href="<?php echo $blogRoot; ?>">Home</a> -<a class="toplink" href="<?php echo $blogRoot; ?>archives.php">Archives</a> -<a class="toplink" href="<?php echo $blogRoot; ?>post.php">Post</a> -</div> +<?php title(); ?> <?php $start = 0; @@ -1,5 +1,6 @@ <?php - require("settings.php"); + require("settings.php"); + require("functions.php"); ?> <!DOCTYPE html> <html> @@ -11,12 +12,7 @@ <body> -<div id="title"> -<h1><?php echo $blogHead; ?></h1> -<a class="toplink" href="<?php echo $blogRoot; ?>">Home</a> -<a class="toplink" href="<?php echo $blogRoot; ?>archives.php">Archives</a> -<a class="toplink" href="<?php echo $blogRoot; ?>post.php">Post</a> -</div> +<?php title(); ?> <div> <form method="post" action="<?php echo $blogRoot; ?>dopost.php"> @@ -32,6 +32,7 @@ a.toplink { font-family: monospace; float: bottom; color: #000000; + padding: 0px 7px; } a.toplink:hover { @@ -62,14 +63,27 @@ div { padding: 5px; } +div>div { + width: 730px; + border: none; +} + #title { position: relative; background-color: #E0E0E0; text-align: center; width: 750px; margin: 10px 0px 5px; - font-size: 32px; padding: 25px; border: 0px; border-radius: 10px; } + +#title>h1 { + font-size: 60px; +} + +#title>h2 { + font-size: 20px; + font-family: monospace; +} diff --git a/title.php b/title.php new file mode 100644 index 0000000..edee86b --- /dev/null +++ b/title.php @@ -0,0 +1,11 @@ +<?php + require("settings.php"); +?> +<div id="title"> +<h1><?php echo $blogTitle; ?></h1> +<h2><?php echo $blogSubTitle; ?></h2> +<a class="toplink" href="<?php echo $blogRoot; ?>">Home</a> +<a class="toplink" href="<?php echo $blogRoot; ?>archives.php">Archives</a> +<a class="toplink" href="<?php echo $blogRoot; ?>feed">Feed</a> +<a class="toplink" href="<?php echo $blogRoot; ?>post.php">Post</a> +</div> diff --git a/viewpost.php b/viewpost.php index 2b73cc9..031dd0b 100644 --- a/viewpost.php +++ b/viewpost.php @@ -4,6 +4,7 @@ exit(0); } require("settings.php"); + require("functions.php"); $getpost = preg_replace('/\+/', ' ', $_GET['post']); $post = file_get_contents("{$blogPosts}$getpost"); $post = preg_replace('/\n/', "<br>\n", $post); @@ -19,24 +20,19 @@ <meta name="twitter:url" content="<?php echo "http://{$_SERVER['SERVER_NAME']}{$blogRoot}".$_GET['post']; ?>"> <meta name="twitter:creator" content="<?php echo $twitterCreator; ?>"> <meta name="twitter:title" content="<?php echo $getpost; ?>"> - <meta name="twitter:description" content="<?php echo preg_replace('/"/', '"', substr($post, 0, 196)) . "..."; ?>"> + <meta name="twitter:description" content="<?php echo summarise($post); ?>"> </head> <body> -<div id="title"> -<h1><?php echo $blogHead; ?></h1> -<a class="toplink" href="<?php echo $blogRoot; ?>">Home</a> -<a class="toplink" href="<?php echo $blogRoot; ?>archives.php">Archives</a> -<a class="toplink" href="<?php echo $blogRoot; ?>post.php">Post</a> -</div> +<?php title(); ?> <?php - echo "<div>\n"; + echo "<div>\n"; echo "<a class=\"title\" href=\"{$blogRoot}post/" . urlencode($getpost) . "\">$getpost <span id=\"perma\">[Permalink]</span></a> "; ?> <a href="https://twitter.com/share" class="twitter-share-button" data-text="<?php echo "$blogTitle: {$getpost}"; ?>" data-url="http://<?php echo "{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}"; ?>">[Tweet]</a> -<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> +<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> <?php $stat = stat("{$blogPosts}$getpost"); @@ -48,6 +44,21 @@ echo "</div>\n</a>\n\n"; ?> +<div id="disqus_thread"> + <script type="text/javascript"> + var disqus_shortname = 'user4574'; + + (function() { + var dsq = document.createElement('script'); + dsq.type = 'text/javascript'; + dsq.async = true; + dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + })(); + </script> + <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> +</div> + </body> </html> @@ -1,5 +1,6 @@ <?php require("settings.php"); + require("functions.php"); ?> <!DOCTYPE html> <html> |