function conexion() { //if (!($link=mysql_connect("lldd075.servidoresdns.net","qcw513","Comercio49"))) if (!($link=mysql_connect('qnw887.dbname.net','qnw887','Anali4799'))) { echo "No se pudo conectar: " . mysql_error(); } //if (!mysql_select_db("rttviaje_programas",$link)) if (!mysql_select_db('qnw887',$link)) { exit(); } return $link; } $link=conexion(); $sql_pagina = "select * from Paginas where Nombre='".$pagina."'"; $res_pagina = mysql_query($sql_pagina); $row_pagina = mysql_fetch_array($res_pagina); ?>
NOTICIAS Y EVENTOS
// maximo por pagina $limit = 7; // pagina pedida $pag = (int) $_GET["pag"]; if ($pag < 1) { $pag = 1; } $offset = ($pag-1) * $limit; $sql= "select SQL_CALC_FOUND_ROWS * from Noticias where Tipo=1"; $sql.=" order by Id_not DESC LIMIT $offset, $limit"; $sqlTotal = "SELECT FOUND_ROWS() as total"; $res = mysql_query($sql); $rsTotal = mysql_query($sqlTotal); $rowTotal = mysql_fetch_assoc($rsTotal); // Total de registros sin limit $total = $rowTotal["total"]; $totalPag = ceil($total/$limit); $meses = array(1 => 'ENERO', 'FEBRERO', 'MARZO', 'ABRIL', 'MAYO', 'JUNIO','JULIO', 'AGOSTO', 'SEPTIEMBRE', 'OCTUBRE', 'NOVIEMBRE', 'DIECIEMBRE'); ?>FECHA:
}
$links = array();
?>
for( $i=1; $i<=$totalPag ; $i++){
if($pag==$i){
$clase = 'num_pag_marcado';
$clase2 = 'marcado';
}else{
$clase = 'num_pag';
$clase2 = '';
}
if($subcategoria2!=''){
$subcategoria_c = urlencode($subcategoria2);
}else{
$subcategoria_c = urlencode($row_subcat['Codigo']);
}
$links[] = "";
}
?>
echo implode("", $links);
if($totalPag>$_GET['pag']){
?>
}
?>