From: Gabriel Dunne Date: Tue, 18 Jun 2013 04:00:28 +0000 (-0700) Subject: Getting hierarchyes working again X-Git-Url: https://git.quilime.com/?a=commitdiff_plain;h=a59aaa18eb4df640f8ec6b8439ebb59af1a099b2;p=plog.git Getting hierarchyes working again --- diff --git a/css/style.css b/css/style.css index 7f41147..a3c74a1 100644 --- a/css/style.css +++ b/css/style.css @@ -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 { diff --git a/lib/data.php b/lib/data.php index 605aa7d..5e288b6 100644 --- a/lib/data.php +++ b/lib/data.php @@ -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 "
"; + + $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() ); diff --git a/lib/model.php b/lib/model.php index 5094d2e..85cd0f8 100644 --- a/lib/model.php +++ b/lib/model.php @@ -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 index 0000000..ee06ce5 --- /dev/null +++ b/pages/.log @@ -0,0 +1,2 @@ +title = process +-- diff --git a/pages/projects b/pages/.projects similarity index 100% rename from pages/projects rename to pages/.projects diff --git a/templates/entry.html.tpl b/templates/entry.html.tpl index 4b3758d..fe67574 100644 --- a/templates/entry.html.tpl +++ b/templates/entry.html.tpl @@ -4,6 +4,12 @@ timestamp)?> +inline_gallery) && isset($entry->media_gallery)) { + echo $entry->media_gallery; + } +?> +
' . $entry->content); ?>
@@ -27,7 +33,7 @@