$t = get_template_instance();
$t->response_format = $response_format;
$t->assign('view', $_GET['v']);
-
+
# is folder
if (is_dir(LOCAL_ROOT . CONTENT_DIR . $url_parts['url']) && $url_parts['url'] != "/") {
list($data, $total) = get_entries($url_parts['url']);
$template = 'single.'.$response_format.'.tpl';
}
# is page
- else if (is_file( LOCAL_ROOT . PAGE_DIR . $url_parts['url'])) {
- $page = parse_entry(new SplFileInfo(LOCAL_ROOT . PAGE_DIR . $url_parts['url']), 1);
+ else if (is_file( LOCAL_ROOT . PAGE_DIR . DIRECTORY_SEPARATOR . $url_parts['filename'])) {
+ $page = parse_entry(new SplFileInfo(LOCAL_ROOT . PAGE_DIR . DIRECTORY_SEPARATOR . $url_parts['filename']), 1);
$t->assign('data', $page);
$template = $page['config']['template'] ? $page['config']['template'] . '.' . $response_format . '.tpl' : 'page.' . $response_format . '.tpl';
}