<?php include 'connection.php'; include 'funciones.php'; error_reporting(E_ERROR | E_WARNING | E_PARSE); $editdata = json_decode(file_get_contents("php://input")); date_default_timezone_set('America/El_Salvador'); $subseccion = $_GET['subseccion']; /*$seccion = 'deportes'; $subseccion = 'acontecerdeportivo';*/ $contenido = ''; $subinfo = ''; $secinfo = ''; $error = ''; $sub = ''; $subvalidate = mysql_query("SELECT idSubseccion, nombre, url from subseccion where url='{$subseccion}'"); if ($subvalidate) { $subprev = mysql_fetch_row($subvalidate); $subinfo = array('id' => $subprev[0], 'nombre' => $subprev[1], 'url' => $subprev[2]); $sub = subseccion(1); $coninfo = mysql_query("SELECT a.idColumna as id, CONCAT(c.nombres, ' ', c.apellidos) as autor, a.titulo, a.fecha, c.idPersonal as idPersonal, se.nombre as subseccion, se.url as urlSubseccion\n \t\t\t\tfrom personal as c, columna as a, subseccion se\n \t\t\t\twhere c.idPersonal = a.idPersonal and a.activo = 1 and a.idSubseccion = " . $subinfo['id'] . " and a.idSubseccion = se.idSubseccion and a.idSubseccion not in (1,2,3,4,5,6)\n \t\t\t\tORDER BY a.fecha desc, a.hora desc"); while ($result = mysql_fetch_array($coninfo)) { $resultado[] = array('id' => $result['id'], 'idPersonal' => $result['idPersonal'], 'subseccion' => $result['subseccion'], 'urlSubseccion' => $result['urlSubseccion'], 'titulo' => $result['titulo'], 'autor' => $result['autor'], 'fecha' => formatoFecha($result['fecha'])); } } else { $error = array('description' => 'ERROR 404...la seccion seleccionada no existe'); } echo json_encode(array('contenidos' => $resultado, 'error' => $error, 'subinfo' => $subinfo, 'subsecciones' => $sub, 'fotogalerias' => fotogaleria(), 'actualidades' => actualidad(), 'banner1' => banner(1, 1), 'banner2' => banner(1, 2), 'bannerMovil' => banner(1, 'movil'), 'leidos' => leidos(1)));
$periodismo[] = array('id' => $id = $perpreview['id'], 'idPersonal' => $idPersonal = $perpreview['idPersonal'], 'foto' => $foto = $perpreview['foto'], 'titulo' => $titulo = $perpreview['titulo'], 'autor' => $autor = $perpreview['autor'], 'preview' => $preview = $perpreview['preview'], 'fecha' => $fecha = formatoFecha($perpreview['fecha']), 'subseccion' => $subseccion = $perpreview['subseccion'], 'fotografo' => $fotografo = $perpreview['fotografo']); } while ($intpreview = mysql_fetch_array($intinfo)) { $internacional[] = array('id' => $id = $intpreview['id'], 'idPersonal' => $idPersonal = $intpreview['idPersonal'], 'url' => $url = $intpreview['url'], 'foto' => $foto = $intpreview['foto'], 'titulo' => $titulo = $intpreview['titulo'], 'autor' => $autor = $intpreview['autor'], 'preview' => $preview = $intpreview['preview'], 'fecha' => $fecha = formatoFecha($intpreview['fecha']), 'subseccion' => $subseccion = $intpreview['subseccion'], 'fotografo' => $fotografo = $intpreview['fotografo']); } while ($culpreview = mysql_fetch_array($culinfo)) { $cultura[] = array('id' => $id = $culpreview['id'], 'idPersonal' => $idPersonal = $culpreview['idPersonal'], 'url' => $url = $culpreview['url'], 'foto' => $foto = $culpreview['foto'], 'titulo' => $titulo = $culpreview['titulo'], 'autor' => $autor = $culpreview['autor'], 'preview' => $preview = $culpreview['preview'], 'fecha' => $fecha = formatoFecha($culpreview['fecha']), 'subseccion' => $subseccion = $culpreview['subseccion'], 'fotografo' => $fotografo = $culpreview['fotografo']); } while ($polpreview = mysql_fetch_array($polinfo)) { $politica[] = array('id' => $id = $polpreview['id'], 'idPersonal' => $idPersonal = $polpreview['idPersonal'], 'url' => $url = $polpreview['url'], 'foto' => $foto = $polpreview['foto'], 'titulo' => $titulo = $polpreview['titulo'], 'autor' => $autor = $polpreview['autor'], 'preview' => $preview = $polpreview['preview'], 'fecha' => $fecha = formatoFecha($polpreview['fecha']), 'subseccion' => $subseccion = $polpreview['subseccion'], 'fotografo' => $fotografo = $polpreview['fotografo']); } while ($anepreview = mysql_fetch_array($aneinfo)) { $anecdota[] = array('id' => $id = $anepreview['id'], 'idPersonal' => $idPersonal = $anepreview['idPersonal'], 'foto' => $foto = $anepreview['foto'], 'titulo' => $titulo = $anepreview['titulo'], 'autor' => $autor = $anepreview['autor'], 'preview' => $preview = $anepreview['preview'], 'fecha' => $fecha = formatoFecha($anepreview['fecha']), 'subseccion' => $subseccion = $anepreview['subseccion'], 'fotografo' => $fotografo = $anepreview['fotografo']); } while ($entpreview = mysql_fetch_array($entinfo)) { $entrevista[] = array('id' => $id = $entpreview['id'], 'idPersonal' => $idPersonal = $entpreview['idPersonal'], 'foto' => $foto = $entpreview['foto'], 'titulo' => $titulo = $entpreview['titulo'], 'autor' => $autor = $entpreview['autor'], 'preview' => $preview = $entpreview['preview'], 'fecha' => $fecha = formatoFecha($entpreview['fecha']), 'subseccion' => $subseccion = $entpreview['subseccion'], 'fotografo' => $fotografo = $entpreview['fotografo'], 'fotoautor' => $fotoautor = $entpreview['fotoautor']); } while ($rompreview = mysql_fetch_array($rominfo)) { $rompiendo[] = array('id' => $id = $rompreview['id'], 'idPersonal' => $idPersonal = $rompreview['idPersonal'], 'foto' => $foto = $rompreview['foto'], 'titulo' => $titulo = $rompreview['titulo'], 'autor' => $autor = $rompreview['autor'], 'preview' => $preview = $rompreview['preview'], 'fecha' => $fecha = formatoFecha($rompreview['fecha']), 'subseccion' => $subseccion = $rompreview['subseccion'], 'fotografo' => $fotografo = $rompreview['fotografo'], 'fotoautor' => $fotoautor = $rompreview['fotoautor']); } while ($edipreview = mysql_fetch_array($ediinfo)) { $editorial[] = array('id' => $id = $edipreview['id'], 'preview' => $preview = $edipreview['preview'], 'titulo' => $titulo = $edipreview['titulo']); } while ($conpreview = mysql_fetch_array($coninfo)) { $contratabu[] = array('id' => $id = $conpreview['id'], 'foto' => $foto = $conpreview['foto'], 'titulo' => $titulo = $conpreview['titulo'], 'autor' => $autor = $conpreview['autor'], 'preview' => $preview = $conpreview['preview'], 'fecha' => $fecha = formatoFecha($conpreview['fecha']), 'subseccion' => $subseccion = $conpreview['subseccion'], 'fotografo' => $fotografo = $conpreview['fotografo']); } while ($esppreview = mysql_fetch_array($espinfo)) { $especial[] = array('id' => $id = $esppreview['id'], 'foto' => $foto = $esppreview['foto'], 'titulo' => $titulo = $esppreview['titulo'], 'autor' => $autor = $esppreview['autor'], 'preview' => $preview = $esppreview['preview'], 'fecha' => $fecha = formatoFecha($esppreview['fecha']), 'subseccion' => $subseccion = $esppreview['subseccion'], 'idPersonal' => $idPersonal = $esppreview['idPersonal'], 'urlSeccion' => $urlSeccion = $esppreview['urlSeccion'], 'urlSubseccion' => $urlSubseccion = $esppreview['urlSubseccion'], 'fotografo' => $fotografo = $esppreview['fotografo']); } echo json_encode(array('columnistas' => $columnista, 'actualidades' => $actualidad, 'control' => $control, 'tribunas' => $tribuna, 'negocios' => $negocio, 'coyunturas' => $coyuntura, 'analisiss' => $analisis, 'libertades' => $libertad, 'sociedades' => $sociedad, 'resenas' => $resena, 'academias' => $academia, 'deportes' => $deporte, 'periodismos' => $periodismo, 'culturas' => $cultura, 'internacionales' => $internacional, 'politicas' => $politica, 'anecdotas' => $anecdota, 'entrevistas' => $entrevista, 'rompiendos' => $rompiendo, 'editoriales' => $editorial, 'contratabues' => $contratabu, 'especiales' => $especial, 'fotogalerias' => fotogaleria(), 'banner1' => banner(8, 1), 'banner2' => banner(8, 2), 'banner3' => banner(8, 3), 'banner4' => banner(8, 4), 'banner5' => banner(8, 5), 'banner5' => banner(8, 5), 'banner6' => banner(8, 6), 'banner7' => banner(8, 7), 'banner8' => banner(8, 8), 'banner9' => banner(8, 9), 'banner10' => banner(8, 10), 'banner11' => banner(8, 11), 'banner12' => banner(8, 12), 'banner13' => banner(8, 13), 'banner14' => banner(8, 14), 'banner15' => banner(8, 15), 'banner16' => banner(8, 16), 'banner17' => banner(8, 17), 'banner18' => banner(8, 18), 'banner19' => banner(8, 19), 'banner20' => banner(8, 20), 'bannerMovil' => banner(8, 'movil'), 'sondeo' => primerSondeo(), 'caricaturas' => caricatura()));
<?php include 'connection.php'; include 'funciones.php'; error_reporting(E_ERROR | E_WARNING | E_PARSE); $qPersonal = mysql_query("SELECT `idPersonal` ,CONCAT(nombres,' ',apellidos), `cargo`, `rutaFoto` FROM `personal` WHERE `cargo` != 'externo'"); while ($rPersonal = mysql_fetch_array($qPersonal)) { $personal[] = array('id' => $rPersonal[idPersonal], 'nombre' => $rPersonal[1], 'cargo' => $rPersonal['cargo'], 'rutaFoto' => $rPersonal['rutaFoto']); } echo json_encode(array('banner1' => banner(8, 1), 'banner2' => banner(8, 2), 'bannerMovil' => banner(8, 'movil'), 'fotogalerias' => fotogaleria(), 'actualidades' => actualidad(), 'personal' => $personal));
$cont = mysql_query("SELECT a.idArticulo as id, a.titulo, CONCAT(c.nombres, ' ', c.apellidos) as autor, c.idPersonal,\n\t\t\t\t\t\t\t\t\ta.contenido, a.fecha\n\t\t\t\t\t\t\t\t\tfrom articulo a, personal as c\n\t\t\t\t\t\t\t\t\twhere a.idPersonal = c.idPersonal and a.activo = 1\n\t\t\t\t\t\t\t\t\tand a.idArticulo={$id}"); while ($result = mysql_fetch_array($cont)) { $contenido = array('id' => $result['id'], 'idPersonal' => $result['idPersonal'], 'titulo' => $result['titulo'], 'autor' => $result['autor'], 'contenido' => $result['contenido'], 'fecha' => formatoFecha($result['fecha'])); } } else { $cont = mysql_query("SELECT a.idArticulo as id, a.titulo, CONCAT(c.nombres, ' ', c.apellidos) as autor, a.preview, c.idPersonal,\n\t\t\t\t\t\t\t\t\ta.contenido, c.rutaFoto as foto, a.fecha\n\t\t\t\t\t\t\t\t\tfrom articulo a, personal as c\n\t\t\t\t\t\t\t\t\twhere a.idPersonal = c.idPersonal and a.activo = 1\n\t\t\t\t\t\t\t\t\tand a.idArticulo={$id}"); while ($result = mysql_fetch_array($cont)) { $contenido = array('id' => $result['id'], 'idPersonal' => $result['idPersonal'], 'foto' => $result['foto'], 'titulo' => $result['titulo'], 'autor' => $result['autor'], 'contenido' => $result['contenido'], 'preview' => $result['preview'], 'fecha' => formatoFecha($result['fecha'])); } } } elseif ($subinfo['id'] == 49) { $cont = mysql_query("SELECT a.idArticulo as id, a.titulo, CONCAT(c.nombres, ' ', c.apellidos) as autor, c.idPersonal,\n\t\t\t\t\t\t\t\ta.contenido, c.rutaFoto as foto, a.fecha\n\t\t\t\t\t\t\t\tfrom articulo a, personal as c\n\t\t\t\t\t\t\t\twhere a.idPersonal = c.idPersonal and a.activo = 1\n\t\t\t\t\t\t\t\tand a.idArticulo={$id}"); while ($result = mysql_fetch_array($cont)) { $contenido = array('id' => $result['id'], 'idPersonal' => $result['idPersonal'], 'foto' => $result['foto'], 'titulo' => $result['titulo'], 'autor' => $result['autor'], 'contenido' => $result['contenido'], 'fecha' => formatoFecha($result['fecha'])); } } else { $cont = mysql_query("SELECT a.idArticulo as id, a.titulo, CONCAT(c.nombres, ' ', c.apellidos) as autor, a.contenido, a.preview, c.idPersonal,\n\t\t\t\t\t\t\t\t i.rutaFoto as foto, a.fecha, f.nombre as fotografo\n\t\t\t\t\t\t\t\t\tfrom articulo as a, personal as c, fotografo as f, imagenesarticulo as i\n\t\t\t\t\t\t\t\t\twhere a.idArticulo = i.idArticulo and a.idPersonal = c.idPersonal and i.idFotografo = f.idFotografo and a.activo = 1\n\t\t\t\t\t\t\t\t\tand i.posicion='principal' and a.idArticulo={$id}"); if ($_GET['pr'] != 'si') { while ($result = mysql_fetch_array($cont)) { $contenido = array('id' => $result['id'], 'idPersonal' => $result['idPersonal'], 'foto' => $result['foto'], 'titulo' => $result['titulo'], 'autor' => $result['autor'], 'preview' => $result['preview'], 'contenido' => $result['contenido'], 'fecha' => formatoFecha($result['fecha']), 'fotografo' => $result['fotografo']); } } } } else { $error = array('description' => 'ERROR 404...la seccion seleccionada no existe'); } } else { $error = array('description' => 'ERROR 404...la subseccion seleccionada no existe'); } echo json_encode(array('contenido' => $contenido, 'error' => $error, 'secinfo' => $secinfo, 'subinfo' => $subinfo, 'subsecciones' => $sub, 'fotogaleria' => fotogaleria(), 'banner1' => banner($secinfo['id'], 1), 'banner2' => banner($secinfo['id'], 2), 'bannerMovil' => banner($secinfo['id'], 'movil'), 'bannerPost' => banner($secinfo['id'], 'post'), 'leidos' => leidos($secinfo['id'])));
<?php include 'connection.php'; include 'funciones.php'; error_reporting(E_ERROR | E_WARNING | E_PARSE); date_default_timezone_set('America/El_Salvador'); $editdata = json_decode(file_get_contents("php://input")); $id = $_GET['id']; // $id = 14; $error = ""; $autorinfo = mysql_query("SELECT CONCAT(nombres,' ',apellidos), descripcion, rutaFoto, cargo, (select facebook from usuario where idPersonal={$id}) as facebook,\n (select twitter from usuario where idPersonal={$id}) as twitter, (select googleplus from usuario where idPersonal={$id}) as googleplus,\n (select linkedin from usuario where idPersonal={$id}) as linkedin, (select mail from usuario where idPersonal={$id}) as mail\n FROM personal\n WHERE idPersonal={$id}"); if ($autorinfo) { $autorvalidate = mysql_fetch_row($autorinfo); $autor = array('id' => $id, 'nombre' => $autorvalidate[0], 'descripcion' => $autorvalidate[1], 'foto' => $autorvalidate[2], 'cargo' => $autorvalidate[3], 'facebook' => $autorvalidate[4], 'twitter' => $autorvalidate[5], 'googleplus' => $autorvalidate[6], 'linkedin' => $autorvalidate[7], 'mail' => $autorvalidate[8]); $artinfo = mysql_query("SELECT a.idArticulo as id, a.titulo,a.preview, a.fecha, s.nombre, s.url, CONCAT(c.nombres, ' ', c.apellidos) as autor, se.url as urlSeccion\n FROM articulo a, personal c, subseccion s, seccion se\n where a.idPersonal = {$id} and a.idSubseccion = s.idSubseccion and a.idPersonal = c.idPersonal and s.idSeccion = se.idSeccion\n ORDER BY a.fecha desc, a.hora desc"); $colinfo = mysql_query("SELECT a.idColumna as id, a.titulo, a.fecha, CONCAT(c.nombres, ' ', c.apellidos) as autor\n FROM columna a, personal c\n where a.idPersonal = {$id} and a.idPersonal = c.idPersonal\n ORDER BY a.fecha desc, a.hora desc"); while ($artpreview = mysql_fetch_array($artinfo)) { $articulos[] = array('id' => $id = $artpreview['id'], 'titulo' => $titulo = $artpreview['titulo'], 'fecha' => $fecha = formatoFecha($artpreview['fecha']), 'subseccion' => $subseccion = $artpreview['nombre'], 'url' => $url = $artpreview['url'], 'urlSeccion' => $urlSeccion = $artpreview['urlSeccion'], 'autor' => $id = $artpreview['autor'], 'preview' => $preview = $artpreview['preview']); } while ($colpreview = mysql_fetch_array($colinfo)) { $articulos[] = array('id' => $id = $colpreview['id'], 'titulo' => $titulo = $colpreview['titulo'], 'fecha' => $fecha = formatoFecha($colpreview['fecha']), 'subseccion' => "Columnistas", 'url' => "columnistas", 'autor' => $id = $colpreview['autor']); } } else { $error = "AUTOR NO ENCONTRADO"; } echo json_encode(array('autor' => $autor, 'articulos' => $articulos, 'fotogalerias' => fotogaleria(), 'actualidades' => actualidad(), 'banner1' => banner(8, 1), 'banner2' => banner(8, 2), 'bannerMovil' => banner(8, 'movil')));