示例#1
0
    $galeria = new Galerias();
    //    $galeria->set_debug_mode();
    if ($galeria->habilita_aleatoria($_REQUEST["id_galeria"], $_REQUEST["check"])) {
        $galeria->response_json_prt("ok");
    } else {
        $galeria->response_json_prt("error");
    }
    exit;
}
if ($_REQUEST["cmd"] == "galeria_info") {
    $galeria = new Galeria_info($_REQUEST["id_galeria"]);
    //    $galeria->set_debug_mode();debug($_REQUEST);
    $galeria->info_json_prt();
    exit;
}
if ($_REQUEST["cmd"] == "update_url") {
    $imagen = new Imagenes_galeria(new DB());
    //    $imagen->set_debug_mode();debug($_REQUEST);
    if ($imagen->actualiza_url($_REQUEST)) {
        $imagen->response_json_prt($imagen->get_respuesta());
    } else {
        $imagen->response_json_prt("error");
    }
    exit;
}
if ($_REQUEST["cmd"] == "get_url") {
    $imagen = new Imagenes_galeria_info($_REQUEST["id_imagen"], new DB());
    $imagen->get_campos_json_prt("img_url");
    exit;
}
debug($_REQUEST);
示例#2
0
 function actualiza_url($parametros)
 {
     if ($parametros["id_foto"]) {
         if ($parametros["url"]) {
             $sql = "UPDATE imagenes_galeria SET img_url='" . $parametros["url"] . "' WHERE img_id='" . $parametros["id_foto"] . "'";
         } else {
             $sql = "UPDATE imagenes_galeria SET img_url=NULL WHERE img_id='" . $parametros["id_foto"] . "'";
         }
         if ($this->_cnx->execute($sql)) {
             $imagenes = new Imagenes_galeria_info($parametros["id_foto"], $this->get_cnx());
             $galeria = new Galeria_info($imagenes->get_campo("img_gal_id"), $this->get_cnx());
             $objeto = null;
             $objeto->msg = "ok";
             $objeto->xml = $galeria->get_galeria_info_xml();
             $this->set_respuesta($objeto);
             return true;
         }
     }
     return false;
 }