]> git.quilime.com - plog.git/commitdiff
Getting hierarchyes working again
authorGabriel Dunne <gdunne@quilime.com>
Tue, 18 Jun 2013 04:00:28 +0000 (21:00 -0700)
committerGabriel Dunne <gdunne@quilime.com>
Tue, 18 Jun 2013 04:00:28 +0000 (21:00 -0700)
css/style.css
lib/data.php
lib/model.php
pages/.log [new file with mode: 0644]
pages/.projects [moved from pages/projects with 100% similarity]
templates/entry.html.tpl
templates/log.html.tpl [new file with mode: 0644]
templates/nav.html.tpl
templates/projects.html.tpl

index 7f41147b168db7e9772861804a9aa4c3ac88f454..a3c74a18839901f3222e6303acd05877d3474301 100644 (file)
@@ -252,6 +252,10 @@ table, td, tr {
   height:200px;
 }
 
+.entries.log li {
+height:auto;
+  }
+
 
 .entries.projects ul.tags li {
   height:1.5em;
@@ -306,7 +310,7 @@ table, td, tr {
 .gallery {}
     .single .gallery li {
         display:inline-block;
-        margin-bottom:40px;
+        
         margin:1em 1em 0 0; 
       }
       .gallery.stacked {
index 605aa7d10ae08c5bff235117b90b9e9d46b41ae0..5e288b60e5d30cbfd03d9063f67c3b04d17f2fa6 100644 (file)
@@ -162,7 +162,7 @@ function get_dirs( $path = "", $args = array())
             if (!CLEAN_URLS)
                $d['url'] = WEB_ROOT . '?p=' . clean_slashes($d['url'], true);
             $d['name'] = str_replace($path, "",  $info->getRealPath());
-            $d['title'] = $d['name'];
+            $d['title'] =  ltrim($d['name'],"/");
                        $dirs[] = (object) $d;
                }
        }
@@ -277,8 +277,12 @@ function parse_entry($fileInfo, $page = false)
 
     $file['config'] = parse_ini_string($config);
     $file['path'] = $fileInfo->getPath();
-    $file['basename'] = basename($fileInfo->getPath());
-    $file['dirname'] = dirname($fileInfo->getPath());
+    $get_pathparts = explode('/', $file['path']);
+    $content_key = array_search(CONTENT_DIR, $get_pathparts);
+    $pathparts = array_slice($get_pathparts, $content_key);
+    $file['dirname'] = dirname(join($pathparts, DIRECTORY_SEPARATOR));
+    $file['basename'] = basename(join($pathparts, DIRECTORY_SEPARATOR));
+    //$file['dirname'] = dirname($fileInfo->getPath());
     $file['filename'] = $fileInfo->getFilename();    
     $file['title'] = isset($file['config']['title']) ? $file['config']['title'] : ($page ? $file['filename'] : $file['basename']);
     $file['fileInfo'] = $fileInfo;
@@ -301,16 +305,37 @@ function parse_entry($fileInfo, $page = false)
     
     $file['cat'] = $page ? null : array('name' => trim($cat,'/'), 'url' => WEB_ROOT . trim($cat , '/') . '/' );
 
+
     $file['path'] = $fileInfo->getRealPath();
-    $file['thumb'] = isset($file['config']['thumb']) ? $file['config']['thumb'] : WEB_ROOT . join(DIRECTORY_SEPARATOR, array(CONTENT_DIR, $file['basename'])) . '/thumb.png';
-    $file['url'] = WEB_ROOT .  ($page ? $file['filename'] : $file['basename']);
+    
+    $web_accessable_root = str_replace(CONTENT_DIR, "", $file['dirname']);
+
+    
+    // echo "<br/>";
+
+    $file['thumb'] = isset($file['config']['thumb']) ? $file['config']['thumb'] : WEB_ROOT . join(DIRECTORY_SEPARATOR, array($file['dirname'], $file['basename'])) . '/thumb.png';
+    if ($page) {
+        $file['url'] = WEB_ROOT . ($page ? $file['filename'] : $file['basename']);
+    } else {
+        $file['url'] = $web_accessable_root . DIRECTORY_SEPARATOR . ($page ? $file['filename'] : $file['basename']);
+    }
+    
     $file['edit_url'] = WEB_ROOT . 'edit' . $file['url'];
 
     $file['media_dir'] = join(DIRECTORY_SEPARATOR, array($file['dirname'], $file['basename'], MEDIA));
+
+
     $file['content_dir'] = WEB_ROOT . join(DIRECTORY_SEPARATOR, array(CONTENT_DIR, $file['basename']));
     $file['media'] = is_dir($file['media_dir']) ? (array) get_media( $file['media_dir'] ) : null;
+
+    $gallery_type = isset($file['config']['gallery']) ? $file['config']['gallery'] : null;            
+    $file['media_gallery'] = gallerize_media($file['media'], $gallery_type);
+
     $file['cat'] = (object) $file['cat'];
     $file['config'] = (object) $file['config'];
+
+
+
     
     return (object) $file;
 }
@@ -333,9 +358,7 @@ function get_media( $path ) {
                             $info->getPath(),
                             $info->getFilename())),
                         'url' => WEB_ROOT . join(DIRECTORY_SEPARATOR,  array(
-                            CONTENT_DIR,
-                            basename(dirname($info->getPath())),
-                            basename($info->getPath()), 
+                            $path,
                             $info->getFilename())),
                         'extension' => $info->getExtension()
                         );
index 5094d2e575e88b4063ff11b94ca2799ec257f5b5..85cd0f8c82656f63d6d4d4cf4e40fd590cf38b99 100644 (file)
@@ -130,9 +130,12 @@ class Model
                        $gallery_type = isset($this->entry->config->gallery) ? $this->entry->config->gallery : null;                    
                    if (strpos($this->entry->content, GALLERY_DELIMITER)) {
                        $this->entry->content = str_replace(GALLERY_DELIMITER, gallerize_media($this->entry->media, $gallery_type), $this->entry->content);
-                   } else {
-                       $this->entry->content = gallerize_media($this->entry->media, $gallery_type) . $this->entry->content;
+                       $this->entry->inline_gallery = true;
                    }
+                //     $this->entry->content = gallerize_media($this->entry->media, $gallery_type) . $this->entry->content;
+                //    }
+
+        //     $file['content'] =  str_replace(GALLERY_DELIMITER, gallerize_media($file['media'], $gallery_type), $file['content']);                   
 
                $this->template = isset($this->entry->config->template) ?
                                                        $this->entry->config->template . '.' . $this->response_format . '.tpl' :
diff --git a/pages/.log b/pages/.log
new file mode 100644 (file)
index 0000000..ee06ce5
--- /dev/null
@@ -0,0 +1,2 @@
+title = process
+--
similarity index 100%
rename from pages/projects
rename to pages/.projects
index 4b3758d5e30d36642daf49e2747b876e301fd11b..fe675748e996db1526ca6cb2b0ab6464f9542c43 100644 (file)
@@ -4,6 +4,12 @@
 
 <span class="date"><?=date('Y', $entry->timestamp)?></span>
 
+<?
+       if (!isset($entry->inline_gallery) && isset($entry->media_gallery)) {
+               echo $entry->media_gallery;
+       }
+?>
+
 <div class="content">
        <? eval('?>' . $entry->content); ?>
 </div>
@@ -27,7 +33,7 @@
                        <ul class="related">
                        <? for($i = 0; $i < sizeof($entry->related); $i++) : $rel = $entry->related[$i]; ?>
                                <li class="rel">
-                                       <a href="<?=WEB_ROOT.$rel?>">
+                                       <a href="<?=WEB_ROOT.'projects/'.$rel?>">
                                        <!-- <img src="<?=MEDIA.$rel?>/thumb.png" class="thumb" /><br />-->
                                        <?=$rel?>
                                        </a>
diff --git a/templates/log.html.tpl b/templates/log.html.tpl
new file mode 100644 (file)
index 0000000..ac54b44
--- /dev/null
@@ -0,0 +1,40 @@
+<html>
+<head>    
+    <? $this->include_template('head-inc.html.tpl') ?>
+    <title><?=SITE_TITLE?><?=$this->page_title(TITLE_DELIMITER);?></title>
+</head>
+<body>
+    
+<? $this->include_template('nav.html.tpl') ?>
+
+<? if (EDIT) $this->include_template('edit.html.tpl'); ?>
+    
+<div id="content">
+    
+    <? if (isset($entry->content)): ?>
+        <? eval('?>' . $entry->content); ?>
+    <? endif; ?>
+
+    <ul class="entries log <?=isset($tag)&&$tag!==""?'tagged':''; ?>">
+    <? $entry = 0; foreach($entries as $entry): ?>
+    <div class="entry">
+    <?
+        //if (isset($entry->content_short))
+        //$entry->content = $entry->content_short . '<br /><a class="more" href="' . $entry->url . '">more &rarr;</a><br /><br />';
+        $this->include_template('entry.html.tpl', array('entry' => $entry));
+    ?>
+    </div>
+    <? endforeach; ?>
+
+    </ul>
+</div>
+
+<? $this->include_template('footer.html.tpl') ?>
+
+</body>
+</html>
+
+
+
+
+
index 1f67bb4028377a11d06fc783a4d838862c2054f4..efd5e156061ec5b68e1691e5a767237b849dc41a 100644 (file)
@@ -3,14 +3,14 @@
 
     <li class="home"><a href="<?=WEB_ROOT?>"><?=SITE_TITLE?></a></li>        
     
-    <?
-    /*
-    <? $dirs = get_dirs(''); ?>
+
+    
+    <? $dirs = get_dirs('', array('recursive'=>0)); ?>
     <? foreach($dirs as $e) : ?>
     <li><a href="<?=$e->url?>"><?=$e->title?></a></li>
     <? endforeach; ?>    
-    */
-?>
+    
+
     <? if (!isset($entry->is_single)) {
         $en = get_pages('', $args = array(
         'recursive' => false, 
index d781ae86c131adb7e587513a79873500f84c5df6..92fd30901610bd7f97e3b89edfbfe9d8d4e71e19 100644 (file)
         <? eval('?>' . $entry->content); ?>
     <? endif; ?>
 
-    <br />
-
-    <ul style="float:left;">
-    <? foreach($entries as $entry): ?>    
-        <li>
-            <a href="<?=$entry->url;?>">
-                <strong><?=$entry->title;?></strong>
-            </a>
-        </li>
-    <? endforeach; ?>    
-    </ul>
-
-    <ul style="margin-left:200px;" class="entries projects <?=isset($tag)&&$tag!==""?'tagged':''; ?>">
+    <ul class="entries projects <?=isset($tag)&&$tag!==""?'tagged':''; ?>">
     <? foreach($entries as $entry): ?>
         <li class="entry <?=$entry->cat->name?>">
             <a href="<?=$entry->url;?>">
                 <br />
                 <strong><?=$entry->title;?></strong>
                 </a>
-                <br />
+<!--                 <br />
                 &mdash;
                 <br />
                 <ul class="tags">
                     <? for($i = 0; $i < sizeof($entry->tags); $i++) : $tag = $entry->tags[$i]; ?>
                         <li class="tag"><a href="<?=WEB_ROOT.'tag/'.$tag?>"><?=$tag?></a></li>
                     <? endfor; ?>
-                </ul>                
+                </ul>     -->            
         </li>
     <? endforeach; ?>
     </ul>