From 94c589ed55b20a581810e126b20fdc2d67c68221 Mon Sep 17 00:00:00 2001 From: Nathan Lasseter Date: Wed, 10 Oct 2012 20:03:21 +0100 Subject: Initial commit --- .gitignore | 2 ++ .htaccess | 11 +++++++++++ README | 12 ++++++++++++ archives.php | 22 +++++++++++++++++++++ dopost.php | 15 +++++++++++++++ index.php | 44 ++++++++++++++++++++++++++++++++++++++++++ post.php | 14 ++++++++++++++ settings.php | 14 ++++++++++++++ styles.css | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ top.php | 20 ++++++++++++++++++++ viewpost.php | 26 +++++++++++++++++++++++++ 11 files changed, 242 insertions(+) create mode 100644 .gitignore create mode 100644 .htaccess create mode 100644 README create mode 100644 archives.php create mode 100644 dopost.php create mode 100644 index.php create mode 100644 post.php create mode 100644 settings.php create mode 100644 styles.css create mode 100644 top.php create mode 100644 viewpost.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1c5103b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.htpasswd +posts/ diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..5c502fc --- /dev/null +++ b/.htaccess @@ -0,0 +1,11 @@ +RewriteEngine on + +RewriteRule ^post/(.*)$ /viewpost.php?post=$1 + + + AuthType Basic + AuthName "Secure" + AuthUserFile /var/www/.htpasswd +# AuthUserFile /var/www/blog/.htpasswd + Require Valid-User + diff --git a/README b/README new file mode 100644 index 0000000..feffaa4 --- /dev/null +++ b/README @@ -0,0 +1,12 @@ +Clog + +PHP blogging software + +Released unlicensed + +Installation: +* Clone the repo +* Create a posts directory +* Edit settings.php to your liking +* Create a .htpasswd file for posting users +* Edit .htaccess to point to .htpasswd diff --git a/archives.php b/archives.php new file mode 100644 index 0000000..3f29067 --- /dev/null +++ b/archives.php @@ -0,0 +1,22 @@ +"; + echo "
\n"; + echo "$file\n"; + + $stat = stat("{$blogPosts}$file"); + $date = date('d-m-Y H:i T', $stat['mtime']); + echo "$date\n"; + echo "
\n\n\n"; + } +?> + + + + diff --git a/dopost.php b/dopost.php new file mode 100644 index 0000000..f4f43e5 --- /dev/null +++ b/dopost.php @@ -0,0 +1,15 @@ + diff --git a/index.php b/index.php new file mode 100644 index 0000000..9541b14 --- /dev/null +++ b/index.php @@ -0,0 +1,44 @@ +"; + echo "
\n"; + echo "$file [Permalink]\n"; + + $stat = stat("{$blogPosts}$file"); + $date = date('d-m-Y H:i T', $stat['mtime']); + echo "$date\n"; + echo "

\n"; + + $post = file_get_contents("{$blogPosts}$file"); + $post = preg_replace('/\n/', "
\n", $post); + echo $post; + echo "
\n\n\n"; + } + + echo "
\n"; + $older = $start + $show; + $newer = $start - $show; + if ($newer >= 0) echo "Newer\n"; + if ($older <= (count($ls) - 2)) echo "Older\n"; + echo "
\n"; +?> + + + diff --git a/post.php b/post.php new file mode 100644 index 0000000..9bd9138 --- /dev/null +++ b/post.php @@ -0,0 +1,14 @@ + +
+
+ + + +
+
+ + + + diff --git a/settings.php b/settings.php new file mode 100644 index 0000000..014f48b --- /dev/null +++ b/settings.php @@ -0,0 +1,14 @@ + diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..335fa40 --- /dev/null +++ b/styles.css @@ -0,0 +1,62 @@ +body { + font-family: sans-serif; + font-size: 12pt; + background-color: #FEFEFE; + margin: 0 auto; + width: 800px; +} + +a.title { + font-weight: bold; + font-size: 20pt; + margin: 0px 0px 14px; + text-decoration: none; + color: black; +} + +#perma { + font-size: 8pt; + font-weight: normal; +} + +a.toplink { + font-size: 14pt; + letter-spacing: -1px; + font-family: monospace; + float: bottom; + color: #000000; +} + +a.toplink:hover { + color: #808080; +} + +span.date { + margin: 0px 0px 14px; + font-size: 12px; + float: right; +} + +div { + clear: both; + text-align: justify; + border-style: solid; + border-color: #E0E0E0; + border-width: 5px; + border-radius: 5px; + width: 770px; + margin: 10px auto; + padding: 5px; +} + +#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; +} diff --git a/top.php b/top.php new file mode 100644 index 0000000..39a5f95 --- /dev/null +++ b/top.php @@ -0,0 +1,20 @@ + + + + + + <?php echo $blogTitle; ?> + + + + + +
+

+Home +Archives +Post +
+ diff --git a/viewpost.php b/viewpost.php new file mode 100644 index 0000000..e4c6cab --- /dev/null +++ b/viewpost.php @@ -0,0 +1,26 @@ +\n"; + echo "$file [Permalink]\n"; + + $stat = stat("{$blogPosts}$file"); + $date = date('d-m-Y H:i T', $stat['mtime']); + echo "$date\n"; + echo "

\n"; + + $post = file_get_contents("{$blogPosts}$file"); + $post = preg_replace('/\n/', "
\n", $post); + echo $post; + echo "\n\n\n"; +?> + + + + -- cgit v1.2.3