include 'includes/constantes.php'; include 'includes/conexion.php'; include 'includes/xslt-php4-to-php5.php'; include 'includes/funciones.php'; include 'includes/apoyos.php'; // Recojo parametros $path_info = $_SERVER['PATH_INFO']; $variables = explode('/', $path_info); $dirPaginas = '/expert/htwebs/especiales-sarenet/especiales/elecciones-2008/includes/html/paginas/'; // GENERACION ESTATICA SI NO TIENE MAS DE 5 MINUTOS /* $pag = $dirPaginas . str_replace('/', '#', $_SERVER['SCRIPT_URI']); $tiempo_fichero = file_exists($pag) ? filectime($pag) : 0; $min_fichero = file_exists($pag) ? date('i', filectime($pag)) : 0; $min_ahora = date('i'); $min_diff = $min_ahora - $min_fichero; if(file_exists($pag) && $min_diff < 5) { $pag = str_replace('#', '/', $pag); ob_start(); include $_SERVER['SCRIPT_URI']; $contenido = ob_get_contents(); ob_end_clean(); echo $contenido; exit; } */ // FIN GENERACION ESTATICA if($variables[1] && is_numeric($variables[1]) && strlen($variables[1]) == 8) { $fecha = $variables[1]; } else if($variables[1] == 'apoyo') { $noticiaid = $variables[2]; if(is_numeric($noticiaid)) { include 'articulo.php'; exit; } } else { // Recojo la fecha del ultimo dia con noticias $sql = "SELECT fecha from noticias where (periodico like '" . $periodico . "' OR periodico like 'RC') AND (destino='' or destino IS NULL or destino='elecciones generales-autonomicas' or destino='elecciones generales') order by fecha desc limit 1"; $res = mysql_query($sql); if($fila = mysql_fetch_row($res)) { $fecha = $fila[0]; $fecha = str_replace('-', '', $fecha); } else { $fecha = date('Ymd'); } } if($variables[2] && strstr($variables[2], '.html')) { $pag = substr($variables[2], 0, strlen($variables[2]) - 5); if(!is_numeric($pag)) $pag = 1; } if($variables[2] && is_numeric($variables[2])) { $noticiaid = $variables[2]; if(is_numeric($noticiaid)) { include 'articulo.php'; exit; } } // FIN Recojo parametros $annio = substr($fecha, 0, 4); $mes = substr($fecha, 4, 2); $dia = substr($fecha, 6, 2); $dia_ver = $dia; settype($dia_ver, 'integer'); // Array en el q guardare el numero de noticias de cada dia del mes seleccionado $arrNot = Array(); for($i = 1; $i<32; $i++) { $arrNot[$i] = ''; } /* if($periodico == 'abc' || $periodico == 'abcdesevilla') { $sql = "SELECT titulo, fecha from noticias where fecha like '" . $annio . '-' . $mes . "%' AND (periodico like '" . $periodico . "') AND (destino='' or destino IS NULL or destino='elecciones generales-autonomicas' or destino='elecciones generales') order by fecha"; } else { $sql = "SELECT titulo, fecha from noticias where fecha like '" . $annio . '-' . $mes . "%' AND (periodico like '" . $periodico . "' OR periodico like 'RC') AND (destino='' or destino IS NULL or destino='elecciones generales-autonomicas' or destino='elecciones generales') order by fecha"; } */ $sql = "SELECT distinct(titulo), fecha from noticias where fecha like '" . $annio . '-' . $mes . "%' AND (periodico like '" . $periodico . "' OR periodico like 'RC') AND (destino='' or destino IS NULL or destino='elecciones generales-autonomicas' or destino='elecciones generales') order by fechapublicacion desc,edicion desc"; $res = mysql_query($sql); while($fila = mysql_fetch_row($res)) { $fechaNot = $fila[1]; $arr = explode('-', $fechaNot); $dd = $arr[2]; settype($dd, 'integer'); $arrNot[$dd] += 1; } $PAGINACION = 10; // De 10 en 10 // Paginacion de las noticias if($arrNot[$dia_ver] > $PAGINACION) { $total = $arrNot[$dia_ver]; $numPaginas = ceil($total/$PAGINACION); if($pag > $numPaginas) $pag = $numPaginas; if(!$pag || $pag <= 0) $pag = 1; $inicio = $PAGINACION*($pag - 1); $fin = $inicio + $PAGINACION; if($numPaginas > 0) { if($pag > 1) { $paginacion = '
Actualidad elecciones |