当前位置: 首页>>代码示例>>PHP>>正文


PHP Read::setTable方法代码示例

本文整理汇总了PHP中Read::setTable方法的典型用法代码示例。如果您正苦于以下问题:PHP Read::setTable方法的具体用法?PHP Read::setTable怎么用?PHP Read::setTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Read的用法示例。


在下文中一共展示了Read::setTable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Read

            <?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;
开发者ID:adrianosilvareis,项目名称:FrameWork_Front,代码行数:30,代码来源:home.php

示例2: Read

                                </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);
    }
开发者ID:adrianosilvareis,项目名称:FrameWork_Front,代码行数:31,代码来源:artigo.php

示例3: View

$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>
开发者ID:adrianosilvareis,项目名称:FrameWork_Front,代码行数:31,代码来源:index.php

示例4: foreach

    <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');
开发者ID:adrianosilvareis,项目名称:FrameWork_Front,代码行数:31,代码来源:sidebar.inc.php


注:本文中的Read::setTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。