echo $Titulo; ?> da intranet" alt="<?php echo $Titulo; ?> "><?php echo $Titulo; ?> </a></small></h1> <div class="well"> <?php $cat = Check::CatByName($Categoria); $Offset = !empty($Offset) ? "OFFSET {$Offset}" : ""; $c = 0; $Read = new WsPosts(); $Read->setPost_category($cat); $Read->Execute()->Query("post_status = 1 AND (post_category = :cat OR post_cat_parent = :cat) ORDER BY {$Ordem} DESC LIMIT 3 {$Offset}", "cat={$cat}", true); $Offset = null; if (!$Read->Execute()->getResult()) { WSErro("Opps! Não temos artigos em destaques!", WS_INFOR); } else { $View = new View(); $new = $View->Load("noticias_m_clean"); foreach ($Read->Execute()->getResult() as $bar) { $bar->datetime = date('Y-m-d', strtotime($bar->post_date)); $bar->pubdate = date("d/m/Y H:i", strtotime($bar->post_date)); $bar->post_content = Check::Words($bar->post_content, 30); $bar->class = $c == 0 ? "item active" : "item"; if (!$bar->post_url) { $bar->post_url = "#HOME#/artigo/{$bar->post_name}"; }
" title="Excluir">Deletar</a></li> </ul> </header> <h2>Sub categorias:</h2> <?php $ReadSes->setCategory_parent($category_id); $ReadSes->Execute()->Query("#category_parent#"); if (!$ReadSes->Execute()->getResult()) { } else { $a = 0; foreach ($ReadSes->Execute()->getResult() as $sub) { $a++; $ReadCatPosts = new WsPosts(); $ReadCatPosts->setPost_category($sub->category_id); $ReadCatPosts->Execute()->Query("#post_category#"); $category_views = !empty($category_views) ? $category_views : 0; ?> <article<?php if ($a % 3 == 0) { echo ' class="right"'; } ?> > <h1><a target="_blank" href="../categoria/<?php echo $sub->category_name; ?> " title="Ver Categoria"><?php echo $sub->category_title; ?>
private function checkPosts() { $readPosts = new WsPosts(); $readPosts->setPost_category($this->CatId); $readPosts->Query("WHERE #post_category#"); if (isset($readPosts->getResult()[0])) { return false; } else { return true; } }
<?php $Limit = !empty($Limit) ? $Limit : 3; $c = 0; $Read = new WsPosts(); $Read->setPost_category($carrousel); $Read->Execute()->Query("post_status = 1 AND (post_category = :cat OR post_cat_parent = :cat) ORDER BY post_date DESC LIMIT {$Limit}", "cat={$carrousel}", true); if (!$Read->Execute()->getResult()) { WSErro("Opps! Não temos artigos em destaques!", WS_INFOR); } else { ?> <div id = "carousel" data-interval="3000" class="carousel slide well" data-ride="carousel"> <div class = "carousel-inner" > <?php $View = new View(); $siderbar = $View->Load("carousel_m"); foreach ($Read->Execute()->getResult() as $bar) { $bar->datetime = date('Y-m-d', strtotime($bar->post_date)); $bar->pubdate = date("d/m/Y H:i", strtotime($bar->post_date)); $bar->post_content = Check::Words($bar->post_content, 30); $bar->class = $c == 0 ? "item active" : "item"; if (!$bar->post_url) { $bar->post_url = "#HOME#/artigo/{$bar->post_name}"; } $View->Show((array) $bar, $siderbar); $c++; } ?> </div> <?php if ($c != 1) {
private function checkPosts() { $readPosts = new WsPosts(); $readPosts->setPost_category($this->CatId); $readPosts->Execute()->Query("#post_category#"); if (!empty($readPosts->Execute()->getResult()[0])) { return false; } else { return true; } }