Пример #1
0
$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;
        } else {
            $contenido = articulos($subinfo['id']);
        }
Пример #2
0
<?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()));