-title = icosi fabrication
-date = 2010-07-01
-tags = fabrication icosi design sculpture mapping
---
-Fabrication process for ICOSI projection surface. The form is a section of an icosidodecahedron (scaled on the z-axis by 0.5).
-
-<a href="http://www.flickr.com/photos/quilime/4743498955/" title="view on flickr">
-<img src="http://farm5.static.flickr.com/4077/4743498955_d8d524bd27.jpg" /></a>
-<br />
-A laser-cut a small working model.
-
-<a href="http://www.flickr.com/photos/quilime/4744981890/" title="view on flickr"><img src="http://farm5.static.flickr.com/4142/4744981890_2a41c9f374.jpg" /></a><br />
-Custom jig for slicing the angles.
-
-<a href="http://www.flickr.com/photos/quilime/4769443639/in/photostream/"><img src="http://farm5.static.flickr.com/4076/4769443639_728b077b3a.jpg" /></a><br />
-Priming the panels, readying them to be stretched with screen-fabric.
+title = icosi fabrication\r
+date = 2010-07-01\r
+tags = fabrication icosi design sculpture mapping\r
+--\r
+Fabrication process for ICOSI projection surface. The form is a section of an icosidodecahedron (scaled on the z-axis by 0.5).\r
+\r
+<a href="http://www.flickr.com/photos/quilime/4743498955/" title="view on flickr">\r
+<img src="http://farm5.static.flickr.com/4077/4743498955_d8d524bd27.jpg" /></a>\r
+<br />\r
+A laser-cut a small working model.\r
+\r
+<a href="http://www.flickr.com/photos/quilime/4744981890/" title="view on flickr"><img src="http://farm5.static.flickr.com/4142/4744981890_2a41c9f374.jpg" /></a><br />\r
+Custom jig for slicing the angles.\r
+\r
+<a href="http://www.flickr.com/photos/quilime/4769443639/in/photostream/"><img src="http://farm5.static.flickr.com/4076/4769443639_728b077b3a.jpg" /></a><br />\r
+Priming the panels, readying them to be stretched with screen-fabric.\r
-title = Seaquence
-tags = code audio www
-notes = this might need to be split up into a few posts
-date = 2010-10-04
---
-
-Alpha release of [Seaquence: A experimental web-based musical ecosystem](http://seaquence.org).
-
-[http://seaquence.org](http://seaquence.org)
+title = Seaquence\r
+tags = audio www\r
+date = 2010-10-04\r
+--\r
+\r
+Alpha release of [Seaquence: A experimental web-based musical ecosystem](http://seaquence.org). \r
+\r
+[http://seaquence.org](http://seaquence.org)\r
-#content {
- padding-bottom:50px; }
+#content {}
#content p:first-child {
margin-top: 0pt;}
+#content.edit textarea {
+ font-family: monaco, monospace;
+ padding:20px;
+ width:100%;
+ font-size:12px;
+ background:#222;
+ color:#eee;
+ height:400px;
+}
+
.caption {
margin-top: 5px;
}
-{"tags":{"datavis":1,"software":1,"stamen":1,"print":1,"installation":2,"code":2,"www":2,"opensource":1,"audio":2,"performance":1,"projection":1,"visual":1,"icosi":2,"fabrication":2,"design":1,"sculpture":1,"mapping":1,"timelapse":1,"photography":1}}
\ No newline at end of file
+{"tags":{"datavis":1,"software":1,"stamen":1,"print":1,"installation":2,"code":2,"www":2,"opensource":1,"projection-mapping":1,"performance":2,"audiovisual":1,"audio":2,"projection":1,"visual":1,"icosi":2,"fabrication":2,"design":1,"sculpture":1,"mapping":1,"timelapse":1,"photography":1}}
\ No newline at end of file
$page_req = LOCAL_ROOT . PAGE_DIR . DIRECTORY_SEPARATOR . $url['url'];
$total = 0;
-
# setup template
$template = 'default.html.tpl';
$t = get_template_instance();
# special endpoints
$dirs = explode('/', $url['url']);
-# tag
-if ($dirs[0] == 'tag') {
- $page_req = LOCAL_ROOT . PAGE_DIR . DIRECTORY_SEPARATOR . $dirs[0];
- if (isset($dirs[1])) {
- $t->assign('tag', $dirs[1]);
- }
-}
+switch($dirs[0]) {
+ case 'tag' :
+ $page_req = LOCAL_ROOT . PAGE_DIR . DIRECTORY_SEPARATOR . $dirs[0];
+ if (isset($dirs[1]))
+ $t->assign('tag', $dirs[1]);
+ break;
+ case 'edit' :
+
+ if (!DEV)
+ break;
+ array_shift($dirs);
+ $newurl = implode($dirs, '/');
+ $content_req = LOCAL_ROOT . CONTENT_DIR . DIRECTORY_SEPARATOR . $newurl;
+ $page_req = LOCAL_ROOT . PAGE_DIR . DIRECTORY_SEPARATOR . $newurl;
+
+ // TODO: Sercurity risk?
+ if ($_SERVER['REQUEST_METHOD'] == 'POST' &&
+ isset($_POST['edited_file_contents']) &&
+ isset($_POST['edited_file'])) {
+ try {
+ $fp = fopen( $_POST['edited_file'], 'w');
+ if ($fp) {
+ fwrite($fp, $_POST['edited_file_contents']);
+ fclose($fp);
+ }
+ if (!file_exists( $_POST['edited_file'] )) {
+ throw new Exception('Error creating tags.json. Permissions?');
+ }
+ } catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+ }
+ $edit = false;
+ } else {
+ $edit = true;
+ }
+}
# content exists, and is a folder
if (is_dir($content_req)) {
# content exists, and is a single entry
else if (is_file($content_req)) {
- $t->assign('data', parse_entry(new SplFileInfo($content_req)));
+ $t->assign('entry', parse_entry(new SplFileInfo($content_req)));
$t->assign('single', true);
$template = 'single.'.$response_format.'.tpl';
}
# content exists, and is a page
else if (is_file($page_req)) {
- $page = parse_entry(new SplFileInfo($page_req), 1);
- $t->assign('data', $page);
- $template = isset($page['config']['template']) ? $page['config']['template'] .
+ $config = parse_entry(new SplFileInfo($page_req), 1);
+ $t->assign('data', $config);
+ $template = isset($config['config']['template']) ? $config['config']['template'] .
'.' . $response_format . '.tpl' : 'page.' . $response_format . '.tpl';
}
$template = '404.html.tpl';
}
+# edit
+if (DEV && isset($edit) && $edit) {
+ $template = 'edit.html.tpl';
+}
+
# render
$t->response_format = $response_format;
$t->assign('view', isset($_GET['v']) ? $_GET['v'] : null);
$file['title'] = isset($file['config']['title']) ? $file['config']['title'] : $fileInfo->getFilename();
$file['filename'] = $fileInfo->getFilename();
$file['path'] = $fileInfo->getPath();
+ $file['fileInfo'] = $fileInfo;
$file['config']['date'] = isset($file['config']['date']) ? $file['config']['date'] : null;
$file['timestamp'] = $file['config']['date'] ? date('U', strtotime( $file['config']['date'])) : $fileInfo->getCTime();
$file['tags'] = isset($file['config']['tags']) ? explode(" ", $file['config']['tags']) : null;
--- /dev/null
+<html>
+<head>
+
+ <? $this->include_template('head-inc.html.tpl') ?>
+
+ <title><?=SITE_TITLE?><?=TITLE_DELIMITER?><?=$entry['title']?></title>
+
+</head>
+<body>
+
+ <? $this->include_template('nav.html.tpl') ?>
+
+<div id="content" class="edit">
+
+ <? if ($entry): ?>
+ <? $fileContents = file_get_contents($entry['fileInfo']); ?>
+
+ <form action="" method="POST">
+ <textarea name="edited_file_contents"><?=$fileContents?></textarea>
+ <input type="hidden" name="edited_file" value="<?=$entry['fileInfo']->getPath().DIRECTORY_SEPARATOR.$entry['fileInfo']->getFilename();?>">
+ <input type="button" onClick="window.location = '<?=$entry['url']?>'"value="cancel">
+ <input type="submit" value="save">
+ </form>
+
+ <? endif; ?>
+
+</div>
+
+ <? $this->include_template('footer.html.tpl') ?>
+
+</body>
+</html>
<a href="<?=$entry['url']?>">→</a>
</div>
<? endif; ?>
+
+<? if (DEV) : ?>
+
+<a href="<?=WEB_ROOT?>edit<?=$entry['cat']['url'] . $entry['filename']?>">edit</a>
+<? endif; ?>
+
<div id="content">
<ul class="projects">
- <? foreach($data as $entry): ?>
+ <? foreach($entries as $entry): ?>
<li>
<a href="<?=$entry['url']?>" class="thumb">
<img src="<?=$entry['thumb']?>" /><br/>
<? $this->include_template('head-inc.html.tpl') ?>
- <title><?=$data['title'];?></title>
+ <title><?=$entry['title'];?></title>
</head>
<body>
<div id="content" class="single entry">
<div class="entry">
- <? $this->include_template('entry.html.tpl', array('data' => $data, 'single' => true)); ?>
+ <? $this->include_template('entry.html.tpl', array('entry' => $entry, 'single' => true)); ?>
</div>
</div>