From: Gabriel Dunne Date: Tue, 4 Sep 2012 00:07:45 +0000 (-0700) Subject: Getting editing working again. X-Git-Url: https://git.quilime.com/?a=commitdiff_plain;h=d8b9129130a11e643e4b90efad6e71c268d46f5c;p=plog.git Getting editing working again. --- diff --git a/content/config b/content/config old mode 100644 new mode 100755 diff --git a/content/log/islands b/content/log/islands old mode 100644 new mode 100755 diff --git a/content/log/overlords b/content/log/overlords old mode 100644 new mode 100755 diff --git a/content/log/temple b/content/log/temple old mode 100644 new mode 100755 diff --git a/content/log/water_is_life b/content/log/water_is_life old mode 100644 new mode 100755 diff --git a/content/projects/.audio b/content/projects/.audio old mode 100644 new mode 100755 diff --git a/content/projects/.egg b/content/projects/.egg old mode 100644 new mode 100755 diff --git a/content/projects/.obsession b/content/projects/.obsession old mode 100644 new mode 100755 diff --git a/content/projects/.rattle b/content/projects/.rattle old mode 100644 new mode 100755 diff --git a/content/projects/.stars b/content/projects/.stars old mode 100644 new mode 100755 diff --git a/content/projects/.statement_2007 b/content/projects/.statement_2007 old mode 100644 new mode 100755 diff --git a/content/projects/.tessellated b/content/projects/.tessellated old mode 100644 new mode 100755 diff --git a/content/projects/.web b/content/projects/.web old mode 100644 new mode 100755 diff --git a/content/projects/config b/content/projects/config old mode 100644 new mode 100755 diff --git a/content/projects/mask b/content/projects/mask old mode 100644 new mode 100755 diff --git a/content/projects/prism b/content/projects/prism old mode 100644 new mode 100755 diff --git a/data/content/log/tags.json b/data/content/log/tags.json deleted file mode 100644 index da87f8a..0000000 --- a/data/content/log/tags.json +++ /dev/null @@ -1 +0,0 @@ -{"tags":{"photo":2,"water":1,"writing":1,"quote":2,"india":1}} \ No newline at end of file diff --git a/data/content/projects/tags.json b/data/content/projects/tags.json deleted file mode 100644 index 7a2a5ff..0000000 --- a/data/content/projects/tags.json +++ /dev/null @@ -1 +0,0 @@ -{"tags":{"prism":1,"painting":2,"mask":1}} \ No newline at end of file diff --git a/data/tags.json b/data/tags.json deleted file mode 100644 index 1d66e51..0000000 --- a/data/tags.json +++ /dev/null @@ -1 +0,0 @@ -{"tags":{"photo":2,"water":1,"writing":1,"quote":2,"india":1,"prism":1,"painting":2,"mask":1}} \ No newline at end of file diff --git a/index.php b/index.php index 7012cf2..6c9cf6d 100644 --- a/index.php +++ b/index.php @@ -5,7 +5,7 @@ require 'lib/init.php'; $request = get_request(); -$m = new Model ($request); +$m = new Model($request); $v = new View(); diff --git a/lib/config.ini b/lib/config.ini index 919a806..885c226 100644 --- a/lib/config.ini +++ b/lib/config.ini @@ -1,3 +1,6 @@ +[development] +dev = true + [settings] ; general settings site_title = plog @@ -35,8 +38,6 @@ file_ignores[] = config file_ignores[] = .DS_Store -[development] -dev = true ; define ('SITE_TITLE', 'quilime'); diff --git a/lib/data.php b/lib/data.php index 1888d80..145dc7c 100644 --- a/lib/data.php +++ b/lib/data.php @@ -169,7 +169,6 @@ function get_tags($path = "", $args = array() ) $tags = array_count_values($tags); - if ($create_datafile) { if (!is_dir($data_path)) { if (!mkdir($data_path, 0777, true)) { @@ -182,17 +181,9 @@ function get_tags($path = "", $args = array() ) if (!file_exists( $data_file )) { throw new Exception('Error creating tags json in get_tags(). Permissions?'); } - } - - - // $fp = fopen( $data_file, 'w'); - // fwrite($fp, json_encode(array( 'tags' => $tags ))); - // fclose($fp); - // if (!file_exists( $data_file)) { - // throw new Exception('Error creating tags.json. Permissions?'); - // } + } } - + $json = json_decode(file_get_contents($data_file)); return (array) $json->tags; } diff --git a/lib/edit.php b/lib/edit.php new file mode 100644 index 0000000..761a8c5 --- /dev/null +++ b/lib/edit.php @@ -0,0 +1,30 @@ +getMessage(), "\n"; + } + $edit = false; +} else { + $edit = true; +} diff --git a/lib/model.php b/lib/model.php index 44cf54b..ad5c215 100644 --- a/lib/model.php +++ b/lib/model.php @@ -26,7 +26,30 @@ class Model function parse_request( $request ) { - # if entries (dir in CONTENT dir) + +/* + $dirs = explode('/', $request['path']); + switch($dirs[0]) { + # EDITING + case 'edit' : + include 'edit.php'; + break; + # TAG + case 'tag' : + echo 'tag time.'; + exit; + break; + } + + + # edit + if (DEV && isset($edit) && $edit) { + $this->template = 'edit.html.tpl'; + } + +*/ + + # if multiple (multiple files in CONTENT dir) if ($this->is_multiple()) { # check if config file exists in dir if ($this->has_config()) { diff --git a/templates/archive.html.tpl b/templates/archive.html.tpl index 6ba5573..204ac17 100644 --- a/templates/archive.html.tpl +++ b/templates/archive.html.tpl @@ -12,16 +12,16 @@
- +
- include_template('footer.html.tpl') ?> + include_template('footer.html.tpl') ?> include_template('nav.html.tpl') ?> diff --git a/templates/edit.html.tpl b/templates/edit.html.tpl new file mode 100644 index 0000000..e27c80f --- /dev/null +++ b/templates/edit.html.tpl @@ -0,0 +1,32 @@ + + + + include_template('head-inc.html.tpl') ?> + + <?=SITE_TITLE?><?=TITLE_DELIMITER?><?=$entry->title?> + + + + + include_template('nav.html.tpl') ?> + +
+ + + fileInfo); ?> + +
+ + + + +
+ + + +
+ + include_template('footer.html.tpl') ?> + + + diff --git a/templates/linked-archive.html.tpl b/templates/linked-archive.html.tpl deleted file mode 100644 index 788e5ea..0000000 --- a/templates/linked-archive.html.tpl +++ /dev/null @@ -1,49 +0,0 @@ - - - - include_template('head-inc.html.tpl') ?> - - <?=SITE_TITLE?><?=$this->page_title(TITLE_DELIMITER);?> - - - - - -
- - - -
-
-
-
- - - - -
- - include_template('footer.html.tpl') ?> - include_template('nav.html.tpl') ?> - - - diff --git a/templates/photo.html.tpl b/templates/photo.html.tpl deleted file mode 100644 index 83fde89..0000000 --- a/templates/photo.html.tpl +++ /dev/null @@ -1,94 +0,0 @@ - - - - include_template('head-inc.html.tpl'); ?> - - <?=SITE_TITLE?>: photo - - - - - include_template('nav.html.tpl') ?> - -
- - - - - -

video

- -

- more → -

- -*/ ?> - - -
- - include_template('footer.html.tpl'); ?> - - - -