<?php register_page("albums", 'index.php?p=albums'); register_text_engine("albums", "albums/album_page.php"); register_stylesheet(sculpt_system("plugin_path") . "albums/album_styles.css"); register_script(sculpt_system("plugin_path") . "albums/album.js"); function album_categories_list($active_album) { $directory = sculpt_system("content_path") . 'albums'; $page_data = ''; $page_data .= '<ul>'; if (file_exists($directory)) { $categories = glob($directory . '/*', GLOB_ONLYDIR); foreach ($categories as $category) { $category_parts = pathinfo($category); $category_name = $category_parts['filename']; if (!$active_album) { $active_album = $category_name; } if ($category_name === $active_album) { $category_class = "active_tab"; } else { $category_class = "inactive_tab"; } $page_data .= '<li class="' . $category_class . '"><a href=index.php?p=albums&sac=' . $category_name . '>' . ucfirst($category_name) . '</a></li>'; } } $page_data .= '</ul>'; echo $page_data; return $active_album; }
<?php // Markdown blogging engine, as a plugin. include_once "blog/blog_settings.php"; // How about instead of a special page, check current page in pagetext to see if it's registered. then get pagetext processes the page different. register_page($blog_page_title, 'index.php?p=Blog'); register_text_engine($blog_page_title, "blog/blog_start.php"); function blog_front_page() { global $blog_directory; if (file_exists($blog_directory)) { $article_list = array_diff(scandir($blog_directory, 1), array('..', '.')); if (count($article_list) > 2) { foreach ($article_list as $key => $article) { $file_part = pathinfo($article); if ($file_part['extension'] === 'md' || $file_part['extension'] === 'html') { $article_date = $file_part['filename']; if ($key === 0) { echo '<div class=first_post>'; echo '<h2 class="blog_title"><a href=index.php?p=Blog&bp=' . $article_date . '>' . blog_get_title($article_date) . '</a></h2>'; blog_post($article_date, true); echo '</div>'; } elseif ($key > 4) { break; } else { echo '<h3 class="blog_title"><a href=index.php?p=Blog&bp=' . $article_date . '>' . blog_get_title($article_date) . '</a></h3>'; } } } echo '<p><a href="index.php?p=Blog&bp=archive">View Archives</a></p>'; } else {