/*$seccion = 'deportes'; $subseccion = 'acontecerdeportivo';*/ $contenido = ''; $subinfo = ''; $secinfo = ''; $error = ''; $sub = ''; $secvalidate = mysql_query("SELECT idSeccion, nombre, url from seccion where url='{$seccion}'"); if ($secvalidate) { $secprev = mysql_fetch_row($secvalidate); $secinfo = array('id' => $secprev[0], 'nombre' => $secprev[1], 'url' => $secprev[2]); $subvalidate = mysql_query("SELECT idSubseccion, nombre, url from subseccion where url='{$subseccion}' and idSeccion=" . $secinfo['id']); if ($subvalidate) { $subprev = mysql_fetch_row($subvalidate); $subinfo = array('id' => $subprev[0], 'nombre' => $subprev[1], 'url' => $subprev[2]); $sub = subseccion($secinfo['id']); if ($secinfo['id'] == 1) { if ($subinfo['id'] == 2) { $contenido = columna(); } elseif ($subinfo['id'] == 6) { $contenido = articulos($subinfo['id']); } else { $contenido = opinion($subinfo['id']); } } elseif ($subinfo['id'] == 49) { $str = "SELECT a.idArticulo as id, a.titulo, CONCAT(c.nombres, ' ', c.apellidos) as autor, c.idPersonal as idPersonal,\n\t\t\t\t\ta.preview, c.rutaFoto as foto, a.fecha\n\t\t\t\t\tfrom articulo a, personal as c\n\t\t\t\t\twhere a.idPersonal = c.idPersonal\n\t\t\t\t\tand a.idSubseccion = 49\n\t\t\t\t\tORDER BY a.fecha desc, a.hora desc"; $query = mysql_query($str); while ($result = mysql_fetch_array($query)) { $resultado[] = array('id' => $result['id'], 'idPersonal' => $result['idPersonal'], 'foto' => $result['foto'], 'titulo' => $result['titulo'], 'autor' => $result['autor'], 'preview' => $result['preview'], 'fecha' => formatoFecha($result['fecha'])); } $contenido = $resultado;
<?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'); $soninfo = mysql_query("SELECT idSondeo, titulo, pregunta, fecha, rutaFoto as foto\n\t\t\t\t\t\t\t\t\t\t\tFROM sondeo\n WHERE activo = 1 and pagado = 1\n order by fecha desc, hora desc\n limit 1"); $sonpreview = mysql_fetch_row($soninfo); $sondeo[] = array('idSondeo' => $sonpreview[0], 'titulo' => $sonpreview[1], 'pregunta' => $sonpreview[2], 'fecha' => formatofecha2($sonpreview[3]), 'foto' => $sonpreview[4], 'respuestas' => respuestas($sonpreview[0]), 'total' => maxTotal($sonpreview[0])); echo json_encode(array('contenido' => $sondeo, 'subsecciones' => subseccion(1), 'banner1' => banner(1, 1), 'banner2' => banner(1, 2), 'banner3' => banner(1, 3), 'bannerMovil' => banner(1, 'movil'), 'leidos' => leidos(1)));
<?php include 'connection.php'; include 'funciones.php'; error_reporting(E_ERROR | E_WARNING | E_PARSE); date_default_timezone_set('America/El_Salvador'); echo json_encode(array('subsecciones' => subseccion(1), 'contenidos' => caricaturap(), 'banner1' => banner(1, 1), 'banner2' => banner(1, 2), 'banner3' => banner(1, 3), 'bannerMovil' => banner(1, 'movil'), 'leidos' => leidos(1)));
<?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)));
<?php include 'connection.php'; include 'funciones.php'; error_reporting(E_ERROR | E_WARNING | E_PARSE); date_default_timezone_set('America/El_Salvador'); echo json_encode(array('politicas' => articulo(37), 'gobiernos' => articulo(38), 'partidos' => articulo(39), 'subsecciones' => subseccion(2), 'banner1' => banner(2, 1), 'banner2' => banner(2, 2), 'banner3' => banner(2, 3), 'banner4' => banner(2, 4), 'bannerMovil' => banner(2, 'movil'), 'leidos' => leidos(2)));
<?php include 'connection.php'; include 'funciones.php'; error_reporting(E_ERROR | E_WARNING | E_PARSE); date_default_timezone_set('America/El_Salvador'); echo json_encode(array('centroamericas' => articulo(42), 'latinoamericas' => articulo(43), 'globales' => articulo(44), 'subsecciones' => subseccion(3), 'banner1' => banner(3, 1), 'banner2' => banner(3, 2), 'banner3' => banner(3, 3), 'banner4' => banner(3, 4), 'bannerMovil' => banner(3, 'movil'), 'leidos' => leidos(3)));
<?php include 'connection.php'; include 'funciones.php'; error_reporting(E_ERROR | E_WARNING | E_PARSE); date_default_timezone_set('America/El_Salvador'); $bolinfo = mysql_query("SELECT nombre, porcentaje, valor, fecha, ciudad from bolsa"); $intinfo = mysql_query("SELECT nombre, porcentaje, fecha from tasainteres"); $divinfo = mysql_query("SELECT nombre, cambio, pais, fecha from divisa"); $datinfo = mysql_query("SELECT indicador, periodo, cifras, enlaceDetalles as enlace from datoseconomicos"); $merinfo = mysql_query("SELECT nombre, descripcion, cambio, porcentaje, menor, masAlto, ultimo, fecha from mercado"); while ($bolpreview = mysql_fetch_array($bolinfo)) { $bolsa[] = array('nombre' => $bolpreview['nombre'], 'fecha' => $bolpreview['fecha'], 'valor' => $bolpreview['valor'], 'ciudad' => $bolpreview['ciudad'], 'porcentaje' => $bolpreview['porcentaje']); } while ($intpreview = mysql_fetch_array($intinfo)) { $interes[] = array('nombre' => $intpreview['nombre'], 'fecha' => $intpreview['fecha'], 'porcentaje' => $intpreview['porcentaje']); } while ($divpreview = mysql_fetch_array($divinfo)) { $divisa[] = array('nombre' => $divpreview['nombre'], 'pais' => $divpreview['pais'], 'fecha' => formatoFecha2($divpreview['fecha']), 'cambio' => $divpreview['cambio']); } while ($datpreview = mysql_fetch_array($datinfo)) { $dato[] = array('indicador' => $datpreview['indicador'], 'periodo' => $datpreview['periodo'], 'cifras' => $datpreview['cifras'], 'enlace' => $datpreview['enlace']); } while ($merpreview = mysql_fetch_array($merinfo)) { $mercado[] = array('nombre' => $merpreview['nombre'], 'descripcion' => $merpreview['descripcion'], 'cambio' => $merpreview['cambio'], 'porcentaje' => $merpreview['porcentaje'], 'menor' => $merpreview['menor'], 'masAlto' => $merpreview['masAlto'], 'fecha' => $merpreview['fecha'], 'ultimo' => $merpreview['ultimo']); } echo json_encode(array('negocios' => articulo(45), 'coyunturas' => articulo(46), 'mundos' => articulo(47), 'mercados' => articulo(48), 'analisiss' => opinion(49), 'bolsas' => $bolsa, 'intereses' => $interes, 'divisas' => $divisa, 'datos' => $dato, 'subsecciones' => subseccion(5), 'mercas' => $mercado, 'banner1' => banner(5, 1), 'banner2' => banner(5, 2), 'banner3' => banner(5, 3), 'banner4' => banner(5, 4), 'bannerMovil' => banner(5, 'movil'), 'leidos' => leidos(5)));
<?php include 'connection.php'; include 'funciones.php'; error_reporting(E_ERROR | E_WARNING | E_PARSE); date_default_timezone_set('America/El_Salvador'); echo json_encode(array('contratabues' => articulo(58), 'resenas' => articulo(57), 'artes' => articulo(55), 'literaturas' => articulo(56), 'anecdotas' => articulo(54), 'entrevistas' => articulo(59), 'subsecciones' => subseccion(6), 'banner1' => banner(6, 1), 'banner2' => banner(6, 2), 'banner3' => banner(6, 3), 'banner4' => banner(6, 4), 'bannerMovil' => banner(6, 'movil'), 'leidos' => leidos(6)));
<?php include 'connection.php'; include 'funciones.php'; error_reporting(E_ERROR | E_WARNING | E_PARSE); date_default_timezone_set('America/El_Salvador'); echo json_encode(array('ambientes' => articulo(27), 'violencias' => articulo(28), 'saludes' => articulo(29), 'dds' => articulo(30), 'educaciones' => articulo(31), 'migraciones' => articulo(32), 'generos' => articulo(33), 'periodismos' => articulo(34), 'tabues' => articulo(35), 'judiciales' => articulo(36), 'subsecciones' => subseccion(4), 'banner1' => banner(4, 1), 'banner2' => banner(4, 2), 'banner3' => banner(4, 3), 'banner4' => banner(4, 4), 'bannerMovil' => banner(4, 'movil'), 'leidos' => leidos(4)));
<?php include 'connection.php'; include 'funciones.php'; error_reporting(E_ERROR | E_WARNING | E_PARSE); date_default_timezone_set('America/El_Salvador'); $ediinfo = mysql_query("SELECT idArticulo as id,titulo, fecha, preview\n\t\t\t\t\t\tFROM articulo\n\t\t\t\t\t\tWHERE idSubseccion = 1 and activo = 1\n\t\t\t\t\t\tORDER BY fecha desc, hora desc\n\t\t\t\t\t\tlimit 3"); $triinfo = mysql_query("SELECT a.idArticulo as id, a.titulo, CONCAT(c.nombres, ' ', c.apellidos) as autor, a.fecha, c.idPersonal\n\t\t\t\t\t\tfrom personal as c, articulo as a\n\t\t\t\t\t\twhere c.idPersonal = a.idPersonal and a.idSubseccion = 3 and a.activo = 1\n\t\t\t\t\t\tORDER BY a.fecha desc, a.hora desc\n\t\t\t\t\t\tlimit 3"); $libinfo = mysql_query("SELECT a.idArticulo as id, a.titulo, c.rutaFoto as foto, CONCAT(c.nombres, ' ', c.apellidos) as autor, a.fecha, c.idPersonal\n\t\t\t\t\t\tfrom articulo as a, personal as c\n\t\t\t\t\t\twhere a.idSubseccion = 4 and a.idPersonal=c.idPersonal and a.activo = 1\n\t\t\t\t\t\tORDER BY a.fecha desc, a.hora desc\n\t\t\t\t\t\tlimit 3"); $acainfo = mysql_query("SELECT a.idArticulo as id, a.titulo, CONCAT(c.nombres, ' ', c.apellidos) as autor, a.fecha, c.idPersonal\n\t\t\t\t\t\tfrom articulo as a, personal as c\n\t\t\t\t\t\twhere a.idSubseccion = 6 and a.idPersonal=c.idPersonal and a.activo = 1\n\t\t\t\t\t\tORDER BY a.fecha desc, a.hora desc\n\t\t\t\t\t\tlimit 3"); $colinfo = mysql_query("SELECT CONCAT(nombres, ' ', apellidos) as nombre, idPersonal as id from personal where cargo='columnista'"); while ($edipreview = mysql_fetch_array($ediinfo)) { $editorial[] = array('id' => $edipreview['id'], 'titulo' => $edipreview['titulo'], 'fecha' => formatoFecha($edipreview['fecha']), 'preview' => $edipreview['preview']); } while ($colpreview = mysql_fetch_array($colinfo)) { $columnista[] = array('id' => $colpreview['id'], 'nombre' => $colpreview['nombre']); } while ($tripreview = mysql_fetch_array($triinfo)) { $tribuna[] = array('id' => $tripreview['id'], 'idPersonal' => $tripreview['idPersonal'], 'autor' => $tripreview['autor'], 'fecha' => formatoFecha($tripreview['fecha']), 'titulo' => $tripreview['titulo']); } while ($libpreview = mysql_fetch_array($libinfo)) { $libertad[] = array('id' => $libpreview['id'], 'idPersonal' => $libpreview['idPersonal'], 'foto' => $libpreview['foto'], 'fecha' => formatoFecha($libpreview['fecha']), 'titulo' => $libpreview['titulo'], 'autor' => $libpreview['autor']); } while ($acapreview = mysql_fetch_array($acainfo)) { $academia[] = array('id' => $acapreview['id'], 'idPersonal' => $acapreview['idPersonal'], 'titulo' => $acapreview['titulo'], 'autor' => $acapreview['autor'], 'fecha' => formatoFecha($acapreview['fecha'])); } echo json_encode(array('editoriales' => $editorial, 'caricaturas' => caricatura(), 'tribunas' => $tribuna, 'libertades' => $libertad, 'columnistas' => columna(), 'academias' => $academia, 'politicas' => dropdown(2), 'economias' => dropdown(5), 'sociedades' => dropdown(4), 'internacionales' => dropdown(3), 'subsecciones' => subseccion(1), 'culturas' => dropdown(6), 'autores' => $columnista, 'banner1' => banner(1, 1), 'banner2' => banner(1, 2), 'banner3' => banner(1, 3), 'banner4' => banner(1, 4), 'bannerMovil' => banner(1, 'movil'), 'leidos' => leidos(1), 'sondeo' => primerSondeo()));
<?php include 'connection.php'; include 'funciones.php'; error_reporting(E_ERROR | E_WARNING | E_PARSE); date_default_timezone_set('America/El_Salvador'); echo json_encode(array('cronicas' => articulo(40), 'aconteceres' => articulo(41), 'subsecciones' => subseccion(7), 'banner1' => banner(7, 1), 'banner2' => banner(7, 2), 'banner3' => banner(7, 3), 'banner4' => banner(7, 4), 'bannerMovil' => banner(7, 'movil'), 'leidos' => leidos(7)));