// $migasDinamicas >> 0 [Fijas - Propias del archivo] || $migasDinamicas >> 1 [Por SQL]
$migasDinamicas = 0;
if ($subcanal_id != '') {
$qMigas = new DB_Sql_ext;
$qMigas->connect($panel_Database, $panel_Host, $panel_User, $panel_Password);
$qMigas->Debug = $panel_Debug;
$qMigas->Halt_On_Error = $panel_Halt_On_Error;
$qMigasSql = "SELECT titulo_".$pref_idioma[$s_lng].", nombre_largo_".$pref_idioma[$s_lng]." FROM admin_canales INNER JOIN admin_subcanales ON admin_canales.id = admin_subcanales.id_canal WHERE admin_subcanales.id = ".$subcanal_id;
if ($qMigas->query($qMigasSql)) {
if ($qMigas->num_rows() >= 1) {
$migasDinamicas = 1;
$qMigas->next_record();
$nombre_canal_mostrar = $qMigas->f("titulo_".$pref_idioma[$s_lng]);
$nombre_subcanal_mostrar = $qMigas->f("nombre_largo_".$pref_idioma[$s_lng]);
}
}
}
?>
echo $msgcabeceraplantilla[12][$s_lng]; // estás en ?> //
if ($migasDinamicas == 1) { // Migas Dinámicas
$string_camino_migas = "";
if (trim($nombre_canal_mostrar) != "") {
$string_camino_migas = strtoupper($nombre_canal_mostrar)." / ";
}
if (trim($nombre_subcanal_mostrar) != "") {
$string_camino_migas .= ''.$nombre_subcanal_mostrar.'';
}
if (trim($string_camino_migas) != "") {
echo $string_camino_migas;
}
} else { // Migas Fijas
// Se escribe manualmente el Camino de Migas
// para los casos de apartados a los que
// no se accede por el Men Principal
}
?> //
echo $nombre_recurso; ?>
if ($s_lng == "0") {
echo " - Llistat";
} elseif ($s_lng == "1") {
echo " - Listado";
} ?>
echo $msg_revista[0][$s_lng]; ?>
$startLimit = $_REQUEST["startLimit"];
$limitPerPage = $_REQUEST["limitPerPage"];
// PAGINACIN ----------
$initStartLimit = 0;
if (!isset($startLimit)) {
$startLimit = $initStartLimit;
$limitPerPage = $listado_max_registros;
}
if ($limitPerPage != 'all') $querylimit = " LIMIT $startLimit, $limitPerPage ";
$nextStartLimit = $startLimit + $limitPerPage;
$previousStartLimit = $startLimit - $limitPerPage;
$q = new DB_Sql_ext;
$q->connect($panel_Database, $panel_Host, $panel_User, $panel_Password);
$q->Debug = $panel_Debug;
$q->Halt_On_Error = $panel_Halt_On_Error;
$Where = " WHERE estado = 2";
$OrderBy = " ORDER BY fecha DESC, id DESC";
// contar el total de todos los registros sin limitarlos
$querycount = "SELECT COUNT(id) AS contador FROM $catalogo_tabla".$Where;
if ($q->query($querycount)) {
$q->next_record();
$tot_registros = $q->f('contador'); // $tot_registros tiene la cuenta de todos los elementos de la BB.DD SIN limitar
}
$qnoticias = "SELECT *, DATE_FORMAT(fecha,'%d/%m/%y') AS fecha_formateada FROM $catalogo_tabla".$Where.$OrderBy.$querylimit;
if ($q->query($qnoticias)) {
if ($q->num_rows() >= 1) {
while ($q->next_record()) {
$id = $q->f("id");
$fecha = $q->f("fecha_formateada");
$titulo = $q->f("titulo_".$pref_idioma[$s_lng]);
// $subtitulo = $q->f("subtitulo_".$pref_idioma[$s_lng]);
// $fotos = unserialize($q->f("fotos"));
$archivos = unserialize($q->f("archivos"));
// $tabnoticias[] = array("id"=>$id, "fecha"=>$fecha, "titulo"=>$titulo, "texto"=>$texto, "fotos"=>$fotos);
// $tabnoticias[] = array("id"=>$id, "fecha"=>$fecha, "titulo"=>$titulo, "subtitulo"=>$subtitulo);
$tabnoticias[] = array("id"=>$id, "fecha"=>$fecha, "titulo"=>$titulo, "archivos"=>$archivos);
}
}
}
?>
if (count($tabnoticias) == 0) { ?>
echo $msg_noticias[0][$s_lng]; ?>
} else { ?>
for ($t = 0; $t < count($tabnoticias); $t++) {
$el_enlace_detalle = genera_link_seo("", $siglas_seo, $tabnoticias[$t]["titulo"], $tabnoticias[$t]["id"]);
//$el_enlace_detalle = $enlace_detalle.$tabnoticias[$t]["id"];
$el_enlace_detalle = $www_path.$upload_dir."/".$tabnoticias[$t]["archivos"][1]['fichero'] ?>
// fecha - titulo - subtitulo ?>
-
echo($tabnoticias[$t]["titulo"]); ?>
// $tamanio_txt = strlen($tabnoticias[$t]["subtitulo"]);
// if ($tamanio_txt > $max_tamanio_txt) {
// echo (substr($tabnoticias[$t]["subtitulo"], 0, $max_tamanio_txt)."...");
// } else {
// echo ($tabnoticias[$t]["subtitulo"]);
// } ?>
}
} ?>
$inipag = $startLimit + 1;
if ($inipag > $tot_registros) { $inipag = $tot_registros; }
if ($limitPerPage == 'all') {
$finpag = $tot_registros;
} else {
$finpag = $startLimit + $limitPerPage;
if ($finpag > $tot_registros) { $finpag = $tot_registros; }
}
// Mostrando del X al Y de un total de Z ?>
echo $msg_noticias[7][$s_lng]; ?> echo $inipag; ?> echo $msg_noticias[8][$s_lng]; ?> echo $finpag; ?> echo $msg_noticias[9][$s_lng]; ?> echo $tot_registros; ?>
// ENLACES DE >> Listado Paginado | Listado Completo
if ($limitPerPage == 'all') {
// Si Listado Completo >> enlace a Listado Paginado ?>
} else {
// Sino ... ?>
if ($tot_registros > $limitPerPage) {
// Si ms de una pgina de registros >> enlace a Listado Completo ?>
echo $msg_noticias[10][$s_lng]; ?>
} else { ?>
echo $msg_noticias[10][$s_lng]; ?>
} ?>
} ?>
// ENLACES DE >> Pg. Anterior | Pg. Siguiente
if ($limitPerPage != 'all') { ?>
// >> Pg. Siguiente v| Para que no saque una ltima pgina sin resultados
if ($nextStartLimit < $tot_registros) { //if ($nextStartLimit <= $tot_registros) { ?>
echo $msg_noticias[13][$s_lng]; ?>
}// else { ?>
//echo $msg_noticias[12][$s_lng]; ?>
//} ?>
} ?>