コード例 #1
0
ファイル: category.php プロジェクト: natxoraga22/Cockatoo
?>

<!-- Page Content -->
<div class="container">

    <div class="row">

        <!-- Blog Entries Column -->
        <div class="col-md-8">

            <h1 class="page-header">
                Category
                <?php 
if (isset($_GET['id'])) {
    $category_id = $_GET['id'];
    $category = findCategoryById($category_id);
    echo "<small>" . $category['title'] . "</small>";
}
?>
            </h1>
           
            <!-- Blog posts -->
            <?php 
if (isset($_GET['id'])) {
    $category_id = $_GET['id'];
    $posts = getPublishedPostsWithCategory($category_id);
    if (count($posts) == 0) {
        echo "<h3>No posts for this category</h3>";
    }
    foreach ($posts as $post) {
        require "includes/post_data.php";
コード例 #2
0
ファイル: posts.php プロジェクト: natxoraga22/Cockatoo
                                    <th class="hide">ID</th>
                                    <th class="col-xs-3">Title</th>
                                    <th>Author</th>
                                    <th>Category</th>
                                    <th class="col-xs-1">Status</th>
                                    <th>Image</th>
                                    <th class="col-xs-1">Tags</th>
                                    <th>Comments</th>
                                    <th>Date</th>
                                </tr>
                            </thead> 
                            <tbody>
                                <?php 
$posts = getAllPosts();
foreach ($posts as $post) {
    $post_category = findCategoryById($post['category_id']);
    ?>
                                    <tr>
                                        <!-- Checkbox -->
                                        <td>
                                            <div class="checkbox">
                                                <label>
                                                    <input type="checkbox" name="bulk_posts[]" class="bulk-checkbox"
                                                           value="<?php 
    echo $post['id'];
    ?>
">
                                                </label>
                                            </div>
                                        </td>