コード例 #1
0
<?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)));
コード例 #2
0
ファイル: subseccion.php プロジェクト: jchavezjs/contrapunto
    $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']);
        }
    } 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('contenidos' => $contenido, 'error' => $error, 'secinfo' => $secinfo, 'subinfo' => $subinfo, 'subsecciones' => $sub, 'banner1' => banner($secinfo['id'], 1), 'banner2' => banner($secinfo['id'], 2), 'banner3' => banner($secinfo['id'], 3), 'bannerMovil' => banner($secinfo['id'], 'movil'), 'leidos' => leidos($secinfo['id'])));
コード例 #3
0
ファイル: post.php プロジェクト: jchavezjs/contrapunto
            } elseif ($subinfo['id'] == 3) {
                $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'])));
コード例 #4
0
ファイル: portada.php プロジェクト: jchavezjs/contrapunto
while ($perpreview = mysql_fetch_array($perinfo)) {
    $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()));
コード例 #5
0
ファイル: funciones.php プロジェクト: jchavezjs/contrapunto
function actualidad()
{
    $actinfo = mysql_query("SELECT a.idArticulo as id, a.titulo, CONCAT(c.nombres, ' ', c.apellidos) as autor, a.fecha, s.nombre as subseccion, s.url as urlSubseccion, a.preview, i.rutaFoto as foto, f.nombre as fotografo, se.url as urlSeccion, c.idPersonal\n\t\t\t\t\t\t\tfrom articulo a, personal as c, subseccion as s, imagenesarticulo as i, fotografo as f, seccion se\n\t\t\t\t\t\t\twhere a.idArticulo = i.idArticulo and a.idPersonal = c.idPersonal and a.idSubseccion = s.idSubseccion and i.idFotografo = f.idFotografo and a.activo = 1 and s.idSeccion = se.idSeccion and a.especial = 0 and a.idSubseccion not in (1,2,3,4,5,6,35,45,46,49,54,57,58,59)\n\t\t\t\t\t\t\tORDER BY a.fecha desc, a.hora desc\n\t\t\t\t\t\t\tlimit 5");
    while ($actpreview = mysql_fetch_array($actinfo)) {
        $actualidad[] = array('id' => $actpreview['id'], 'idPersonal' => $actpreview['idPersonal'], 'titulo' => $actpreview['titulo'], 'autor' => $actpreview['autor'], 'fecha' => formatoFecha($actpreview['fecha']), 'subseccion' => $actpreview['subseccion'], 'preview' => $actpreview['preview'], 'urlSeccion' => $actpreview['urlSeccion'], 'urlSubseccion' => $actpreview['urlSubseccion'], 'foto' => $actpreview['foto'], 'fotografo' => $actpreview['fotografo']);
    }
    return $actualidad;
}
コード例 #6
0
ファイル: opinion.php プロジェクト: jchavezjs/contrapunto
<?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()));
コード例 #7
0
ファイル: cpost.php プロジェクト: jchavezjs/contrapunto
<?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');
$id = $_GET['id'];
$carinfo = mysql_query("SELECT a.idCaricatura, a.rutaFoto as foto, a.fecha, CONCAT(c.nombres, ' ', c.apellidos) as caricaturista\n                        from caricatura a, caricaturista c\n                        where a.idCaricaturista = c.idCaricaturista and idCaricatura={$id}");
while ($carpreview = mysql_fetch_array($carinfo)) {
    $contenido[] = array('foto' => $carpreview['foto'], 'idCaricatura' => $carpreview['idCaricatura'], 'caricaturista' => $carpreview['caricaturista'], 'fecha' => formatoFecha($carpreview['fecha']));
}
echo json_encode(array('contenido' => $contenido, 'subsecciones' => subseccion(1), 'banner1' => banner(1, 1), 'banner2' => banner(1, 2), 'banner3' => banner(1, 3), 'bannerMovil' => banner(1, 'movil'), 'leidos' => leidos(1)));
コード例 #8
0
ファイル: autor.php プロジェクト: jchavezjs/contrapunto
<?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')));
コード例 #9
0
ファイル: buscar.php プロジェクト: jchavezjs/contrapunto
<?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"));
$busqueda = mysql_escape_string($_GET['query']);
// $busqueda ="reunión";
$infox = "SELECT a.idArticulo as id, a.titulo,a.preview, a.fecha, s.nombre, s.url, CONCAT(c.nombres, ' ', c.apellidos) as autor, c.idPersonal, se.url as urlSeccion\n                      FROM articulo a, personal c, subseccion s, seccion se\n                      where (LOWER(a.titulo) like '%{$busqueda}%' or  LOWER(CONCAT(c.nombres, ' ', c.apellidos)) like '%{$busqueda}%')\n                      and a.idPersonal = c.idPersonal and a.idSubseccion = s.idSubseccion and s.idSeccion = se.idSeccion\n                      ORDER BY a.fecha desc, a.hora desc";
// echo $infox;
$info = mysql_query($infox);
while ($result = mysql_fetch_array($info)) {
    $resultado[] = array('id' => $id = $result['id'], 'titulo' => $titulo = $result['titulo'], 'fecha' => $fecha = formatoFecha($result['fecha']), 'subseccion' => $subseccion = $result['nombre'], 'url' => $url = $result['url'], 'urlSeccion' => $urlSeccion = $result['urlSeccion'], 'autor' => $autor = $result['autor'], 'idPersonal' => $idPersonal = $result['idPersonal'], 'preview' => $preview = $result['preview']);
}
// (select se.url as urlSeccion, se.nombre as seccion from seccion as se where se.idSeccion=(select x.idSeccion from subseccion as x where x.idSubseccion=a.idSubseccion))
$colinfo = mysql_query("SELECT a.idColumna as id, a.titulo, a.fecha, CONCAT(c.nombres, ' ', c.apellidos) as autor,c.idPersonal\n                      FROM columna a, personal c\n                      where (LOWER(a.titulo) like '%{$busqueda}%' or  LOWER(CONCAT(c.nombres, ' ', c.apellidos)) like '%{$busqueda}%') and a.idPersonal = c.idPersonal\n                      ORDER BY a.fecha desc, a.hora desc");
while ($colpreview = mysql_fetch_array($colinfo)) {
    $resultado[] = array('id' => $id = $colpreview['id'], 'titulo' => $titulo = $colpreview['titulo'], 'fecha' => $fecha = formatoFecha($colpreview['fecha']), 'subseccion' => "Columnistas", 'url' => "columnistas", 'autor' => $autor = $colpreview['autor'], 'idPersonal' => $idPersonal = $result['idPersonal'], 'urlSeccion' => 'opinion');
}
echo json_encode(array('resultado' => $resultado, 'actualidades' => actualidad(), 'caricatura' => caricatura(), 'banner1' => banner(8, 1), 'banner2' => banner(8, 2), 'bannerMovil' => banner(8, 'movil')));