From: Gabriel Dunne Date: Fri, 9 Jul 2010 23:51:44 +0000 (-0700) Subject: permalinks X-Git-Url: https://git.quilime.com/?a=commitdiff_plain;h=2763f21c85e6937d517b23e020a3d9fa3c14a1af;p=plog.git permalinks --- diff --git a/lib/data.php b/lib/data.php index 7d26c36..e20e402 100644 --- a/lib/data.php +++ b/lib/data.php @@ -113,9 +113,9 @@ function parse_entry($fileInfo, $page = 0) $file['timestamp'] = $file['config']['date'] ? date('U', strtotime( $file['config']['date'])) : $fileInfo->getCTime(); $file['tags'] = $file['config']['tags'] ? explode(" ", $file['config']['tags']) : null; $file['content'] = Markdown($content); - $file['cat'] = $page ? null : substr(clean_slashes(str_replace(LOCAL_ROOT . CONTENT_DIR, "", $fileInfo->getPath())),1); + $file['cat'] = $page? null : substr(clean_slashes(str_replace(LOCAL_ROOT . CONTENT_DIR, "", $fileInfo->getPath())),1); $file['path'] = $fileInfo->getRealPath(); - $file['url'] = WEB_ROOT . $file['cat'] . $fileInfo->getFilename(); + $file['url'] = WEB_ROOT . ($page ? '' : $file['cat'] . '/' ) . $fileInfo->getFilename(); return $file; }