]> git.quilime.com - plog_bk.git/commitdiff
templates refactor
authorGabriel Dunne <gdunne@quilime.com>
Sun, 30 May 2010 01:37:31 +0000 (18:37 -0700)
committerGabriel Dunne <gdunne@quilime.com>
Sun, 30 May 2010 01:37:31 +0000 (18:37 -0700)
21 files changed:
lib/init.php
lib/output.php
lib/template.php [new file with mode: 0644]
lib/templates/404.html [deleted file]
lib/templates/about.html [deleted file]
lib/templates/agg.html [deleted file]
lib/templates/code.html [deleted file]
lib/templates/css/style.css [deleted file]
lib/templates/default.html.tpl [new file with mode: 0644]
lib/templates/gallery.html.tpl [new file with mode: 0644]
lib/templates/header-src.html [deleted file]
lib/templates/img.html [deleted file]
lib/templates/index.html [deleted file]
lib/templates/links.html [deleted file]
lib/templates/log.html [deleted file]
lib/templates/nav.html [deleted file]
lib/templates/photo.html [deleted file]
lib/templates/projects.html [deleted file]
lib/view.php [deleted file]
public/.htaccess
public/index.php

index 3dfaa6819ea326d441315547de255e0948396405..9ec016769445aefc4dcfae73c9bc3b8135a0440c 100644 (file)
@@ -1,68 +1,33 @@
 <?php
 
-       define('PLOG_ROOT', $_SERVER['DOCUMENT_ROOT'] . '/plog');
-       define('WEBROOT', 'http://' . $_SERVER['SERVER_NAME']);
-       define('TEMPLATE_DIR', dirname(realpath(__FILE__)) . '/../templates');  
-       define('CONTENT_ROOT', $_SERVER['DOCUMENT_ROOT'] . '/content');
-       define('CONTENT_BASEDIR', $_SERVER['DOCUMENT_ROOT'] . '/content' . $_SERVER['SCRIPT_URL']);
-       define('CONTENT_WEBROOT', 'http://' . $_SERVER['SERVER_NAME'] . '/content' . $_SERVER['SCRIPT_URL']);
-       define('CONTENT_SRC', CONTENT_BASEDIR . 'content.php');
-       
-       define('CONFIG', 'config');
-
+       # include path
     ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . dirname(realpath(__FILE__)));
-       require_once 'output.php';
-       require_once 'template.php';
 
+       # includes
+       require_once 'output.php';
+       
        # response format
-       list($response_format, $response_mime_type) = parse_format($_GET['format'], 'html');
-
+       list($response_format, $response_mime_type) = parse_format($_GET['format'], 'html');    
+       
        # template
-       $template = new Template();
-
-       # parse content dir
-       if (is_dir(CONTENT_BASEDIR)) {
-
-               # config
-               if (is_file(CONTENT_BASEDIR . CONFIG))
-                       $config = parse_ini_file(CONTENT_BASEDIR . CONFIG);
-
-               # template
-               if ($config['template'])
-                       $template->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;
-               }
-       }
+       $t = get_template_instance();
+       
+       # parse if content dir exists
+       if (is_dir($t->basedir)) {
+               $t->parse_assets();
+       }               
 
        # header
-//     header("Content-Type: {$response_mime_type}; charset=UTF-8");
-//     $template->render();
+       header("Content-Type: {$response_mime_type}; charset=UTF-8");
+       $t->render(join(".", array($t->template, $response_format, "tpl")));
 
 
 
 // print_r($_SERVER);
-
 //     $images = glob("images/{*.jpg,*.gif,*.png}", GLOB_BRACE);
 //     print_r($images);
-
-
-
-
-//    require_once 'data.php';
-//    require_once 'output.php';
-
-//    define_constants();
+//  require_once 'data.php';
+//  require_once 'output.php';
+//  define_constants();
 
 ?>
\ No newline at end of file
index 7f1c2fe7f479eea27daf78ac1ec402a72ceab7fe..966575edffc965800f06afa5e3bd5a5398f8d04d 100644 (file)
@@ -1,5 +1,20 @@
 <?php
 
+       require_once 'template.php';
+       
+       function get_template_instance()
+       {
+               $t = new Template();
+               $t->basedir = join(DIRECTORY_SEPARATOR, array($_SERVER['DOCUMENT_ROOT'], 'content', $_SERVER['SCRIPT_URL'] . "/"));
+               $t->webroot = join("/", array('http://' . $_SERVER['SERVER_NAME'] . "/" , 'content' , $_SERVER['SCRIPT_URL'] . "/"));
+               $t->url = join("/", array('http://' . $_SERVER['SERVER_NAME'] . "/" , $_SERVER['SCRIPT_URL'] . "/"));           
+               $t->template_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'templates'));
+               $t->content_file = join(DIRECTORY_SEPARATOR, array( $_SERVER['DOCUMENT_ROOT'], 'content', $_SERVER['SCRIPT_URL'], 'content.php'));
+               $t->config_file = join(DIRECTORY_SEPARATOR, array( $_SERVER['DOCUMENT_ROOT'], 'content', $_SERVER['SCRIPT_URL'], 'config'));
+               return $t;
+       }
+       
+
    /**
     * @param    string  $format     "text", "xml", etc.
     * @param    string  $default    Default format
diff --git a/lib/template.php b/lib/template.php
new file mode 100644 (file)
index 0000000..43e7c34
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+
+class Template
+{
+       // public
+       var $template_dir = 'templates';
+       var $content_file = 'content.php';
+       var $config_file  = 'config';
+       var $template = 'default';      
+       var $basedir = null;
+       var $webroot = null;    
+       
+       // private
+    var $_tpl_vars = array();
+       var $_config_vars = array(); 
+       
+       function Template() 
+       {
+       }
+
+
+       function parse_assets()
+       {
+               // get config vars      
+               if (is_file($this->config_file))
+                       $this->_config_vars = parse_ini_file($this->config_file);
+               if (!$this->_config_vars['title'])
+                       $this->_config_vars['title'] = $_SERVER['SCRIPT_URL'];
+               $this->assign('config', $this->_config_vars);
+               
+               // template file
+               if ($this->_config_vars['template'])
+                       $this->template = $this->_config_vars['template'];
+               
+               // content file
+               if (file_exists( $this->content_file ))
+                       $this->assign('content_file', $this->content_file);
+                       
+               // all files    
+               $files = array();
+               foreach(glob($this->basedir . "{*}", GLOB_BRACE|GLOB_MARK) as $file) {
+                       $f = array();
+                       $f['name'] = basename($file);
+                       $f['url'] = str_replace($this->basedir, $this->webroot, $file);
+                       $files[] = $f;
+               }
+               $this->assign('files', $files);
+                       
+               // images
+               $images = array();
+               foreach(glob($this->basedir . "{*.jpg,*.gif,*.png}", GLOB_BRACE) as $img) {
+                       $i = array();
+                       $i['name'] = basename($img);
+                       $i['url'] = str_replace($this->basedir, $this->webroot, $img);
+                       $images[] = $i;
+               }
+               $this->assign('images', $images);
+               
+               // generate thumbs for all images
+               // print_r($this->_config_vars);
+       }
+
+       
+       function render($_template = 'default.html.tpl')
+       {
+               // assign locally accessable template var
+               $t = $this->_tpl_vars;
+               
+               // include template file
+               $template_file = join(DIRECTORY_SEPARATOR, array($this->template_dir, $_template));
+               if (is_file($template_file))
+                       include_once $template_file;
+               else
+                       include_once join(DIRECTORY_SEPARATOR, array($this->template_dir, "default.html.tpl"));
+       }
+       
+       
+    function assign($tpl_var, $value = null)
+    {
+        if (is_array($tpl_var)) {
+            foreach ($tpl_var as $key => $val) {
+                if ($key != '') {
+                    $this->_tpl_vars[$key] = $val;
+                }
+            }
+        } else {
+            if ($tpl_var != '')
+                $this->_tpl_vars[$tpl_var] = $value;
+        }
+    }  
+}
+
+?>
\ No newline at end of file
diff --git a/lib/templates/404.html b/lib/templates/404.html
deleted file mode 100644 (file)
index 6cf670a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<html>
-
-<head>
-
-    <?php include_template('header-src.html'); ?>
-
-    <title><?php echo SITE_TITLE; ?> :404</title>
-    
-</head>
-
-<body>
-    
-    <?php include_template('nav.html'); ?>
-
-    <div id="content">
-        
-        <h1>oops</h1>
-        
-        <p>
-        404
-        </p>
-        
-    </div>
-    
-</body>
-
-</html>
\ No newline at end of file
diff --git a/lib/templates/about.html b/lib/templates/about.html
deleted file mode 100644 (file)
index 81ba936..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<html>
-
-<head>
-
-    <?php include_template('header-src.html'); ?>
-        
-    <title><?php echo SITE_TITLE ?> - about</title>
-    
-</head>
-
-<body>
-    
-    <?php include_template('nav.html'); ?>
-
-    <div id="content">
-
-       &copy; 1997&mdash;<?= date('Y'); ?> <a href="http://gabrieldunne.com">gabriel dunne</a>. All rights reserved.
-    <br/> 
-<br/>          
-       email: <a href="&#x6d;&#x61;&#x69;&#108;&#x74;&#111;&#x3a;&#x67;&#x64;&#x75;&#x6e;&#110;&#x65;&#x40;&#x71;&#117;&#105;&#x6c;&#x69;&#x6d;&#101;&#x2e;&#x63;&#111;&#x6d;">&#x67;&#x64;&#x75;&#x6e;&#110;&#x65;&#x40;&#x71;&#117;&#105;&#x6c;&#x69;&#x6d;&#101;&#x2e;&#x63;&#111;&#x6d;</a>
-       
-
-    </div>
-    
-</body>
-
-</html>
\ No newline at end of file
diff --git a/lib/templates/agg.html b/lib/templates/agg.html
deleted file mode 100644 (file)
index 2dea6e8..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-<html>
-
-<head>
-    
-    <?php include_template('header-src.html'); ?>
-    
-    <title><?php echo SITE_TITLE; ?> - aggregate</title>
-    
-    <link rel="alternate" type="application/rss+xml" title="aggregate" href="http://media.quilime.com/aggregate/?return=rss" />    
-    
-</head>
-
-<body>
-    
-    <?php include_template('nav.html'); ?>
-    
-    <div id="content">
-    
-    <table border="0" id="agg"><tr>
-
-        <td valign="top" class="column">
-        <?php $agg = get_rss_feed('http://media.quilime.com/aggregate/index.php?return=rss'); ?>
-        <h3><a class="mute" href="http://quilime.com/aggregate/">image aggregate</a></h3>
-        <ul class="image">
-
-        <?php 
-        $count = 8;
-        foreach($agg->channel->item as $item) :  
-        if ($count-- == 0) break;
-        ?>    
-        <li title="<?php echo $item->title; ?>">
-            <a href="<?php echo $item->link; ?>">
-                <img src="<?php echo $item->thumb; ?>">
-            </a>
-        </li>
-        <? endforeach; ?>  
-        </ul>
-        <p>
-            <a class="more" href="http://quilime.com/aggregate" title="via quilime.com/aggregate">more &rarr;</a>            
-        </p>
-
-        </td>
-
-
-<?php /*        
-        <td valign="top" class="column">
-        <?php $tube = get_rss_feed('http://gdata.youtube.com/feeds/base/users/kabr/favorites?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile'); ?>
-        <h2><a href="http://www.youtube.com/profile?user=kabr&view=favorites">video </a></h2>
-        <ul class="video">
-        <?php 
-        $count = 11;
-        foreach($tube->channel->item as $tube) :  
-        if ($count-- == 0) break;
-        ?>    
-        <li title="<?php echo str_replace('"', '\'', $tube->title); ?>">
-            <? 
-            $url = $tube->link;
-            $pattern = '/v=(.+?)&/';
-            preg_match($pattern, $url, $matches);
-            $id = $matches[1];
-            ?>
-            <a href="<?php echo $tube->link; ?>">
-
-            <img src="http://i3.ytimg.com/vi/<?=$id?>/default.jpg" />
-            </a>
-        </li>
-        <? endforeach; ?>  
-        </ul>
-        <p>
-            <a class="more" href="http://www.youtube.com/profile?user=kabr&view=favorites" title="via youtube">more &rarr;</a>            
-        </p>
-        </td>
-*/ ?>
-        
-
-        
-
-
-        <td valign="top" class="column">
-        <?php
-        
-               $url = 'https://api.del.icio.us/v1/posts/recent?count=20';
-               $ch = curl_init();
-               curl_setopt($ch, CURLOPT_URL, $url);
-               curl_setopt($ch, CURLOPT_POST, 1);
-               curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
-               curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
-               curl_setopt($ch, CURLOPT_TIMEOUT, 5);
-               curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
-               curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
-               // add delicious.com username and password below
-               curl_setopt($ch, CURLOPT_USERPWD, 'quilime:redsink67');
-               $data = curl_exec($ch);
-               curl_close($ch);     
-               $del = new SimpleXMLElement($data);   
-        
-        ?>
-        <h3><a class="mute" href="http://delicious.com/quilime/">bookmarks</a></h3>
-        <ul class="bookmarks">
-        <?php foreach($del->post as $d) : ?>
-        <li>
-            <a href="<?=$d['href']?>"><?=$d['description'];?></a>
-            <br/>
-
-            <span class="desc"><?=$d['extended'];?></span>
-        </li>
-        <? endforeach; ?>       
-        </ul>
-        <p>
-            <a class="more" href="http://delicious.com/quilime/" title="via delicious">more &rarr;</a>            
-        </p>
-        </td>
-        
-        <? /*
-
-        <td valign="top" class="column">
-        <?php $read = get_rss_feed('http://www.google.com/reader/public/atom/user%2F10925293898931913532%2Fstate%2Fcom.google%2Fbroadcast'); ?>
-        <h2><a href="http://www.google.com/reader/shared/10925293898931913532">reader </a></h2>
-        <ul class="reader">
-        <?php foreach($read->entry as $item) :  ?>    
-        <li>
-            <a href="<?php echo $item->link['href']; ?>"><?php echo $item->title; ?></a>
-        </li>
-
-        <? endforeach; ?>  
-        </ul>
-        <p>
-            <a class="more" href="http://www.google.com/reader/shared/10925293898931913532" title="via google reader">more &rarr;</a>            
-        </p>
-        </td>
-        
-        */ 
-        ?>
-
-
-        
-
-        </tr></table>
-        
-    </div>
-
-    
-</body>
-
-</html>
\ No newline at end of file
diff --git a/lib/templates/code.html b/lib/templates/code.html
deleted file mode 100644 (file)
index 9a16cbb..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-<?php
-
-    $items = array();
-    $single = false;
-    
-    if (is_dir(CONTENT_DIR . $url_string) && !is_file(CONTENT_DIR . $url_string . '/config') ) {
-        list($items_list, $total) = get_content(basename($url_string));
-    }
-    else {
-        $config = parse_config(CONTENT_DIR . $url_string . '/config');
-        $items = $config;
-        $single = true;
-    }
-
-       $inline = isset($_GET['inline']) ? true : false;
-
-
-?>
-<html>
-
-<head>
-    <?php include_template('header-src.html'); ?>
-    <script src="/js/jquery-1.3.2.min.js"></script>
-    
-    <title><?php echo SITE_TITLE; ?> - code<?php if (sizeof($items) > 0 ) : ?>: <?echo strtolower($items['title']); ?> [<?php echo $items['medium']; ?>]<?php endif; ?></title>
-        
-</head>
-
-<body>
-    
-    <?php 
-        include_template('nav.html');         
-    ?>
-
-    <div id="content">
-
-        <?php if ($single) : ?>
-
-                   <h1><a href="/code/">code</a> / <?php echo $items['title']; ?>   <small class="medium">[<?php echo $items['medium']; ?>]</small></h1>
-
-               
-            <div class="content">
-                <?php 
-                    $base_dir = $items['base_dir'];
-                    include_once($items['content']); 
-                ?>
-            </div>
-                   
-       
-        <?php elseif ($inline): ?>
-
-            <h1>code (view <a class="func" href="/code/">list</a>)</h1>         
-            
-            <ul class="inline_content">
-            <?php foreach($items_list as $items): ?>
-                   <li>
-                       <h3>
-                           <a href="<?php echo $items['href']?>"><?php echo $items['title']; ?></a>
-                    <small class="medium">[<?php echo $items['medium']; ?>]</small>
-                    </h3>
-                    <div class="content">
-                    <?php 
-                        $base_dir = $items['base_dir'];
-                        include( $items['content'] ); 
-                    ?>
-                    </div>
-                </li>
-            <?  endforeach; ?>
-            </ul>        
-            
-            
-            
-
-        <?php else: ?>
-
-    
-
-            
-            <h1>code (view <a href="/code/?inline=1">inline</a>)</h1>    
-            
-           
-            <table class="archive" cellspacing="0" cellpadding="0">
-                <?php
-                $c = 1; 
-                foreach($items_list as $items): ?>
-                       <tr>
-                    <td style="text-align:right; padding-right:1em;">
-                        <strong class="medium"><?php echo $items['medium']; ?></strong>
-                    </td>
-                    <td>
-                        <strong>
-                                   <a onmouseout="$('.c_pop').hide();" onmouseover="$('.c_pop').hide(); $('#c_<?php echo $c; ?>').show();" href="<?php echo $items['href']?>"><?php echo $items['title']; ?></a>
-                        </strong>
-                        <div id="c_<?php echo $c; ?>" class="c_pop">
-                        <?php 
-                            $base_dir = $items['base_dir'];
-                            include( $items['content'] ); 
-                        ?>
-                        </div>
-                    </td>
-                    </tr>
-                <? $c++;  endforeach; ?>
-            </table>          
-
-        <?php endif; ?>
-        
-    </div>
-    
-</body>
-
-</html>
\ No newline at end of file
diff --git a/lib/templates/css/style.css b/lib/templates/css/style.css
deleted file mode 100644 (file)
index 2e11517..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-
-body { margin:10px 100px 50px 40px; }
-html, body, table { font-family: helvetica; font-size:11px; line-height:1.5em; color:#222; }
-
-/*selection*/
-::-moz-selection {background: #08f !important; color:#fff;} 
-::selection {background: #08f !important; color:#fff;} 
-
-/*links*/
-a { color:#07e; border:0; text-decoration:none;  }
-a img { border:0; }
-a.mute { color:#555; }
-a:hover, a.mute:hover { color:#fa4; background:#ffa;  text-decoration:none;  }
-.caption a { color:#888;}
-.caption a:hover { color:#905;}
-
-/*headings*/
-h1, h2, h3, h4, h5, h6 { color:#444; font-size:1em; }
-h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { background:#ffe; }
-h1 { margin:0 0 3em 0; }
-h2 { margin:4em 0 0.5em 0; }
-h3 { font-size:1em; margin:0; margin-bottom:0.5em; }
-
-/*code
-pre, .code { font-family: Monaco, monospace; font-size:11px; line-height:1.4em; background:#212121; color:#0f4; padding:1em 2em; }
-span.code { padding:0.5em 1em; }
-*/
-
-blockquote { font-family:times; background:#000; color:#aaa;
-margin:0; font-size:15px; line-height:1.4em; padding:2em 4em; font-style:italic; line-height:1.45em; max-width:600px;}
-
-p { max-width:720px; }
-
-ul { margin:0; padding:0; list-style-type:none; }
-li { margin-bottom:1px; padding:1px; }
-table { margin:0; padding:0; border:0;  }
-table .column { padding-right:100px; min-width:120px; max-width:275px; }
-table .column h2 a { text-decoration:none; }
-table h2, table h3 { margin-bottom:2em;}
-table .video li, table .image li { margin-bottom:2em; }
-table .reader li, table .bookmarks li { margin-bottom:1em; padding-bottom:1em;  border-bottom:1px dotted #ddd; }
-.reader_links li, .bookmark_links li { padding-top:.75em; margin-bottom:.75em; }
-.bookmark_links li a { display:block; }
-.bookmark_links li span { font-style: italic; color:#444; }
-.image li a { background:none;}
-
-.c_pop { position:absolute; background:#fff; display:none; border:5px outset #000; padding:1em 2em; left:260px; z-index:5; } 
-
-.func { font-weight:bold; color:#444; }
-
-#home_arrow { position: absolute; top:11px; left:23px; margin-left:250px; text-decoration:none; }
-
-#content { margin-left:120px; min-width:500px; }
-    #content p {  }
-    ul.inline_content { }
-    ul.inline_content li { margin:0 0 50px 0; padding-bottom:75px;  }    
-    ul.thumbnails    { }
-    ul.thumbnails li { display:inline-block; margin: 0px 60px 60px 0px; }
-    ul.thumbnails .thumbnail { width:160px; height:120px; text-align:center; background:#888; }
-    ul.thumbnails a:hover img { 
-        filter:alpha(opacity=75);
-        -moz-opacity:0.75;
-        -khtml-opacity: 0.75;
-        opacity: 0.75;
-    }     
-    ul.thumbnails a { text-decoration:none;  }   
-    ul.thumbnails .title {  }
-    
-    .date {  font-weight:bold; }    
-
-    .text { font-family:serif; font-size:15px; line-height:2.2em;  margin-top:80px;}
-    .indent { text-indent:3em; }
-    
-.nav { position:fixed; top:1em; left:1em; line-height:1.1em;}
-.nav ul { margin-left:1em; }
-.nav li a { background:#ffe; font-weight:bold; }
-.nav h3 { margin-bottom:0.4em; }
-
-    
-.caption { font-style:italic; margin-top:5px; color:#444; }
-.more, .home { text-decoration:none; color:#000; font-weight:bold; }
-
-#footer {  margin-top:120px; }    
-#footer .copy a { text-decoration:none; }
-
diff --git a/lib/templates/default.html.tpl b/lib/templates/default.html.tpl
new file mode 100644 (file)
index 0000000..0c07c15
--- /dev/null
@@ -0,0 +1,22 @@
+<h1><?=$t['config']['title']?></h1>
+<p>
+       <pre>
+               
+               
+               
+       </pre>
+</p>
+
+<h2>all files</h2>
+<ul>
+       <? foreach($t['files'] as $f): ?>
+       <li><a href="<?=$f['url'];?>"><?=$f['name'];?></a></li>
+       <? endforeach; ?>
+</ul>
+
+<h2>images</h2>
+<ul>
+       <? foreach($t['images'] as $i): ?>
+       <li><img src="<?=$i['url']?>"><br/><?=$i['name'];?></li>
+       <? endforeach; ?>
+</ul>
\ No newline at end of file
diff --git a/lib/templates/gallery.html.tpl b/lib/templates/gallery.html.tpl
new file mode 100644 (file)
index 0000000..eebbdaf
--- /dev/null
@@ -0,0 +1,15 @@
+<h1><?=$t['config']['title']?></h1>
+
+<h2>all files</h2>
+<ul>
+       <? foreach($t['files'] as $f): ?>
+       <li><a href="<?=$f['url'];?>"><?=$f['name'];?></a></li>
+       <? endforeach; ?>
+</ul>
+
+<h2>images</h2>
+<ul>
+       <? foreach($t['images'] as $i): ?>
+       <li><img src="<?=$i['url']?>"><br/><?=$i['name'];?></li>
+       <? endforeach; ?>
+</ul>
\ No newline at end of file
diff --git a/lib/templates/header-src.html b/lib/templates/header-src.html
deleted file mode 100644 (file)
index 05d8973..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">    
-
-<link rel="stylesheet" href="<?= get_template_dir(); ?>css/style.css" type="text/css">
-
-<script type="text/javascript" src="<?= get_base_dir(); ?>/js/jquery-1.3.2.min.js"></script>
-
-<!-- code prettifyier -->
-<link href="<?= get_base_dir(); ?>/js/prettify/prettify.css" type="text/css" rel="stylesheet" />
-<script type="text/javascript" src="<?= get_base_dir(); ?>/js/prettify/prettify.js"></script>
-
-
-
-<script>
- $(document).ready(function() {
-     prettyPrint();
- });
-</script>
\ No newline at end of file
diff --git a/lib/templates/img.html b/lib/templates/img.html
deleted file mode 100644 (file)
index b467cfa..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php 
-
-$img = get_rss_feed('http://api.flickr.com/services/feeds/photos_public.gne?id=28394478@N00&lang=en-us&format=rss_200'); 
-
-?>
-
-<html>
-
-<head>
-    
-    <?php include_template('header-src.html'); ?>
-        
-    <title><?php echo SITE_TITLE; ?> - img</title>
-    
-    <style>
-    
-        ul.image li { float:left; width:240px; height:240px; text-align:center; margin:0 20px 20px 0;}    
-        
-    </style>
-    
-</head>
-
-<body>
-    
-    <?php include_template('nav.html'); ?>
-
-    <div id="content">
-    
-        <ul class="image">
-        <?php foreach($img->channel->item as $item) : ?>
-        <li>
-            <?
-                $subject = $item->description;
-                $pattern = '/<a href="http:\/\/www\.flickr\.com\/photos\/quilime\/(.*) \/><\/a><\/p>/';
-                preg_match($pattern, substr($subject, 3), $matches, PREG_OFFSET_CAPTURE);
-                echo $matches[0][0];
-            ?>
-        </li>
-        <?endforeach; ?> 
-        
-        <div style="clear:both;"></div>
-        
-        <a class="more" href="http://www.flickr.com/photos/quilime/" title="via flickr" >more &rarr;</a>            
-    </div>
-    
-</body>
-
-</html>
\ No newline at end of file
diff --git a/lib/templates/index.html b/lib/templates/index.html
deleted file mode 100644 (file)
index eea502f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<html>
-
-<head>
-    
-    <?php include_template('header-src.html'); ?>
-    
-    <title><?php echo SITE_TITLE; ?></title>
-    
-</head>
-
-<body>
-    
-    <? include_template('nav.html'); ?>
-    
-<div id="content">
-    projects, process log, experiments, code, reference, inspiration, aggregate
-</div>
-    
-</body>
-</html>
diff --git a/lib/templates/links.html b/lib/templates/links.html
deleted file mode 100644 (file)
index 94bfa6c..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<html>
-
-<head>
-
-    <?php include_template('header-src.html'); ?>
-    
-    <title><?php echo SITE_TITLE ?> - links</title>
-    
-</head>
-
-<body>
-    
-    <?php include_template('nav.html'); ?>
-
-    <div id="content">
-
-        <?php
-        
-            function linklist($links)
-            { ?>
-                <?php foreach($links as $l) : ?>
-               <li><a href="<?php echo $l[0];?>"><?php echo $l[1];?></a></li>
-                <?php endforeach; ?>                
-            <?php 
-            }
-        
-            $people = array(
-
-                    array('http://onecm.com', 'ryan alexander'),                    
-                    array('http://ssherriff.com', 'stephanie sherriff'),                                        
-                    array('http://www.oddsympathy.com/', 'daniel massey'),
-                    array('http://pohflepp.com', 'sascha pohflepp'),
-                    array('http://dabkitsch.com/jml', 'jeff lubow'),                    
-                    array('http://jtnimoy.net', 'joshua nimoy'),                                        
-                    array('http://keithpasko.com', 'keith pasko'),                                                            
-                    array('http://fredericeyl.de', 'frédéric eyl'),
-                    array('http://ghost-hack.com', 'michael chang'),                                        
-                    array('http://aaronkoblin.com', 'aaron koblin'),
-                    array('http://mylinhtrieu.com', 'mylinh trieu'),                    
-                    array('http://renataraksha.com', 'renata raksha'),                                        
-                    array('http://universaloscillation.com', 'aaron meyers'),                                                                                
-
-                    array('http://tom-carden.co.uk', 'tom carden'),
-                    array('http://mike.teczno.com', 'michal migurski'),                                        
-
-                
-                    array('http://ripevessel.com', 'adam roth'),
-                    array('http://cenizal.com', 'cj cenizal'),
-                    array('http://davidrager.org', 'david rager'),
-                    array('http://digitanalog.net', 'marc nimoy'),
-                    array('http://makaga.com', 'matthew gale'),
-                    
-                    array(' ', '&nbsp;'),                    
-                                        
-                    array('http://www.thegreeneyl.com/', 'the green eyl'),
-                    array('http://gaffta.org/', 'gaffta')
-                    );
-        ?>
-    
-    
-
-        <ul>
-            <li><a href="http://delicious.com/quilime/">delicious</a></li>
-            <li><a href="http://flickr.com/photos/quilime/">flickr</a></li>
-            <li><a href="http://vimeo.com/quilime/">vimeo</a></li>
-        </ul>
-        
-    
-        <h2>links</h2>
-        <ul>
-            <?php linklist($people); ?>
-        </ul>
-
-    </div>
-    
-</body>
-
-</html>
\ No newline at end of file
diff --git a/lib/templates/log.html b/lib/templates/log.html
deleted file mode 100644 (file)
index 6a61f25..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-<?php
-
-    $single = false;
-    
-    if (is_dir(CONTENT_DIR . $url_string) && !is_file(CONTENT_DIR . $url_string . '/config') ) {
-        list($log_list, $total) = get_content(basename($url_string), "type=flat");
-    }
-    else {
-        $config = parse_config(CONTENT_DIR . $url_string);
-        $log = $config;
-        $base_dir = $log['base_dir'];        
-        $single = true;        
-    }
-    
-    $list = isset($_GET['list']) ? $_GET['list'] : false;
-    
-?>
-<html>
-
-<head>
-
-    <?php include_template('header-src.html'); ?>
-        
-    <title>
-        <?php echo SITE_TITLE; ?><?php if ($single) : ?> - log: <?echo strtolower($log['title']); ?> [<?php echo date("Y M d", strtotime($log['date']));?>]<? else: ?> - log<? endif; ?></title>
-
-    <script src="/js/jquery-1.3.2.min.js"></script>
-
-</head>
-
-<body>
-    
-    <?php include_template('nav.html'); ?>
-
-    <div id="content">
-
-        <?php if ($single) : ?>
-
-               <h1><a href="/log/">log</a> / <span class="date"><?php echo date("m/d/Y", $log['timestamp']); ?></span> <?php echo $log['title']; ?></h1>    
-            
-            <div class="content">
-            <?php echo $log['inline_content']; ?>
-            </div>
-                                
-        <?php elseif ($list): ?>
-
-        
-           <table class="archive" cellspacing="0" cellpadding="0">
-                <tr>
-                <td style="text-align:right; padding-right:1em;">
-             
-                </td>
-                <td>
-                </td>
-                <?php 
-                    $c = 1; 
-                    foreach($log_list as $log): 
-                ?>
-                <tr>
-                <td style="text-align:right; padding-right:1em;">
-                <span class="date"><?php echo date("m/d/Y", $log['timestamp']); ?></span>
-                </td>
-                <td>
-                    <strong>
-                                   <a onmouseout="$('.c_pop').hide();" onmouseover="$('.c_pop').hide(); $('#c_<?php echo $c; ?>').show();" href="<?php echo $log['href']?>"><?php echo $log['title']; ?></a>
-                               </strong>
-                    <div id="c_<?php echo $c; ?>" class="c_pop">
-                    <?php 
-                        $base_dir = $log['base_dir'];
-                        echo $log['inline_content']; 
-                        ?>
-                    </div>
-                </td>
-                </tr>
-            <?  $c++;  endforeach; ?>
-            </table> 
-            
-            <br/>
-            
-                <a class="func" href="/log/">view inline</a>
-          
-            
-
-
-            
-        <?php else: ?>
-            
-            <ul class="inline_content log">
-            <?php foreach($log_list as $log): ?>
-                   <li>
-                       <h3>
-                           <span class="date"><?php echo date("m/d/Y", $log['timestamp']); ?></span>     
-                           <a title="<?php echo get_relative_time($log['timestamp']); ?>" href="<?php echo $log['href'];?>">
-                               <?php echo $log['title']; ?></a>  
-                       </h3>                    
-                    <?php echo $log['inline_content']; ?>
-                </li>
-            <? endforeach; ?>
-            </ul>
-            
-            <br/>            
-            <a class="func" href="/log/?list=1">vew archive</a>
-           
-            
-        <?php endif; ?>
-                
-    </div>
-    
-</body>
-
-</html>
\ No newline at end of file
diff --git a/lib/templates/nav.html b/lib/templates/nav.html
deleted file mode 100644 (file)
index 8c91bdb..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<ul class="nav">          
-    
-    <h3>
-        <strong><a class="mute" href="/"><?= SITE_TITLE ?></a></strong>
-    </h3>
-    by gabriel dunne
-
-    <br/>
-    <br/>    
-
-    <li><a href="/log/">log</a></li>
-    <li><a href="/projects/">projects</a></li>
-    <li><a href="/code/">code</a></li>
-    <li><a href="/img/">img</a></li>    
-
-    <br/>
-    
-    <li><a href="/agg/">aggregate</a></li>
-    <li><a href="/links/">links</a></li>
-    <li><a href="/about/">about</a></li>    
-    
-    <br/>
-    
-    
-</ul>  
diff --git a/lib/templates/photo.html b/lib/templates/photo.html
deleted file mode 100644 (file)
index e74efc5..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php 
-
-$img = get_rss_feed('http://api.flickr.com/services/feeds/photos_public.gne?id=28394478@N00&lang=en-us&format=rss_200'); 
-
-?>
-
-<html>
-
-<head>
-    
-    <?php include_template('header-src.html'); ?>
-        
-    <title><?php echo SITE_TITLE; ?> :photo</title>
-    
-    <style>
-    
-        ul.image li { float:left; width:240px; height:240px; text-align:center; margin:0 50px 50px 0;}    
-        
-    </style>
-    
-</head>
-
-<body>
-    
-    <?php include_template('nav.html'); ?>
-
-    <div id="content">
-
-       <h1>images</h1>
-    
-        <ul class="image">
-        <?php foreach($img->channel->item as $item) : ?>
-        <li>
-            <?
-                $subject = $item->description;
-                $pattern = '/<a href="http:\/\/www\.flickr\.com\/photos\/quilime\/(.*) \/><\/a><\/p>/';
-                preg_match($pattern, substr($subject,3), $matches, PREG_OFFSET_CAPTURE);
-                echo $matches[0][0];
-            ?>
-        </li>
-        <?endforeach; ?> 
-        
-        <div style="clear:both;"></div>
-        
-        <a href="http://www.flickr.com/photos/quilime/" title="via flickr" class="more">more via flickr &rarr;</a>            
-    </div>
-    
-</body>
-
-</html>
\ No newline at end of file
diff --git a/lib/templates/projects.html b/lib/templates/projects.html
deleted file mode 100644 (file)
index 6e80fd0..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-
-    $projects = array();
-    $single = false;
-    
-    if (is_dir(CONTENT_DIR . $url_string) && !is_file(CONTENT_DIR . $url_string . '/config') ) {
-        list($projects_list, $total) = get_content(basename($url_string));
-    }
-    else {
-        $config = parse_config(CONTENT_DIR . $url_string . '/config');
-        $project = $config;
-        $single = true;
-    }
-
-?>
-<html>
-
-<head>
-
-    <?php include_template('header-src.html'); ?>
-    
-    <title><?php echo SITE_TITLE; ?> - projects<?php if (sizeof($projects) > 0 ) : ?>: <?echo strtolower($project['title']); ?> [<?php echo $project['medium']; ?>]<?php endif; ?></title>
-    
-</head>
-
-<body>
-    
-    <?php include_template('nav.html'); ?>
-
-    <div id="content">
-        
-        
-        <?php if ($single) : ?>
-
-           <h1><a href="<?php echo get_base_dir(); ?>/projects">projects</a> / <?php echo $project['title']; ?></h1>    
-            <?php
-                $base_dir = $project['base_dir'];
-                include_once($project['content']);
-            ?>
-                    
-        <?php elseif ($list): ?>
-
-        <?php else: ?>
-             <p>
-                 <a href="http://gabrieldunne.com/projects/">current</a><br/>
-                 <a href="http://portfolio.quilime.com/2008/">2008</a><br/>
-                 <a href="http://portfolio.quilime.com/new/port.php">2007</a><br/>            
-                 <a href="http://portfolio.quilime.com/recent.html">2004 - 2006</a>
-             </p>
-             
-             <!--
-            <ul class="thumbnails">
-            <?php foreach($projects_list as $project): ?>
-                   <li>
-                       <a href="<?php echo $project['href']?>">
-                           <div class="thumbnail" title="<? echo $project['title'] ?>">
-                               <?php if(isset($project['thumb'])) :?>
-                               <img src="<?php echo $project['thumb']; ?>" />
-                               <?php endif; ?>
-                               </div>
-                           <div class="title"><? echo $project['title']; ?></div>
-                       </a>
-                </li>
-            <? endforeach; ?>
-            </ul>
-            -->     
-            
-        <?php endif; ?>
-        
-    </div>
-    
-</body>
-
-</html>
\ No newline at end of file
diff --git a/lib/view.php b/lib/view.php
deleted file mode 100644 (file)
index e709477..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-
-       class Template
-       {
-               var $src;
-               
-               function set_src( $template_src )
-               {
-                       echo "this is a test";
-                       $this->src = $template_src;
-               }
-               
-               function render()
-               {
-                       echo "test";
-                       echo $this->src;
-               }
-       }
-
-?>
\ No newline at end of file
index 7ca81dd4ecbee8baafaef3e50e9118fa3f0db844..7c2959ed049fd33e581a68d786f8cb7893766d5a 100644 (file)
@@ -1,8 +1,12 @@
-
 <IfModule mod_rewrite.c>
+
        RewriteEngine On
        RewriteBase /
        RewriteCond %{REQUEST_FILENAME} !-f
        #RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . index.php [L]
+       
+       RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
+       RewriteRule . %1/%2 [R=301,L]   
+       
 </IfModule>
index a9be48aae4138702ba2c0569403984155c882e48..e5dc7785c40ec61413af8c6614edb5303c42a920 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
-    require_once "./plog/lib/init.php";
+       # include location of init.php file
+    require_once "/home/quilime/plog/plog/lib/init.php";
 
 ?>