示例#1
0
function album_content($category_name)
{
    $page_data = "";
    $photos_directory = sculpt_system("content_path") . 'albums/' . $category_name;
    if ($category_name) {
        if (file_exists($photos_directory)) {
            $page_data .= '<h2>' . ucfirst($category_name) . '</h2>';
            if (file_exists($photos_directory . '/index.md')) {
                echo $page_data;
                sculpt_parse_markdown_file($photos_directory . '/index.md');
                $page_data = "";
            }
            $page_data .= '<div id="photos">';
            $photos = glob($photos_directory . '/*.{png,PNG,jpg,JPG,jpeg,JPEG,gif,GIF}', GLOB_BRACE);
            foreach ($photos as $photo) {
                $photo_info = pathinfo($photo);
                $photo_name = $photo_info['filename'];
                $page_data .= album_image_thumb($photo, $photo_name);
            }
            $page_data .= '</div>';
            echo $page_data;
        }
    } else {
    }
}
示例#2
0
function blog_post($post, $is_front = false)
{
    global $blog_directory;
    global $date_format;
    $blog_post_file = $blog_directory . '/' . $post . ".md";
    if (file_exists($blog_post_file)) {
        echo '<div class=blog_text>';
        if (!$is_front) {
            echo '<p class="blog_timestamp">' . date($date_format, strtotime($post)) . '</p>';
            sculpt_parse_markdown_file($blog_post_file, false);
        } else {
            sculpt_parse_markdown_file($blog_post_file, true);
        }
        echo '</div>';
    } else {
        echo $blog_directory;
        show_error(404);
    }
}
示例#3
0
function show_error($error_code)
{
    echo '<div class="pageError">';
    if (file_exists(sculpt_system("error_path") . $error_code . '.md')) {
        sculpt_parse_markdown_file(sculpt_system("error_path") . $error_code . '.md');
    } else {
        if (sculpt_parse_markdown_file(sculpt_system("default_error_path") . $error_code . '.md') > 0) {
            sculpt_system_error($error_code);
        }
    }
    echo '</div>';
}