Viewing file: noticia.php (7.25 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include "load_ipanel.php";
$noticiaCtrl = new NoticiaCtrl();
$noticia = $noticiaCtrl->getObject((is_numeric($_GET['id']) ? $_GET['id'] : ""));
if(($noticia['acessoRestrito'] == "S" && $_SESSION['isLogged']) || $noticia['acessoRestrito'] != "S"){
$fotoCtrl = new GenericCtrl("Foto");
$fotos = $fotoCtrl->getObjectByFields(array("local", "regId"), array("noticias", $_GET['id']));
$maisNoticias = $noticiaCtrl->getNoticias($_GET['tp'], array($_GET['id']), 10);
if(empty($_GET['tp'])){
$tipo = "Notícia";
$linkMais = "noticias";
}else{
$linkMais = $_GET['tp'];
if($_GET['tp'] == "jurisprudencia"){
$tipo = "Jurisprudência";
}
if($_GET['tp'] == "imprensa"){
$tipo = "Imprensa";
}
}
?>
<!DOCTYPE HTML>
<html lang="pt-br">
<?php include "mod_head.php" ?>
<meta property="og:title" content="<?= $noticia['titulo'] ?>" />
<meta property="og:site_name" content="IRPEN"/>
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.arpenpr.org.br/noticia/<?= $noticia['id'] ?>" />
<meta property="og:description" content="<?= ($noticia['gravata']) ?>" />
<meta property="fb:app_id" content="966242223397117" />
<?php if (!empty($noticia["imagem"])){ ?>
<meta property="og:image" content="http://www.arpenpr.org.br/ipanel/uploads/noticias/<?= $noticia['id']."/".$noticia['imagem'] ?>" />
<?php } ?>
<body class="homepage">
<div id="page-wrapper">
<?php include "mod_login.php" ?>
<?php include "mod_menu.php" ?>
<div id="banner-wrapper">
<div id="banner" class="container">
<div class="row">
<h2 class="titulo_page"><?= $tipo ?></h2>
</div>
</div>
</div>
<!-- Banners -->
<div class="wrapper-style1 wrapper-featured">
<div class="container">
<div class="row">
<div class="12u">
<div id="cont_esq">
<div id="box_principal">
<h2 class="titulo_page"><?= $noticia['titulo']?></h2>
<p id="noticia_data_publicacao"><?= $data->convertDateSQLToDateBR($noticia['notdata']) ." ".substr($noticia['hora'], 0, 5) ?> - <strong>Fonte: <?= $noticia['fonte']?></strong>
</p>
<?php
if(!empty($noticia['imagem']) && file_exists("ipanel/uploads/noticias/".$noticia['id']."/".$noticia['imagem'])) {
echo '<a title="'.$noticia['titulo'].'" href="ipanel/uploads/noticias/'.$noticia['id'].'/'.$noticia['imagem'].'" class="lytebox" data-lyte-options="group:galeria">';
echo '<img src="'.$noticiaCtrl->showImage($noticia, "Capa").'" alt="" class="image-noticia"></img>';
echo "</a>";
}
?>
<div id="noticia_texto">
<p>
<?= $noticia['conteudo']?>
</p>
<p class="galeria-fotos">
<?php
if(count($fotos) > 0){
foreach($fotos as $foto){
if(empty($foto['legenda'])){
$legenda = ($noticia['titulo']);
}else{
$legenda = $foto['legenda'];
}
echo '<a title="'.$legenda.'" href="ipanel/uploads/noticias/'.$noticia['id'].'/big_'.$foto['nome'].'" class="lytebox" data-lyte-options="group:galeria">';
echo '<img src="ipanel/uploads/noticias/'.$noticia['id'].'/thumb_'.$foto['nome'].'" alt="'.$foto['legenda'].'" style="padding: 6px; float:left">';
echo '</a>';
}
}
?>
</p>
</div>
<div style="clear: both"></div>
</br>
<div id="envia_amigo">
<div class="addthis_inline_share_toolbox"></div>
</div>
</br>
<h2 class="last-novas">VEJA TAMBÉM</h2>
</br>
<?php
foreach($maisNoticias as $noticia){
if(!empty($noticia['url']) && $noticia['url'] != "#"){
$url = $noticia['url'];
$target = "_blank";
}else{
$target = "_self";
if(empty($_GET['tp'])){
$url = "conteudo-noticia/".$noticia['id'];
}else{
$url = "conteudo-noticia/".$_GET['tp']."/".$noticia['id'];
}
}
echo "<div class=\"lista_noticias\">";
echo " <p>";
echo " <a style=\"color:#000000\" href=\"".$url."\" target=\"".$target."\">".$data->convertDateSQlToDateBR($noticia['notdata'])." - ".$noticia['titulo']."</a>";
echo " </p>";
echo "</div>";
}
?>
<ul class="veja_mais">
<li>
<a href="<?= $linkMais ?>"></a>
</li>
</ul>
</div><!--fecha a div "box_principal"-->
</div>
</div>
</div>
</div>
</div>
<?php include "mod_footer.php" ?>
</div>
</body>
</html>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-57d7f60bffd7cd6e"></script>
<?php include "scripts.php" ?>
<?php }else{ header("Location: login.php"); }?>
|