private function getSeo()
 {
     $ReadSeo = new WsPosts();
     switch ($this->File) {
         case 'artigo':
             $Admin = isset($_SESSION['userlogin']['user_level']) && $_SESSION['userlogin']['user_level'] == 3 ? true : false;
             $Check = $Admin ? '' : 'post_status = 1 AND ';
             $ReadSeo->setPost_name($this->Link);
             $ReadSeo->Query("WHERE {$Check} #post_name#");
             if (!$ReadSeo->getResult()) {
                 $this->seoData = null;
                 $this->seoTags = null;
             } else {
                 extract((array) $ReadSeo->getResult()[0]);
                 $this->seoData = (array) $ReadSeo->getResult()[0];
                 $this->Data = [$post_title . ' - ' . SITENAME, $post_content, HOME . "/artigo/{$post_name}", HOME . "/uploads/{$post_cover}"];
                 //post:: post_views
                 $ReadSeo->setPost_id($post_id);
                 $ReadSeo->setPost_views($post_views + 1);
                 $ReadSeo->setPost_last_views(date('Y-m-d H:i:s'));
                 $ReadSeo->update();
             }
             break;
         case 'index':
             $this->Data = [SITENAME . ' - Seu Guia de empresas, eventos e baladas!', SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
             break;
         default:
             $this->Data = ['404 Oppss, Nada encontrado!', SITEDESC, HOME . '/404', INCLUDE_PATH . '/images/site.png'];
             break;
     }
     if ($this->Data) {
         $this->setTags();
     }
 }
Example #2
0
<?php

$Read = new WsPosts();
$category_id = Check::CatByName("convenios");
switch ($method) {
    case "GET":
        //retorna todos os itens
        if (isset($id)) {
            $Read->setPost_id($id);
            $Read->setPost_status('1');
            $Read->Execute()->find();
            Check::JsonReturn($Read->Execute()->getResult(), 'Convênio não encontrado!', '404');
        } else {
            $Read->Execute()->Query("post_status = 1 AND (post_category = :cat OR post_cat_parent = :cat) ORDER BY post_title DESC", "cat={$category_id}");
            Check::JsonReturn($Read->Execute()->getResult(), 'Nenhuma convênio cadastrada!', '204');
        }
        break;
    case "POST":
        if (!empty($request->post_id)) {
            //update
            $Read->setThis($request);
            $Read->Execute()->update(NULL, 'post_id');
            echo json_encode($request);
        } else {
            //salvar
            $Read->setThis($request);
            $insert = $Read->Execute()->insert();
            if ($insert) {
                $request->post_id = (int) $Read->Execute()->MaxFild("post_id");
            }
            echo json_encode($request);
Example #3
0
        <header>
            <h1 class="title"><?php 
echo $category_title;
?>
</h1>
            <p><?php 
echo $category_content;
?>
</p>
        </header>

        <?php 
$getPage = (int) (!empty($Link->getLocal()[2]) ? $Link->getLocal()[2] : 1);
$Pager = new Pager(HOME . '/categoria/' . $category_name . '/');
$Pager->ExePager($getPage, 3);
$readCat = new WsPosts();
$readCat->Execute()->Query("post_status = 1 AND (post_category = :cat OR post_cat_parent = :cat) ORDER BY post_date DESC LIMIT :limit OFFSET :offset", "cat={$category_id}&limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$readCat->Execute()->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpe, a categoria <b>{$category_title}</b> ainda não tem artigos publicados, favor volte mais tarde!", WS_INFOR);
} else {
    $cc = 1;
    $View = new View();
    $tpl_m = $View->Load('article_m');
    foreach ($readCat->Execute()->getResult() as $cat) {
        echo "\n<div class='col-md-4'>\n";
        $class = $cc % 3 == 0 ? ' class="right"' : null;
        $cat->post_title = Check::Words($cat->post_title, 8);
        $cat->post_content = Check::Words($cat->post_content, 20);
        $cat->datetime = date('Y-m-d', strtotime($cat->post_date));
        $cat->pubdate = date('d/m/Y H:i', strtotime($cat->post_date));
 private function Update()
 {
     $WsPosts = new WsPosts();
     $this->Data['post_views'] = null;
     $this->Data['post_last_views'] = null;
     $this->Data['post_id'] = $this->Post;
     $this->Data['post_date'] = date('Y-m-d H:i:s');
     $this->Data['post_cover'] = isset($this->Data['post_cover']) ? $this->Data['post_cover'] : null;
     $WsPosts->setThis((object) $this->Data);
     $result = $WsPosts->Execute()->update(null, 'post_id');
     $this->Message($this->Data['post_title'], "atualizado", true, $result);
 }
Example #5
0
    $post['post_cover'] = $_FILES['post_cover']['tmp_name'] ? $_FILES['post_cover'] : 'null';
    unset($post['SendPostForm']);
    require_once '_models/AdminPost.class.php';
    $cadastra = new AdminPost();
    $cadastra->ExeUpdate($postid, $post);
    WSErro($cadastra->getError()[0], $cadastra->getError()[1]);
    if (!empty($_FILES['gallery_covers']['tmp_name'])) {
        $sendGallery = new AdminPost();
        $sendGallery->gbSend($_FILES['gallery_covers'], $postid);
    }
    if (!empty($_FILES['files']['tmp_name'])) {
        $sendFiles = new AdminPost();
        $sendFiles->flSend($_FILES['files'], $postid);
    }
} else {
    $WsPosts = new WsPosts();
    $WsPosts->setPost_id($postid);
    $WsPosts->Execute()->find();
    if (!$WsPosts->Execute()->getResult()) {
        header('Location: painel.php?exe=posts/index&empty=true');
    } else {
        $post = (array) $WsPosts->Execute()->getResult();
        $post['post_date'] = date('d/m/Y H:i:s', strtotime($post['post_date']));
    }
}
if (!empty($_SESSION['errCapa'])) {
    WSErro($_SESSION['errCapa'], E_USER_WARNING);
    unset($_SESSION['errCapa']);
}
$checkCreate = filter_input(INPUT_GET, 'create', FILTER_VALIDATE_BOOLEAN);
if ($checkCreate && empty($cadastra)) {
Example #6
0
        ?>
" 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;
Example #7
0
<section class="section">
    <div class="well">
        <div class="row">
            <div class="col-md-12">
                <h1 class="text-center">Equipe</h1>
                <p class="text-center">Membros importantes da nossa CIDDHC.</p>
            </div>
        </div>
        <?php 
$View = new View();
$membro = $View->Load("article_membro");
$Read = new WsPosts();
$Read->Execute()->Query("post_status = 1 AND post_type = 'membros' ORDER BY post_date DESC");
if (!$Read->Execute()->getResult()) {
    WSErro("Desculpe não temos membros no momento, favor volte mais tarde!", WS_INFOR);
} else {
    $i = 0;
    echo "<div class='row'>\n";
    foreach ($Read->Execute()->getResult() as $item) {
        if ($i % 2 == 0 && $i != 0) {
            echo "</div>\n";
            echo "<div class='row'>\n";
        }
        $item->post_title = Check::Words($item->post_title, 4);
        $item->post_content = Check::Words($item->post_content, 10);
        $item->datetime = date('Y-m-d', strtotime($item->post_date));
        $item->pubdate = date("d/m/Y H:i", strtotime($item->post_date));
        $View->Show((array) $item, $membro);
        $i++;
    }
    echo "</div>\n";
" title="<?php 
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}";
Example #9
0
 private function getSeo()
 {
     switch ($this->File) {
         //SEO:: ARTIGO
         case 'artigo':
             $Admin = isset($_SESSION['userlogin']['user_level']) && $_SESSION['userlogin']['user_level'] == 3 ? true : false;
             $Check = $Admin ? '' : 'post_status = 1 AND ';
             $ReadSeo = new WsPosts();
             $ReadSeo->setPost_name($this->Link);
             $ReadSeo->Execute()->Query("{$Check} #post_name#");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->seoData = null;
                 $this->seoTags = null;
             } else {
                 extract((array) $ReadSeo->Execute()->getResult()[0]);
                 $this->seoData = (array) $ReadSeo->Execute()->getResult()[0];
                 $this->Data = [$post_title . ' - ' . SITENAME, $post_content, HOME . "/artigo/{$post_name}", HOME . "/uploads/{$post_cover}"];
                 //post:: conta viws do post
                 $ReadSeo->setPost_id($post_id);
                 $ReadSeo->setPost_views($post_views + 1);
                 $ReadSeo->setPost_last_views(date('Y-m-d H:i:s'));
                 $ReadSeo->Execute()->update($ReadSeo->Execute()->getDados(), 'post_id');
             }
             break;
             //SEO:: NOTICIAS
         //SEO:: NOTICIAS
         case 'noticias':
             $ReadSeo = new WsPosts();
             $ReadSeo->setPost_type($this->Link);
             $ReadSeo->Execute()->Query("#post_type#");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->seoData = null;
                 $this->seoTags = null;
             } else {
                 extract((array) $ReadSeo->Execute()->getResult()[0]);
                 $this->seoData = (array) $ReadSeo->Execute()->getResult();
                 $this->Data = [$post_type . ' - ' . SITENAME, $post_content, HOME . "/noticias/{$post_type}", INCLUDE_PATH . '/images/site.png'];
             }
             break;
             //SEO:: CATEGORIA
         //SEO:: CATEGORIA
         case 'categoria':
             $ReadSeo = new WsCategories();
             $ReadSeo->setCategory_name($this->Link);
             $ReadSeo->Execute()->Query("#category_name#");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->seoData = null;
                 $this->seoTags = null;
             } else {
                 extract((array) $ReadSeo->Execute()->getResult()[0]);
                 $this->seoData = (array) $ReadSeo->Execute()->getResult()[0];
                 $this->Data = [$category_title . ' - ' . SITENAME, $category_content, HOME . "/categoria/{$category_name}", INCLUDE_PATH . '/images/site.png'];
                 //categories:: conta views da categoria
                 $ReadSeo->setCategory_id($category_id);
                 $ReadSeo->setCategory_views($category_views + 1);
                 $ReadSeo->setCategory_last_view(date('Y-m-d H:i:s'));
                 $ReadSeo->Execute()->update($ReadSeo->Execute()->getDados(), 'category_id');
             }
             break;
             //SEO::PESQUISA
         //SEO::PESQUISA
         case 'pesquisa':
             $ReadSeo = new WsPosts();
             $ReadSeo->Execute()->Query("post_status = 1 AND (post_title LIKE '%' :link '%' OR post_content LIKE '%' :link '%')", "link={$this->Link}");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->Data = ["Pesquisa por: \"{$this->Link}\"" . ' - ' . SITENAME, "Sua pesquisa por {$this->Link} retornou {$this->seoData['count']} resultados!", HOME . "/pesquisa/{$this->Link}", INCLUDE_PATH . '/images/site.png'];
                 $this->seoTags = null;
             } else {
                 $this->seoData['count'] = $ReadSeo->Execute()->getRowCount();
                 $this->Data = ["Pesquisa por: \"{$this->Link}\"" . ' - ' . SITENAME, "Sua pesquisa por {$this->Link} retornou {$this->seoData['count']} resultados!", HOME . "/pesquisa/{$this->Link}", INCLUDE_PATH . '/images/site.png'];
             }
             break;
             //SEO:: INDEX
         //SEO:: INDEX
         case 'index':
             $this->Data = [SITENAME . ' - ' . SITEDESC, SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
             break;
         case 'pages':
             switch ($this->Link) {
                 //SEO:: Contato
                 case 'contato':
                     $this->Data = [SITENAME . ' - Fale conosco', SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
                     break;
                     //SEO:: membros
                 //SEO:: membros
                 case 'membros':
                     $this->Data = [SITENAME . ' - Parceiros da causa.', SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
                     break;
                     //SEO:: institucional
                 //SEO:: institucional
                 case 'institucional':
                     $this->Data = [SITENAME . ' - Institucional.', SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
                     break;
                     //SEO:: 404
                 //SEO:: 404
                 default:
                     $this->Data = ['404 Oppss, Nada encontrado!', SITEDESC, HOME . '/404', INCLUDE_PATH . '/images/site.png'];
                     break;
             }
             break;
             //SEO:: 404
         //SEO:: 404
         default:
             $this->Data = ['404 Oppss, Nada encontrado!', SITEDESC, HOME . '/404', INCLUDE_PATH . '/images/site.png'];
             break;
     }
     if ($this->Data) {
         $this->setTags();
     }
 }
<?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->Query("WHERE #post_category#");
     if (isset($readPosts->getResult()[0])) {
         return false;
     } else {
         return true;
     }
 }
Example #12
0
 private function getSeo()
 {
     switch ($this->File) {
         //SEO:: Indicadores
         case 'indicadores':
             $this->Data = ['Indicadores de qualidade - ' . SITENAME . ' - ' . SITEDESC, SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
             break;
         case 'profile':
             $this->Data = ['Dados cadastrais - ' . SITENAME . ' - ' . SITEDESC, SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
             break;
             //SEO:: ARTIGO
         //SEO:: ARTIGO
         case 'artigo':
             $Admin = isset($_SESSION['userlogin']['user_level']) && $_SESSION['userlogin']['user_level'] == 3 ? true : false;
             $Check = $Admin ? '' : 'post_status = 1 AND ';
             $ReadSeo = new WsPosts();
             $ReadSeo->setPost_name($this->Link);
             $ReadSeo->Execute()->Query("{$Check} #post_name#");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->seoData = null;
                 $this->seoTags = null;
             } else {
                 extract((array) $ReadSeo->Execute()->getResult()[0]);
                 $this->seoData = (array) $ReadSeo->Execute()->getResult()[0];
                 $this->Data = [$post_title . ' - ' . SITENAME, $post_content, HOME . "/artigo/{$post_name}", HOME . "/uploads/{$post_cover}"];
                 //post:: conta viws do post
                 Check::ContPostViews($post_id);
             }
             break;
             //SEO:: NOTICIAS
         //SEO:: NOTICIAS
         case 'noticias':
             $ReadSeo = new WsPosts();
             $ReadSeo->setPost_type($this->Link);
             $ReadSeo->Execute()->Query("#post_type#");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->seoData = null;
                 $this->seoTags = null;
             } else {
                 extract((array) $ReadSeo->Execute()->getResult()[0]);
                 $this->seoData = (array) $ReadSeo->Execute()->getResult();
                 $this->Data = [$post_type . ' - ' . SITENAME, $post_content, HOME . "/noticias/{$post_type}", INCLUDE_PATH . '/images/site.png'];
             }
             break;
             //SEO:: CATEGORIA
         //SEO:: CATEGORIA
         case 'categoria':
             $ReadSeo = new WsCategories();
             $ReadSeo->setCategory_name($this->Link);
             $ReadSeo->Execute()->Query("#category_name#");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->seoData = null;
                 $this->seoTags = null;
             } else {
                 extract((array) $ReadSeo->Execute()->getResult()[0]);
                 $this->seoData = (array) $ReadSeo->Execute()->getResult()[0];
                 $this->Data = [$category_title . ' - ' . SITENAME, $category_content, HOME . "/categoria/{$category_name}", INCLUDE_PATH . '/images/site.png'];
                 //categories:: conta views da categoria
                 Check::ContCategoryViews($category_id);
             }
             break;
             //SEO:: Grupo
         //SEO:: Grupo
         case 'grupo':
             $ReadSeo = new WsCategories();
             $ReadSeo->setCategory_name($this->Link);
             $ReadSeo->Execute()->Query("#category_name#");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->seoData = null;
                 $this->seoTags = null;
             } else {
                 extract((array) $ReadSeo->Execute()->getResult()[0]);
                 $this->seoData = (array) $ReadSeo->Execute()->getResult()[0];
                 $this->Data = [$category_title . ' - ' . SITENAME, $category_content, HOME . "/categoria/{$category_name}", INCLUDE_PATH . '/images/site.png'];
                 //categories:: conta views da categoria
                 Check::ContCategoryViews($category_id);
             }
             break;
             //SEO:: membros
         //SEO:: membros
         case 'membros':
             $ReadSeo = new WsCategories();
             $ReadSeo->setCategory_name($this->Link);
             $ReadSeo->Execute()->Query("#category_name#");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->seoData = null;
                 $this->seoTags = null;
             } else {
                 extract((array) $ReadSeo->Execute()->getResult()[0]);
                 $this->seoData = (array) $ReadSeo->Execute()->getResult()[0];
                 $this->Data = [$category_title . ' - ' . SITENAME, $category_content, HOME . "/membros/{$category_name}", INCLUDE_PATH . '/images/site.png'];
                 //categories:: conta views da categoria
                 Check::ContCategoryViews($category_id);
             }
             break;
             //SEO::PESQUISA
         //SEO::PESQUISA
         case 'pesquisa':
             $ReadSeo = new WsPosts();
             $ReadSeo->Execute()->Query("post_status = 1 AND (post_title LIKE '%' :link '%' OR post_content LIKE '%' :link '%')", "link={$this->Link}");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->Data = ["Pesquisa por: \"{$this->Link}\"" . ' - ' . SITENAME, "Sua pesquisa por {$this->Link} retornou {$this->seoData['count']} resultados!", HOME . "/pesquisa/{$this->Link}", INCLUDE_PATH . '/images/site.png'];
                 $this->seoTags = null;
             } else {
                 $this->seoData['count'] = $ReadSeo->Execute()->getRowCount();
                 $this->Data = ["Pesquisa por: \"{$this->Link}\"" . ' - ' . SITENAME, "Sua pesquisa por {$this->Link} retornou {$this->seoData['count']} resultados!", HOME . "/pesquisa/{$this->Link}", INCLUDE_PATH . '/images/site.png'];
             }
             break;
             //SEO:: INDEX
         //SEO:: INDEX
         case 'index':
             $this->Data = [SITENAME . ' - ' . SITEDESC, SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
             break;
             //SEO:: PAGES
         //SEO:: PAGES
         case 'pages':
             switch ($this->Link) {
                 //SEO:: Contato
                 case 'contato':
                     $this->Data = ['Fale conosco - ' . SITENAME, SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
                     break;
                     //SEO:: Contato
                 //SEO:: Contato
                 case 'aniversarios':
                     $this->Data = ['Parabéns colegas - ' . SITENAME, SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
                     break;
                     //SEO:: Qualidade
                 //SEO:: Qualidade
                 case 'qualidade':
                     $this->Data = ['Formularios da Qualidade - ' . SITENAME, SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
                     break;
                     //SEO:: SOBRE
                 //SEO:: SOBRE
                 case 'sobre':
                     $this->Data = ['Sobre a Intranet - ' . SITENAME, SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
                     break;
                     //SEO:: INSTITUCIONAL
                 //SEO:: INSTITUCIONAL
                 case 'institucional':
                     $this->Data = ['Instituição Tommasi - ' . SITENAME, SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
                     break;
                     //SEO:: 404
                 //SEO:: 404
                 default:
                     $this->Data = ['404 Oppss, Nada encontrado!', SITEDESC, HOME . '/404', INCLUDE_PATH . '/images/site.png'];
                     break;
             }
             break;
             //SEO:: PLUGIN
         //SEO:: PLUGIN
         case 'plugin':
             switch ($this->Link) {
                 //SEO:: Contadores de Impresão
                 case 'contadores-de-impressao':
                     $this->Data = ['Contadores de impressão - Registra os contadores de cada Mês', SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
                     break;
                     //SEO:: Fast Exames
                 //SEO:: Fast Exames
                 case 'fast-exames':
                     $this->Data = ['Fast Exames Tommasi - Formulario de alteração de exames', SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
                     break;
                     //SEO:: Agenda
                 //SEO:: Agenda
                 case 'agenda':
                     $this->Data = ['Agenda telefonica - Lista Telefonica Tommasi', SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
                     break;
                     //SEO:: Aniversarios
                 //SEO:: Aniversarios
                 case 'aniversarios':
                     $this->Data = ['Aniversariantes do mês - ' . SITENAME . '| Parabéns a todos do grupo tommasi.', SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
                     break;
                     //SEO:: 404
                 //SEO:: 404
                 default:
                     $this->Data = [SITENAME . ' - Plugin', SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
                     break;
             }
             break;
             //SEO:: 404
         //SEO:: 404
         default:
             $this->Data = ['404 Oppss, Nada encontrado!', SITEDESC, HOME . '/404', INCLUDE_PATH . '/images/site.png'];
             break;
     }
     if ($this->Data) {
         $this->setTags();
         //importa as bibliotecas corretas de acordo com a versão do sistema
         if (PRODUCAO) {
             $this->setProd();
         } else {
             $this->setLib();
         }
     }
 }
 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;
     }
 }
Example #14
0
<?php

$View = new View();
$carousel = $View->Load("carousel_m");
$cartilha = $View->Load("cartilhas_m");
$youtube = $View->Load("youtube_m");
$tpl_p = $View->Load("article_p");
$tpl_m = $View->Load("article_m");
$Read = new WsPosts();
$result = $Read->Execute()->FullRead("SELECT COUNT(post_name) as 'cont' FROM ws_posts WHERE post_type = 'post'")[0]->cont;
$All = !empty($Read->Execute()->findAll()) ? (int) $result : 0;
?>
<section class="section">
    <div class="well">
        <!-- carrousel -->
        <section class="section">

            <div id="fullcarousel-example" data-interval="4000" class="carousel slide"
                 data-ride="carousel">

                <?php 
$cat = Check::CatByName('destaque');
$Read->Execute()->Query("post_status = 1 AND post_type = 'post' AND (post_cat_parent = :cat OR post_category = :cat) ORDER BY post_date DESC LIMIT :limit OFFSET :offset", "cat={$cat}&limit=3&offset=0", true);
if (!$Read->Execute()->getResult()) {
    WSErro("Desculpe não temos posts no momento, favor volte mais tarde!", WS_INFOR);
} else {
    ?>


                    <!-- Indicators -->
                    <?php 
<?php

if (!empty($fixo) || !empty($cat)) {
    ?>
    <aside class="col-md-3 siderbar">

        <!--siderbar looper-->
        <div class="row">
            <?php 
    $Read = new WsPosts();
    $Read->setPost_category($cat);
    $Read->Execute()->Query("post_status = 1 AND (post_category = :cat OR post_cat_parent = :cat) ORDER BY post_date LIMIT 3", "cat={$cat}", true);
    if (!$Read->Execute()->getResult()) {
        WSErro("Opps! Não temos artigos para a barra lateral", WS_INFOR);
    } else {
        $View = new View();
        $siderbar = $View->Load("article_sidebar_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, 6);
            if (!$bar->post_url) {
                $bar->post_url = "#HOME#/plugin/{$bar->post_name}";
            }
            $View->Show((array) $bar, $siderbar);
        }
    }
    if (isset($fixo)) {
        $Read->Execute()->Query("post_status = 1 AND (post_category = :cat OR post_cat_parent = :cat) ORDER BY post_date LIMIT 3", "cat={$fixo}", true);
        if (!$Read->Execute()->getResult()) {
            WSErro("Opps! Não temos artigos para a barra lateral", WS_INFOR);
        ?>
" title="Excluir">Deletar</a></li>
                        </ul>
                    </header>

                    <h2>Sub categorias de vídeo aulas:</h2>

                    <?php 
        $ReadSes->setCategory_parent($category_id);
        $ReadSes->Query("WHERE #category_parent#");
        if (!$ReadSes->getResult()) {
        } else {
            $a = 0;
            foreach ($ReadSes->getResult() as $sub) {
                $a++;
                $ReadCatPosts = new WsPosts();
                $ReadCatPosts->setPost_category($sub->category_id);
                $ReadCatPosts->Query("WHERE #post_category#");
                ?>
                            <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;
                ?>
?>
"</h2>
            <p class="tagline">Sua pesquisa por <?php 
echo $search;
?>
 retornou <?php 
echo $count;
?>
 resultados:</p>
        </header>

        <?php 
$getPage = (int) (!empty($Link->getLocal()[2]) ? $Link->getLocal()[2] : 1);
$Pager = new Pager(HOME . '/pesquisa/' . $search . '/');
$Pager->ExePager($getPage, 4);
$readArt = new WsPosts();
$readArt->Execute()->Query("post_status = 1 AND (post_title LIKE '%' :link '%' OR post_content LIKE '%' :link '%') ORDER BY post_date DESC LIMIT :limit OFFSET :offset", "link={$search}&limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$readArt->Execute()->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpe, sua pesquisa não retornou resultados. Você pode resulmir sua pesquisa ou tentar outros termos!", WS_INFOR);
} else {
    $cc = 0;
    foreach ($readArt->Execute()->getResult() as $cat) {
        $cc++;
        $View = new View();
        $tpl_cat = $View->Load('article_m');
        $class = $cc % 3 == 0 ? ' class="right"' : null;
        echo "<span{$class}>";
        $cat->post_title = Check::Words($cat->post_title, 8);
        $cat->post_content = Check::Words($cat->post_content, 20);
        $cat->datetime = date('Y-m-d', strtotime($cat->post_date));
 private function getSeo()
 {
     switch ($this->File) {
         //SEO:: ARTIGO
         case 'artigo':
             $Admin = isset($_SESSION['userlogin']['user_level']) && $_SESSION['userlogin']['user_level'] == 3 ? true : false;
             $Check = $Admin ? '' : 'post_status = 1 AND ';
             $ReadSeo = new WsPosts();
             $ReadSeo->setPost_name($this->Link);
             $ReadSeo->Execute()->Query("{$Check} #post_name#");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->seoData = null;
                 $this->seoTags = null;
             } else {
                 extract((array) $ReadSeo->Execute()->getResult()[0]);
                 $this->seoData = (array) $ReadSeo->Execute()->getResult()[0];
                 $this->Data = [$post_title . ' - ' . SITENAME, $post_content, HOME . "/artigo/{$post_name}", HOME . "/uploads/{$post_cover}"];
                 //post:: conta viws do post
                 $ReadSeo->setPost_id($post_id);
                 $ReadSeo->setPost_views($post_views + 1);
                 $ReadSeo->setPost_last_views(date('Y-m-d H:i:s'));
                 $ReadSeo->Execute()->update($ReadSeo->Execute()->getDados(), 'post_id');
             }
             break;
             //SEO:: CATEGORIA
         //SEO:: CATEGORIA
         case 'categoria':
             $ReadSeo = new WsCategories();
             $ReadSeo->setCategory_name($this->Link);
             $ReadSeo->Execute()->Query("#category_name#");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->seoData = null;
                 $this->seoTags = null;
             } else {
                 extract((array) $ReadSeo->Execute()->getResult()[0]);
                 $this->seoData = (array) $ReadSeo->Execute()->getResult()[0];
                 $this->Data = [$category_title . ' - ' . SITENAME, $category_content, HOME . "/categoria/{$category_name}", INCLUDE_PATH . '/images/site.png'];
                 //categories:: conta views da categoria
                 $ReadSeo->setCategory_id($category_id);
                 $ReadSeo->setCategory_views($category_views + 1);
                 $ReadSeo->setCategory_last_view(date('Y-m-d H:i:s'));
                 $ReadSeo->Execute()->update($ReadSeo->Execute()->getDados(), 'category_id');
             }
             break;
             //SEO::PESQUISA
         //SEO::PESQUISA
         case 'pesquisa':
             $ReadSeo = new WsPosts();
             $ReadSeo->Execute()->Query("post_status = 1 AND (post_title LIKE '%' :link '%' OR post_content LIKE '%' :link '%')", "link={$this->Link}");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->seoData = null;
                 $this->seoTags = null;
             } else {
                 $this->seoData['count'] = $ReadSeo->Execute()->getRowCount();
                 $this->Data = ["Pesquisa por: \"{$this->Link}\"" . ' - ' . SITENAME, "Sua pesquisa por {$this->Link} retornou {$this->seoData['count']} resultados!", HOME . "/pesquisa/{$this->Link}", INCLUDE_PATH . '/images/site.png'];
             }
             break;
             //SEO:: EMPRESAS
         //SEO:: EMPRESAS
         case 'empresas':
             $Name = ucwords(str_replace("-", " ", $this->Link));
             $this->seoData = ['empresa_link' => $this->Link, 'empresa_cat' => $Name];
             $this->Data = ["Empresas {$this->Link}" . SITENAME, "Confira o guia completo de sua cidade, e encontra empresas {$this->Link}", HOME . '/empresas/' . $this->Link, INCLUDE_PATH . '/images/site.png'];
             break;
             //SEO:: EMPRESA SINGLE
         //SEO:: EMPRESA SINGLE
         case 'empresa':
             $Admin = isset($_SESSION['userlogin']['user_level']) && $_SESSION['userlogin']['user_level'] == 3 ? true : false;
             $Check = $Admin ? '' : 'empresa_status = 1 AND ';
             $ReadSeo = new AppEmpresas();
             $ReadSeo->setEmpresa_name($this->Link);
             $ReadSeo->Execute()->Query("{$Check} #empresa_name#");
             if (!$ReadSeo->Execute()->getResult()) {
                 $this->seoData = null;
                 $this->seoTags = null;
             } else {
                 extract((array) $ReadSeo->Execute()->getResult()[0]);
                 $this->seoData = (array) $ReadSeo->Execute()->getResult()[0];
                 $this->Data = [$empresa_title . ' - ' . SITENAME, $empresa_sobre, HOME . "/empresa/{$empresa_name}", HOME . "/uploads/{$empresa_capa}"];
                 //empresa:: conta views da empresa
                 $ReadSeo->setEmpresa_id($empresa_id);
                 $ReadSeo->setEmpresa_views($empresa_views + 1);
                 $ReadSeo->setEmpresa_last_view(date('Y-m-d H:i:s'));
                 $ReadSeo->Execute()->update($ReadSeo->Execute()->getDados(), 'empresa_id');
             }
             break;
             //SEO:: CADASTRA EMPRESA
         //SEO:: CADASTRA EMPRESA
         case 'cadastra-empresa':
             $this->Data = ["Cadastre sua Empresa - " . SITENAME, "Página modelo para cadastro de empresas via Front-End do curso Work Series - PHP Orientado a Objetos!", HOME . '/cadastra-empresa/' . $this->Link, INCLUDE_PATH . '/images/site.png'];
             break;
             //SEO:: INDEX
         //SEO:: INDEX
         case 'index':
             $this->Data = [SITENAME . ' - Seu Guia de empresas, eventos e baladas!', SITEDESC, HOME, INCLUDE_PATH . '/images/site.png'];
             break;
             //SEO:: 404
         //SEO:: 404
         default:
             $this->Data = ['404 Oppss, Nada encontrado!', SITEDESC, HOME . '/404', INCLUDE_PATH . '/images/site.png'];
             break;
     }
     if ($this->Data) {
         $this->setTags();
     }
 }
Example #19
0
 /**
  * <b>Contagem de Views:</b> Realiza uma contagem ao post informado.
  * @param INT $post_id
  */
 public static function ContPostViews($post_id)
 {
     $WsPosts = new WsPosts();
     $WsPosts->setPost_id($post_id);
     extract((array) $WsPosts->Execute()->find());
     $WsPosts->setPost_views($post_views + 1);
     $WsPosts->setPost_last_views(date('Y-m-d H:i:s'));
     $WsPosts->Execute()->update($WsPosts->Execute()->getDados(), 'post_id');
     return $post_url;
 }
Example #20
0
    <div class="well">
        <div class="row">
            <div class="col-md-12">
                <h1 class="text-center title"><?php 
echo $titulo;
?>
</h1>
            </div>
        </div>
        <?php 
$View = new View();
$membro = $View->Load("noticias_m");
$getPage = (int) (!empty($Link->getLocal()[2]) ? $Link->getLocal()[2] : 1);
$Pager = new Pager(HOME . '/noticias/' . $post_type . '/');
$Pager->ExePager($getPage, 6);
$Read = new WsPosts();
$Read->setPost_type($post_type);
$Read->Execute()->Query("post_status = 1 AND post_type = :type ORDER BY post_date DESC, post_category DESC LIMIT :limit OFFSET :offset", "type={$post_type}&limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$Read->Execute()->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpe não temos noticias no momento, favor volte mais tarde!", WS_INFOR);
} else {
    $i = 0;
    echo "<div class='row'>\n";
    foreach ($Read->Execute()->getResult() as $item) {
        if ($i % 3 == 0 && $i != 0) {
            echo "</div>\n";
            echo "<div class='row'>\n";
        }
        $item->post_title = Check::Words($item->post_title, 4);
        $item->post_content = Check::Words($item->post_content, 10);