本文整理汇总了PHP中Check::CatByName方法的典型用法代码示例。如果您正苦于以下问题:PHP Check::CatByName方法的具体用法?PHP Check::CatByName怎么用?PHP Check::CatByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Check
的用法示例。
在下文中一共展示了Check::CatByName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AND
<aside class="col-md-4">
<h1 class="semantica">SIDERBAR RIGHT</h1>
<section class="nomargin section">
<h1 class="nomargin"><a href="<?php
echo HOME;
?>
/categoria/links/" class="btn btn-site">Links</a></h1>
<?php
$cat = Check::CatByName('links');
$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=2&offset=0", true);
if (!$Read->Execute()->getResult()) {
echo "<div style='display: block;margin-top:40px;'>\n";
WSErro("Desculpe, não temos posts no momento, favor volte mais tarde!", WS_INFOR);
echo "</div>\n";
} else {
foreach ($Read->Execute()->getResult() as $row) {
echo "<div class='lateral'>";
$row->datetime = date('Y-m-d', strtotime($row->post_date));
$row->pubdate = date("d/m/Y H:i", strtotime($row->post_date));
$View->Show((array) $row, $tpl_m);
echo "</div>";
}
}
?>
</section>
<!--facebook-->
<div id="fb-root"></div>
<script>(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id))
示例2: date
$news->datetime = date('Y-m-d', strtotime($news->post_date));
$news->pubdate = date('d/m/Y H:i', strtotime($news->post_date));
$View->Show((array) $news, $tpl_p);
}
}
}
?>
</div>
</section>
<section class="baladas">
<h2 class="line_title"><span class="azul">Baladas:</span></h2>
<?php
$cat = Check::CatByName('Baladas');
if ($cat) {
$post->Busca("cat={$cat}&limit=1&offset=0");
if (!$post->getResult()) {
WSErro('Desculpe, não existe uma noticia destaque para ser exibida. Favor, volte depois', WS_INFOR);
} else {
$new = $post->getResult()[0];
$new->post_title = Check::Words($new->post_title, 9);
$new->post_content = Check::Words($new->post_content, 20);
$new->datetime = date('Y-m-d', strtotime($new->post_date));
$new->pubdate = date('d/m/Y H:i', strtotime($new->post_date));
$View->Show((array) $new, $tpl_m);
}
}
?>
示例3: WsPosts
<h1><small><a href="<?php
echo HOME . '/grupo/' . $Categoria;
?>
" 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);
示例4: WsPosts
<?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);
示例5: WsPosts
<?php
$cat = Check::CatByName("noticias");
$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 post_date LIMIT 3", "cat={$cat}", true);
if (!$Read->Execute()->getResult()) {
WSErro("Opps! Não temos artigos em destaques!", WS_INFOR);
} else {
?>
<div class="row">
<div class="col-md-8">
<div id="carousel" data-interval="4000" class="carousel slide well" data-ride="carousel">
<div class="carousel-inner" >
<?php
$View = new View();
$siderbar = $View->Load("carousel_full");
foreach ($Read->Execute()->getResult() as $bar) {
$gallery = new WsPostsGallery();
$gallery->setPost_id($bar->post_id);
$gallery->Execute()->Query("#post_id#");
foreach ($gallery->Execute()->getResult() as $gal) {
$gal->post_title = $bar->post_title;
$gal->datetime = date('Y-m-d', strtotime($bar->post_date));
$gal->pubdate = date("d/m/Y H:i", strtotime($bar->post_date));
$gal->post_content = Check::Words($bar->post_content, 30);
$gal->class = $c == 0 ? "item active" : "item";
if (!$bar->post_url) {
$gal->post_url = "#HOME#/artigo/{$bar->post_name}";
} else {
示例6:
?>
<?php
$Titulo = "Destaques";
$Categoria = "destaques";
$Ordem = "post_date";
// $Offset = 3;
include "inc/noticias_tres.inc.php";
?>
<?php
$Titulo = "Convênios";
$Categoria = "convenios";
$Ordem = "post_views";
include "inc/noticias_tres.inc.php";
?>
<?php
$Titulo = "Nota Fiscal";
$Categoria = "nota-fiscal";
$Ordem = "post_views";
include "inc/noticias_tres.inc.php";
?>
</div>
<?php
//coluna direita
$cat = Check::CatByName("siderbar-left");
$fixo = Check::CatByName("siderbar-left-fixo");
require "inc/siderbar.inc.php";
示例7: WsPosts
$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
if ($Read->Execute()->getRowCount() > 1) {
?>
<ol class="carousel-indicators">
<?php
$i = 0;