From 68056e6d92285e184518bc8c7130bb49767623f3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 1 Sep 2011 21:09:56 -0400 Subject: Move config into one config.php file, add an index file, spit out complete HTML files, use CSS --- README.md | 8 ++++---- config.php | 3 +++ footer.php | 3 +++ header.php | 7 +++++++ index.php | 12 ++++++++++++ make-post.php | 10 +++++++--- style.css | 7 +++++++ upload-msword.php | 14 +++++++++++--- upload-org.php | 11 ++++++++++- 9 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 config.php create mode 100644 footer.php create mode 100644 header.php create mode 100644 index.php create mode 100644 style.css diff --git a/README.md b/README.md index 5a3c57c..6c9b611 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ polished project. Other Notes ----------- -All of the PHP files have a directory hardcoded into them to either -look for the org-mode files in, or upload them to. I've got it set to -`/home/luke/j1-uploads`. Perhaps one day I'll move that to a single -config file. +Yeah, I did all the bad-practice spitting-out-HTML-from-logic-code +and using globals stuff. This was a quickie hack. It's basically +just one PHP script (at least on the PHP side). Don't worry, my other +projects use MVC and all that. diff --git a/config.php b/config.php new file mode 100644 index 0000000..dfe92e5 --- /dev/null +++ b/config.php @@ -0,0 +1,3 @@ +Back to menu

+ + diff --git a/header.php b/header.php new file mode 100644 index 0000000..45553af --- /dev/null +++ b/header.php @@ -0,0 +1,7 @@ + + + + <?php global $title; echo $title; ?> + + + diff --git a/index.php b/index.php new file mode 100644 index 0000000..b3587be --- /dev/null +++ b/index.php @@ -0,0 +1,12 @@ + + +'; echo ''; echo ''; echo ''; - exit(); + include('footer.php'); } $filename = $dir.'/'.rawurlencode($_POST['filename']); @@ -51,6 +52,7 @@ foreach ($lines as $line) { } if (!isset($_POST['q'])) { + include('header.php'); echo '
'; echo ''; echo ''; @@ -93,7 +95,9 @@ if (!isset($_POST['q'])) { } echo ''; echo '
'; + include('footer.php'); } else { + header('Content-type: text/plain; charset=utf-8'); $quotes = array(); foreach ($_POST['q'] as $reporter => $quote_id) { $quote = $reporters[$reporter][$quote_id]; diff --git a/style.css b/style.css new file mode 100644 index 0000000..1c8ccd6 --- /dev/null +++ b/style.css @@ -0,0 +1,7 @@ +input[type=text] { + width: 100%; +} +textarea { + width: 100%; + height: 10em; +} \ No newline at end of file diff --git a/upload-msword.php b/upload-msword.php index b234381..f2d93bf 100644 --- a/upload-msword.php +++ b/upload-msword.php @@ -1,6 +1,10 @@
+ Filename: + Text:
+ Filename: + Text: