Example #1
0
File: tag.php Project: AbreuLF/OLP
<?php

require "helper/cabecalho.php";
$url = explode("/tag/", $_SERVER['REQUEST_URI']);
$tag = new TagController();
$tagModel = $tag->getTagBySeo($url[1]);
$posts = new PostController();
$totalPosts = $posts->getPostsCountByTag($tagModel->Id);
?>
	
	<div class="container">
		<div class="row">
			
			<div class="col-sm-9" id="conteudo-pagina">
				
				<div id="topo-home">
					
					<h2 class="titulo-bloco">
						<span>Tag:</span> 
						<?php 
echo $tagModel->Nome;
?>
					</h2>
					
					<div class="row lista-posts">
						
						<?php 
foreach ($posts->getPostsByTag($tagModel->Id, 0, 5) as $post) {
    echo "\t<div class='col-sm-12'>\n\t\t\t\t\t\t\t\t\t\t\t<div class='post-thumb horizontal lista' url='" . $post->Seo . "'>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class='imagem'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . (!empty($post->Capa) ? "<img src='" . $post->Capa . "'>" : "") . "\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class='dados'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<h1 class='titulo'>" . $post->Titulo . "</h1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class='categoria'>" . $post->CategoriaPrincipal_Nome . "</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class='data'>Publicado em " . DefaultHelper::converterData($post->DataCriacao, true) . "</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='nota rateit' data-rateit-min='0' data-rateit-max='5' data-rateit-readonly='true' data-rateit-value='" . $post->NotaGeral . "'></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='resumo'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . $post->Corpo . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='acoes'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href='post/" . $post->Seo . "' class='btn btn-link link'>Continuar lendo</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>";
}
?>