Ejemplo n.º 1
0
    public $author;
    public $date;
    public $tags = array();
    public function __construct($title, $description, $author, $date)
    {
        $this->title = $title;
        $this->description = $description;
        $this->author = $author;
        $this->date = $date;
    }
}
$interface = new databaseInterface();
if (isset($_GET['search'])) {
    if ($_GET['search'] == 'latest') {
        if (isset($_GET['tag'])) {
            $result = $interface->getByTag(htmlspecialchars($_GET['tag']), 'blog_items', 'date');
        } else {
            $result = $interface->getByDate('blog_items');
        }
    } else {
        if ($_GET['search'] == 'popular') {
            if (isset($_GET['tag'])) {
                $result = $interface->getByTag(htmlspecialchars($_GET['tag']), 'blog_items', 'popular');
            } else {
                $result = $interface->getByViews('blog_items');
            }
        } else {
            $result = $interface->getAll('blog_items');
        }
    }
} else {