From 4a03c02cdab42464fe59c3ed86465805c4001a83 Mon Sep 17 00:00:00 2001 From: Gabriel Dunne Date: Fri, 28 May 2010 22:02:28 -0700 Subject: [PATCH] making template.php work --- .htaccess | 11 +++---- README | 25 +++++++------- index.php | 4 +-- plog/lib/config | 1 + plog/lib/init.php | 76 ++++++++++++++++++++++++++++++++++++++----- plog/lib/output.php | 1 - plog/lib/template.php | 20 ++++++++++++ 7 files changed, 107 insertions(+), 31 deletions(-) create mode 100644 plog/lib/template.php diff --git a/.htaccess b/.htaccess index bef083f..7ca81dd 100644 --- a/.htaccess +++ b/.htaccess @@ -1,9 +1,8 @@ - -RewriteEngine On -RewriteBase / -RewriteCond %{REQUEST_FILENAME} !-f -#RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule . index.php [L] + RewriteEngine On + RewriteBase / + RewriteCond %{REQUEST_FILENAME} !-f + #RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule . index.php [L] diff --git a/README b/README index b11749f..39c413b 100644 --- a/README +++ b/README @@ -2,18 +2,19 @@ plog CMS filesystem: / - .htaccess - index.php - large redirect - plog/ - config - lib/ - Smarty/ - templates/ - default/ - style.css - .. other template files - + .htaccess + index.php + large redirect + content/ + .. content + plog/ + config + lib/ + Smarty/ + templates/ + default/ + style.css + .. other template files + cache in sqlite db for searching, tags, etc + auto generate thumbnails diff --git a/index.php b/index.php index c827ad9..a9be48a 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,5 @@ diff --git a/plog/lib/config b/plog/lib/config index 502caa6..0178c6f 100644 --- a/plog/lib/config +++ b/plog/lib/config @@ -1,3 +1,4 @@ +PLOG_DIR = /home/quilime/py.quilime.com/ LOCAL_ROOT = /home/quilime/quilime.com/ CONTENT_DIR = c/ TEMPLATE_DIR = plog/templates/ diff --git a/plog/lib/init.php b/plog/lib/init.php index b7599d4..3dfaa68 100644 --- a/plog/lib/init.php +++ b/plog/lib/init.php @@ -1,10 +1,68 @@ -set_src(TEMPLATE_DIR . '/' . $config['template'] . '.' . $response_format . '.tpl'); + else if (file_exists(CONTENT_SRC)) + $template->set_src(CONTENT_SRC); + +// echo $template->src; + + # content + # images + $images = array(); + foreach(glob(CONTENT_BASEDIR . "{*.jpg,*.gif,*.png}", GLOB_BRACE) as $img) { + $i = array(); + $i['name'] = basename($img); + $i['url'] = str_replace(CONTENT_BASEDIR, CONTENT_WEBROOT, $img); + $images[] = $i; + } + } + + # header +// header("Content-Type: {$response_mime_type}; charset=UTF-8"); +// $template->render(); + + + +// print_r($_SERVER); + +// $images = glob("images/{*.jpg,*.gif,*.png}", GLOB_BRACE); +// print_r($images); + + + + +// require_once 'data.php'; +// require_once 'output.php'; + +// define_constants(); + ?> \ No newline at end of file diff --git a/plog/lib/output.php b/plog/lib/output.php index 14a8673..7f1c2fe 100644 --- a/plog/lib/output.php +++ b/plog/lib/output.php @@ -1,6 +1,5 @@ src = $template_src; + } + + function render() + { + echo "test"; + echo $this->src; + } + } + +?> \ No newline at end of file -- 2.34.1