
header('Content-Type: text/html; charset=iso-8859-1'); include 'app-config/site.config.php'; require_once 'app-config/database.config.php'; require_once 'classes/models/activeRecord.php'; require_once 'classes/models/post.php'; require_once 'classes/models/comentario.php'; require_once 'classes/models/categoria.php'; require_once 'classes/utils/paginator.php'; require_once 'classes/utils/twitter.php'; $post = new Post; $categoria = new Categoria; $comentario = new Comentario; $categorias = $categoria->find('all')->toArray(); if(!isset($_GET['p'])){ $_GET['p'] = null; } //mostra por categoria if($_GET['idCategoria'] == "1"){ $where = "1=1 AND idCategoria != 0 "; }elseif($_GET['idCategoria'] != ""){ $where = "idCategoria != 'MATERIAS' AND idCategoria = ".$_GET['idCategoria']; }elseif($_GET['idCategoria'] == "1"){ $where = "1=1 AND idCategoria != 0 "; } // paginação //configurações: $paginator = new Paginator(); //cria o objeto $paginator->set_itens_per_page(6); //itens mostrados por página $paginator->set_current_page($_GET['p']); //variável da pagina corrente $paginator->set_css_class('paginator'); //classe css da ul do paginator $paginator->set_url_vars("&idCategoria=".$_GET['idCategoria']); //variaveis adicionais //$paginator->set_url('list.fotos.php'); //url dos numeros do paginator, por default é a pagina atual $total = $post->count('* as total')->where($where)->toArray();// retorna o numero de itens $paginator->total = $total[0]['total']; //total de itens da query if ($paginator->total){ $posts = $post->find('all')->order('data DESC')->where($where)->limit($paginator->get_begin().", ".$paginator->get_offset())->toArray(); } else $posts = false; ?>
Preencha os campos abaixo para logar-se a nossa área restrita:
Livro
A FORÇA DO POVO
[ clique para fazer download ]
count('* as total')->where("idPost = ".$posts[$i]['idPost'])->toArray();// retorna o numero de itens
$total = $comentarios[0]['total']; //total de itens da query
?>
setlocale(LC_TIME, 'ptb', 'pt_BR', 'portuguese-brazil', 'bra', 'brazil', 'pt_BR.utf-8', 'pt_BR.iso-8859-1','br');
$dia=strftime("%d %B , %Y",$posts[$i]['data']);
?>