]> git.quilime.com - plog.git/commitdiff
updated rss, json feed and templates
authorGabriel Dunne <gdunne@quilime.com>
Sat, 19 May 2012 02:34:10 +0000 (19:34 -0700)
committerGabriel Dunne <gdunne@quilime.com>
Sat, 19 May 2012 02:34:10 +0000 (19:34 -0700)
13 files changed:
css/style.css
index.php
lib/init.php
lib/model.php
lib/output.php
lib/view.php
pages/about
templates/default.html.tpl
templates/default.json.tpl
templates/default.rss.tpl
templates/entry.html.tpl
templates/index.html.tpl
templates/nav.html.tpl

index fa34c07f2e8884d0c37c8dc99281a98b7c6e968e..726e4e09ec4b46af03f9b09ecfd6b9a647c24f25 100644 (file)
@@ -32,6 +32,7 @@ h1 {
     padding-top:0;
     margin-top:0;
     margin-bottom:30px;
+    font-size
 }
 h1, h2, h3, h4, h5, h6 {
     font-weight:normal;
@@ -44,6 +45,9 @@ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
     text-decoration:none;
     color:#666;
 }
+h1 a {
+  color:#f0a;
+}
 h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover {
   color:#fff;
 }
@@ -90,8 +94,7 @@ table, td, tr {
 }
 
 #content {
-  position:relative;
-  left: 160px;
+  padding-left: 160px;
   margin-top:20px;
   padding-bottom: 20px;
 }
@@ -128,7 +131,7 @@ background:rgba(25,25,25,0.3);
   margin-bottom:100px;
 }
 .entry .metadata {
-  visibility:hidden;
+  /*visibility:hidden;*/
 }
 .entry:hover .metadata{
   visibility:visible;
@@ -142,6 +145,8 @@ background:rgba(25,25,25,0.3);
 }
 .entry h1 {
     margin-bottom:5px;
+    position:relative;
+    left:-1.65em;
 }
 .entry h1 a {
 }
@@ -179,6 +184,8 @@ background:rgba(25,25,25,0.3);
     display:inline-block;
     margin-right:10px;
     margin-bottom:40px;
+    width:120px;
+    font-size:12px;
 }
 .thumb {
   width:100px;
index a41ee497595cdf644083736c5bf4164cbd84fb74..e90338283a015402364f6081fa80b7fbdf979da9 100644 (file)
--- a/index.php
+++ b/index.php
@@ -28,7 +28,6 @@ else if ($m->is_multiple())
 
 
 
-
 header("Content-Type: {$m->response_mime_type}; charset=UTF-8");
 $v->render( $m->template );
 
index 6ac949c0f20762909f55c20f16fb04e6671980f9..c7292b6407697e37677c17102c59d4db949938bc 100644 (file)
@@ -13,7 +13,7 @@ error_reporting(E_ALL);
 ini_set("display_errors", 1);
 
 # timezone
-putenv('TZ=Asia/Calcutta');
+putenv('TZ=America/Los Angeles');
 
 # include path
 ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . dirname(realpath(__FILE__)));
index 86a5ddff47bb19c5e238272b97aff4ceaff00d8f..d4db65fa75da765f946c98e1b70f4197b07760e0 100644 (file)
@@ -6,11 +6,11 @@ class Model
        var $content_request = null;
        var $page_request = null;
 
+       var $template = 'default.html.tpl';
        var $response_format = 'html';
        var $response_mime_type = 'text/html';
-       var $page_title = null;
-       var $template = 'default.html.tpl';
 
+       var $page_title = null;
        var $entries = null;
        var $config = null;
 
@@ -18,7 +18,8 @@ class Model
        function __construct( $request )
        {
                $this->request = $request;
-               list($this->response_format, $this->response_mime_type) = parse_format($this->request['extension'], 'html');
+               list($this->response_format, $this->response_mime_type) = parse_format($this->request['extension']);    
+               $this->template = 'default.' . $this->response_format . '.tpl';
                $this->parse_request( $this->request );
        }
 
@@ -29,14 +30,14 @@ class Model
                $this->content_request = join(array($this->request['dirname'], $this->request['filename']), DIRECTORY_SEPARATOR );
                $this->page_request    = $this->request['filename'];
 
+
            # if entries (dir in CONTENT dir)
            if ($this->is_multiple()) {
                        # check if config file exists in dir
                    if ($this->has_config()) {
                        $this->config = parse_config( $this->content_request );
-                       if (isset($this->config['config']['template'])) {
+                       if (isset($this->config['config']['template']))
                                $this->template = $this->config['config']['template'] . '.' . $this->response_format . '.tpl' ;
-                       }
                    }
                $this->entries = get_entries( $this->content_request );
                $this->page_title = preg_replace('{^/|/$}', '', $this->request['path']);
index 442d1f9e30e98593a68eb8414d4b5c29950e373e..c40ebe6e673c93584d71d36b8d4bace4bee8c1a2 100644 (file)
@@ -5,7 +5,7 @@
  *     @param format
  *  @param default format
  */
-function parse_format($format, $default)
+function parse_format($format, $default = 'html')
 {
     $types = array('html' => 'text/html',
                    'php'  => 'text/html',
@@ -164,7 +164,7 @@ function get_request()
 
     $path_info = pathinfo( $path );
     $path_info['path'] = preg_match("/\.\.\//", $path) ? '/' : $path;
-    $path_info['extension'] = null;
+    $path_info['extension'] = isset($path_info['extension']) ? $path_info['extension'] : 'html';
     if ($path_info['dirname'] == '.')
         $path_info['dirname'] = '';
 
index bbd8e17c18801a9aa457d0c546f740e736c4dbe5..a6c8d015b62a3f84eb3c4ba9283247449cde85a6 100644 (file)
@@ -7,6 +7,7 @@ class View
 {      
        var $template_dir = 'templates';
        // var $template_cache_dir = 'cache';
+    var $default_template = 'default';
        var $response_format = 'html';
        var $response_mime_type = 'text/html';
 
@@ -42,6 +43,8 @@ class View
        public function render( $template ) 
        {
                extract( $this->_tpl_vars );
+        if (!is_file($this->template_dir . DIRECTORY_SEPARATOR . $template))
+            $template = $default_template . '.' . $response_format . '.tpl';
                include( $this->template_dir . DIRECTORY_SEPARATOR . $template );
        }
        
index 76643c4d1a03d7118ae850ff12ca8818ed9195fc..a5dbc1b797bcd79bdac2543994cbd25752edeb25 100644 (file)
@@ -3,13 +3,18 @@ title = about
 
 #about
 
-quilime is an ongoing collection of projects, sketches, ideas, and process by **gabriel dunne** ([www](http://gabrieldunne.com), [email](&#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;))
+quilime.com is a place for my experiments, process. My web portfolio.
 
-quilime.com is built with <a href="http://git.quilime.com/?p=plog.git;a=summary">plog</a>, a static-file `p`roject`log` engine written in PHP.
+this site is built with <a href="http://git.quilime.com/?p=plog.git;a=summary">plog</a>, a static-file `p`roject`log` engine written in PHP.
 
 
+<br />
 <!--add <a href="http://quilime.com/.rss" class="rss">.rss</a>-->
 
+## contact
+gabriel dunne  
+[www](http://gabrieldunne.com), [email](&#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;)
+
 <br />
 
 ## related
@@ -23,8 +28,3 @@ quilime.com is built with <a href="http://git.quilime.com/?p=plog.git;a=summary"
 [vimeo](http://vimeo.com/quilime/)  
 [github](http://github.com/quilime/)  
 [flickr](http://flickr.com/photos/quilime/)  
-
-
-
-
-
index f68fa2c7795c2661b5b597e1258e95e06dca1059..1bb277a3616d67b638807742359b2e16bada353e 100644 (file)
@@ -1,10 +1,3 @@
-<?php
-
-    if (!isset($entries)) {
-        $entries = get_entries();
-    }
-
-?>
 <html>
 <head>
     <? $this->include_template('head-inc.html.tpl') ?>
index 712719bb805400eae87ea46de2c77593b5a78a6b..d3db7e372ecb7d3f5d29c81dd6ac8cb6dfb2f9f6 100644 (file)
@@ -1,5 +1,3 @@
 {
-    "entries": <? print json_encode($entries); ?>,
-    "count": <?=$total?>, 
-    "total": <?=$total?>
+    "entries": <? print json_encode($entries); ?>
 }
index 21cd06e018479730ec0c49f2ea0d1285cac0ae25..2c8cd1a1e49b1d5f58aa3fb89f954ce154aa16a5 100644 (file)
@@ -6,15 +6,15 @@
        <atom:link rel="hub" href="<?=WEB_ROOT?>" xmlns:atom="http://www.w3.org/2005/Atom"/>
 
        <title><?=SITE_TITLE?></title>
-       <link><?=WEB_ROOT?></link>
+       <link><?=$_SERVER['SCRIPT_URI'];?></link>
        <description></description>
 
-       <? foreach($data as $entry): ?>
+       <? foreach($entries as $entry): ?>
        <item>
                <title><?=$entry['title']?></title>
                <description><?=htmlentities($entry['content']);?></description>
-               <link><?=$entry['url']?></link>
-               <guid><?=$entry['url']?></guid>
+               <link>http://<?=get_domain_name() . '/' . $entry['url']?></link>
+               <guid>http://<?=get_domain_name() . '/' . $entry['url']?></guid>
                <pubDate><?=date('r', $entry['timestamp'])?></pubDate>          
        </item>
        <? endforeach; ?>               
index bd253b6c98062bb31ea43d38efac42b722b0f2f8..6e5fd00ba63bb319f974557439a7d6ef0dafed98 100644 (file)
@@ -13,7 +13,7 @@
                <a href="/<?=$entry['url']?>">#</a>
                <br />
                <span title="<?=get_relative_time($entry['timestamp']);?>"><?=date("F d, Y", $entry['timestamp'])?></span> in
-               <a href="/<?=$entry['cat']['url'];?>">/<?=$entry['cat']['url'];?></a><? if ($entry['tags']) echo '<br/>tags: ' . implode(', ', $entry['tags']); ?>
+               <a href="/<?=$entry['cat']['url'];?>">/<?=$entry['cat']['url'];?></a><? if ($entry['tags']) echo '<br/>' . implode(', ', $entry['tags']); ?>
        </div>
 
        <? 
index ef600e34fea4d81ef010526fd587bdb8b35e6f38..a09fc6cb25153c38b0d5e87da4692aa85b8f3dec 100644 (file)
 
        <tr>
 
-       <td  style="padding-right:100px;"  valign="top">
-               <h1><a href="/log/">log</a></h1>
-               <ul class="archive">
-               <? $c=15; foreach(get_entries('log/') as $entry): if ($c--==0) break; ?>
-               <li>
-               <a href="<?=$entry['url']?>" title="<?=date("m d Y", $entry['timestamp'])?>"><?=$entry['title']?></a>
-               </li>
-               <? endforeach; ?>       
-               </ul>   
-               <br />
-               <p><a class="more" href="/log/">more &rarr;</a></p>
-       </td>
-       
-       <td  style="padding-right:100px;"  valign="top">
-               <h1><a class="more" href="/code/">code</a></h1>
-               <ul class="archive">
-               <? $c=15; foreach(get_entries('code/') as $entry): if ($c--==0) break; ?>
-               <li>
-               <a href="<?=$entry['url']?>" title="<?=date("m d Y", $entry['timestamp'])?>"><?=$entry['title']?></a>
-               </li>
-               <? endforeach; ?>       
-               </ul>
-
-               <br />
-
-               <p><a class="more" href="/code/">more &rarr;</a></p>
-       </td>
-
-       <td valign="top">
-               <h1><a href="/projects/">projects</a></h1>
-               <ul class="projects">
-               <? $c = 0;  ?>
-               <? foreach(get_entries('projects/') as $entry): $c++; ?>
-               <li class="project">
-                       <a href="<?=$entry['url']?>">
-                   <div class="thumb">
+    <td valign="top" style="max-width:680px;">
+        <h1><a href="/projects/">projects</a></h1>
+        <ul class="projects">
+        <? $c = 0;  ?>
+        <? foreach(get_entries('projects/') as $entry): $c++; ?>
+        <li class="project">
+            <a href="<?=$entry['url']?>">
+                <div class="thumb">
             <? if (isset($entry['config']['thumb'])): ?>
             <img src="<?= $entry['config']['thumb']?>">
             <? else : ?>
-
                 <canvas id="thumb_<?=$c?>" width="100" height="100"></canvas>
-
                 <script>
                     var canvas = document.getElementById('thumb_<?=$c?>');
                     if(canvas && canvas.getContext) {
                 </script>
 
             <? endif; ?>
-                   </div>
-                       <?=$entry['title']?></a>
+                </div>
+            <?=$entry['title']?></a>
+        </li>
+        <? endforeach; ?>   
+        </ul>
+    </td>        
+
+       <td  style="padding-right:100px;"  valign="top">
+               <h1><a href="/log/">log</a></h1>
+               <ul class="archive">
+               <? $c=15; foreach(get_entries('log/') as $entry): if ($c--==0) break; ?>
+               <li>
+               <a href="<?=$entry['url']?>" title="<?=date("m d Y", $entry['timestamp'])?>"><?=$entry['title']?></a>
                </li>
                <? endforeach; ?>       
-               </ul>                   
+               </ul>   
+       </td>
+       
+       <td  style="padding-right:100px;"  valign="top">
+               <h1><a class="more" href="/code/">code</a></h1>
+               <ul class="archive">
+               <? $c=15; foreach(get_entries('code/') as $entry): if ($c--==0) break; ?>
+               <li>
+               <a href="<?=$entry['url']?>" title="<?=date("m d Y", $entry['timestamp'])?>"><?=$entry['title']?></a>
+               </li>
+               <? endforeach; ?>       
+               </ul>
        </td>
 
        </tr>
        </table>        
 
 
-<br /><br/>
-
-<a href="/all">all posts &rarr;</a>
 
 </div>
 
index 28e773d46df5ac0d2d54f7e18d5bc873b38eb9f6..f2e1f6c70671a3fbf365a0828d212115550744ae 100644 (file)
@@ -15,6 +15,8 @@
        <!-- <li><a href="/agg">aggregate</a></li> -->
        <li><a href="/photo">photo</a></li>
        <li><a href="/links">links</a></li>
+
+       <br />
        <li><a href="/about">about</a></li>
 
        <br />