Esempio n. 1
0
            <?php 
//Objeto READ
$read = new Read();
//VISITAS DO SITE
$read->FullRead(null, "SELECT SUM(siteviews_views) AS views FROM ws_siteviews");
$Views = $read->getResult()[0]->views;
//USUÁRIOS
$read->FullRead(null, "SELECT SUM(siteviews_users) AS users FROM ws_siteviews");
$Users = $read->getResult()[0]->users;
//MÉDIA DE PAGEVIEWS
$read->FullRead(null, "SELECT SUM(siteviews_pages) AS pages FROM ws_siteviews");
$ResPages = $read->getResult()[0]->pages;
$Pages = substr($ResPages / ($Users == 0 ? 1 : $Users), 0, 5);
//POSTS
$read->setTable("ws_posts");
$read->findAll();
$Posts = $read->getRowCount();
//EMPRESAS
$read->setTable("app_empresas");
$read->findAll();
$Empresas = $read->getRowCount();
?>

            <ul>
                <li class="view"><span><?php 
echo $Views;
?>
</span> visitas</li>
                <li class="user"><span><?php 
echo $Users;
                                </li>
                                <?php 
    }
    ?>
                        </ul>
                        <div class="clear"></div>
                    </section>
                <?php 
}
?>
            </div>

            <!--RELACIONADOS-->
            <?php 
$readMode = new Read();
$readMode->setTable("ws_posts");
$readMode->Query("WHERE post_status = 1 AND post_id != :post_id AND #post_category# ORDER BY rand() LIMIT 2", "post_id={$post_id}&post_category={$post_category}");
if ($readMode->getResult()) {
    $View = new View();
    $tpl_m = $View->Load('article_m');
    ?>
                <footer>
                    <nav>
                        <h3>Veja também:</h3>
                        <?php 
    foreach ($readMode->getResult() as $more) {
        $more->datetime = date('Y-m-d', strtotime($more->post_date));
        $more->pubdate = date('d/m/Y H:i', strtotime($more->post_date));
        $more->post_content = Check::Words($more->post_content, 20);
        $View->Show((array) $more, $tpl_m);
    }
Esempio n. 3
0
$View = new View();
$tpl_g = $View->Load('article_g');
$tpl_m = $View->Load('article_m');
$tpl_p = $View->Load('article_p');
$tpl_empresa = $View->Load('empresa_p');
?>
<!--HOME SLIDER-->
<section class="main-slider">
    <h3>Últimas Atualizações:</h3>
    <div class="container">

        <div class="slidecount">
            <?php 
$cat = Check::CatByName('noticias');
$post = new Read();
$post->setTable('ws_posts');
$post->Query("WHERE post_status = 1 AND (post_cat_parent = :cat OR post_category = :cat) ORDER BY post_date DESC LIMIT :limit OFFSET :offset", "cat={$cat}&limit=3&offset=0");
if (!$post->getResult()) {
    WSErro('Desculpe, ainda não existem notícias cadastradas. Favor volte mais tarde!', WS_INFOR);
} else {
    foreach ($post->getResult() as $slide) {
        $slide->post_title = Check::Words($slide->post_title, 12);
        $slide->post_content = Check::Words($slide->post_content, 38);
        $slide->datetime = date('Y-m-d', strtotime($slide->post_date));
        $slide->pubdate = date('d/m/Y H:i', strtotime($slide->post_date));
        $View->Show((array) $slide, $tpl_g);
    }
}
?>
                
        </div>
    <article class="ads">
        <header>
            <h1>Anúncio Patrocinado:</h1>
            <a href="http://www.upinside.com.br/campus" title="Campus UpInside - Treinamentos em TI 100% em Vídeo aulas">
                <img src="<?php 
echo INCLUDE_PATH;
?>
/_tmp/banner_large.png" alt="UPINSIDE TEINAMENTOS" title="UPINSIDE TEINAMENTOS" />
            </a>
        </header>
    </article>

    <section class="widget art-list last-publish">
        <h2 class="line_title"><span class="oliva">Últimas Atualizações:</span></h2>
        <?php 
$side->setTable('ws_posts');
$side->Query("WHERE post_status = 1 AND post_id != :side ORDER BY post_date DESC LIMIT 3", "side={$post_id}");
if ($side->getResult()) {
    foreach ($side->getResult() as $last) {
        $last->datetime = date('Y-m-d', strtotime($last->post_date));
        $last->pubdate = date('d/m/Y H:i', strtotime($last->post_date));
        $View->Show((array) $last, $tpl_p);
    }
}
?>
    </section>

    <section class="widget art-list most-view">
        <h2 class="line_title"><span class="vermelho">Destaques:</span></h2>
        <?php 
$side->setTable('ws_posts');