<?php
/*********************************************
Description: Processa página inicial
File: /includes/pg.php
Project: Basikus
Developers: João Vieira
Start Date: 2009/12/21
*********************************************/

if(!$smartyPg->is_cached($strPagina . ".html", $strPagina)){

    //meta tags

    $paginaTitle		= "Sport Golf";
    $paginaKeywords		= "sport, golf";
    $paginaDescription		= "Sport golf.";

    //lista notícias total
    $smartyPg->assign('listaNoticiasTotal', array());
    $intCategoria		= '1';
    $respostaDb->GetConteudos($intCategoria, "20", "AND conteudos.protegido LIKE 'NAO' AND DATE_FORMAT(conteudos.dataentrada, '%Y%m%d') <= DATE_FORMAT(NOW(), '%Y%m%d') AND DATE_FORMAT(conteudos.datasaida, '%Y%m%d') > DATE_FORMAT(NOW(), '%Y%m%d') ORDER BY conteudos.dataentrada DESC");
    $respostaDb->oBug	= false;
    $rowResultDb	= NULL;
    if ( $resultDb = $respostaDb->puXa() ){
	$listaConteudos	= array();
	$indice 	= 0;
	while($rowResultDb = $resultDb->fetch(PDO::FETCH_ASSOC)){
	    $listaConteudos[$indice]['id']	= $rowResultDb['cid'];
	    $listaConteudos[$indice]['titulo']	= trd($rowResultDb['ctitulo'], $siteLng);
	    $listaConteudos[$indice]['texto']	= substr(strip_tags(trd($rowResultDb['ctexto'], $siteLng)), 0, 90);
	    $listaConteudos[$indice]['dia']	= $rowResultDb['cdataentrada'];
	    $listaConteudos[$indice]['metaurl']	= trd($rowResultDb['cmetaurl'], $siteLng);
	    if ( strlen(trim($listaConteudos[$indice]['metaurl'])) < 5 ) $listaConteudos[$indice]['metaurl'] = formata_urllink($listaConteudos[$indice]['titulo']);
	    $indice++;
	}
	$smartyPg->assign('listaNoticiasTotal', $listaConteudos);
    }


}
?>