private function printSingle($id) { $sql = "SELECT * FROM rm_vmovie WHERE id=?"; $res = $this->db->ExecuteSelectQueryAndFetchAll($sql, array($id)); $movie = $res[0]; $html = "<div class='movie-single clearfix'>\n"; // $html = $breadcrumb; $html .= "<h1>{$movie->title} ({$movie->year})</h1>\n"; $html .= CDatabaseHandle::createBreadcrumb('Filmer', 'id', $movie->title); $html .= "<article>\n"; $html .= "<div class='trailer'>" . $this->embedYoutube($movie->youtube) . "</div>\n"; $html .= "<div class='plot'>" . CTextFilter::doAllFilters($movie->plot) . "</div>\n"; $html .= "</article>\n"; $html .= "<aside>\n"; $html .= $this->printImage($movie->image, 204, 307); $titles = array('Regissör', 'Genre', 'Längd', 'Språk', 'IMDb', 'Pris'); $data = array($movie->director, preg_replace('/,/', ', ', $movie->genre), !empty($movie->length) ? $movie->length . " min" : null, $movie->language, $this->IMDbLink($movie->imdb), !empty($movie->price) ? $movie->price . " kr" : null); $html .= $this->printAside($titles, $data) . "\n"; $html .= "</aside>\n"; $html .= "</div>\n"; $html .= "<footer class='movie'>\n"; $html .= $this->returnLink('movies.php'); $html .= "</footer>\n"; return $html; }
public function printPosts() { $html = "<h1>Nyheter</h1>\n"; foreach ($this->posts as $post) { $title = htmlentities($post->title, null, 'UTF-8'); $data = CTextFilter::doAllFilters(htmlentities($post->data, null, 'UTF-8')); $slug = htmlentities($post->slug, null, 'UTF-8'); $published = htmlentities($post->published, null, 'UTF-8'); $updated = htmlentities($post->updated, null, 'UTF-8'); $publishedBy = htmlentities($post->publishedBy, null, 'UTF-8'); $updatedBy = htmlentities($post->updatedBy, null, 'UTF-8'); $category = htmlentities($post->category, null, 'UTF-8'); // Shorten text in "alla" view if ($this->longText) { $data = shortenText($data, "news.php?slug={$slug}"); } if ($this->shot1) { $html .= CDatabaseHandle::createBreadcrumb('Nyheter', 'slug', $title); if ($this->longText) { $html .= $this->getCategorys(); } $this->shot1 = false; } $html .= "<section class='blog-post'>\n"; $html .= "<article>\n"; $html .= "<header>\n"; $html .= "<h2>" . ($this->longText ? "<a href='news.php?slug={$slug}'>{$title}</a>" : "{$title} <a title='Tillbaka till alla poster' href='news.php'>↩</a>") . "</h2>\n"; $html .= "</header>\n"; $html .= "<p class='cat'>Kategori: " . (empty($category) ? "<a href='news.php?cat=ovrigt'>övrigt</a>" : "<a href='news.php?cat={$category}'>{$category}</a>") . "</p>\n"; $html .= "<div " . ($this->longText ? null : "style='min-height: 200px;'") . ">\n"; $html .= $data . "\n"; $html .= "</div>\n"; $html .= "<footer>\n"; $html .= "<p>" . ($updated ? "Uppdaterad: {$updated} av {$updatedBy}<br>" : null) . "Publicerad: {$published} av {$publishedBy}</p>\n"; $html .= "</footer>\n"; $html .= "</article>\n"; $html .= "</section>\n"; } return $html; }