queryToArray($sql_query); $total_noticies = count($Noticies); $noticies_x_pagina = 10; $pagines = $total_noticies/$noticies_x_pagina; $pagina_actual = $_REQUEST['p']; if(is_float($pagines)): $pagines=floor($pagines+1); endif; if(!$pagina_actual || !is_numeric($pagina_actual) || $pagina_actual > $pagines || $pagina_actual < 1): $pagina_actual = 1; $init = 0; $final = $noticies_x_pagina; else: $init = $noticies_x_pagina*($pagina_actual - 1); $final = $noticies_x_pagina; endif; $sql_query="SELECT wp.*,wpt.Titol,wpt.Intro,wpt.Contingut,wpt.Url_Amigable FROM Noticies AS wp LEFT JOIN Noticies_Traduccio AS wpt ON wpt.Id_Noticia = wp.Id_Noticia AND wpt.Id_Idioma_Traduccio = '1' WHERE wp.Estat = 1 AND wpt.Id_Noticia = wp.Id_Noticia ORDER BY Data DESC LIMIT ".$init.",".$final; $Noticies=$Funcions->queryToArray($sql_query); $Links['es'] = "blog_es.php"; $web_header=$Funcions->Header($title,$meta_description,$meta_keywords,$idioma, 0, $Links, 5); $web_footer=$Funcions->Footer($idioma, 0); $smarty = new Smarty; $smarty->assign("template",DIRECTORI_TEMPLATE); $smarty->assign("idioma",$idioma); $smarty->assign("Config",$Config); $smarty->assign("Noticies",$Noticies); $smarty->assign("Pagines",$pagines); $smarty->assign("PaginaActual",$pagina_actual); $web_content = $smarty->fetch(WEB_PATH."/templates/".$idioma.$directori_templates."/noticies.htm"); echo $web_header; echo $web_content; echo $web_footer; ?>