Beispiel #1
0
            echo $category->getName();
        }
    }
}
?>
</h2>

        <?php 
$list = new BzdList();
foreach (Post::getList() as $post) {
    // Ignore comments
    if ($post->getParent() != null) {
        continue;
    }
    if ($type == "user" && $post->getUser()->getID() == $user->getID()) {
        $list->add($post);
    }
    if ($type == "date" && $post->getDate()->format("Y") == $_GET['y'] && $post->getDate()->format("m") == $_GET['m']) {
        $list->add($post);
    }
    if ($type == "category" && $post->getCategory()->getID() == $_GET['c']) {
        $list->add($post);
    }
}
foreach ($list as $post) {
    ?>
            <div class="post" id="post-<?php 
    echo $post->getID();
    ?>
">
                <a href="post.php?id=<?php 
Beispiel #2
0
 /**
  * @codeCoverageIgnore
  */
 public static function getList()
 {
     $list = new BzdList();
     $sql = mysqli_query(Database::connect(), "SELECT ID, Name FROM " . Database::PREFIX() . "Category");
     while ($fetch = mysqli_fetch_array($sql)) {
         $id = $fetch['ID'];
         $name = $fetch['Name'];
         $list->add(new Category($id, $name));
     }
     return $list;
 }