id_foto=-1; $this->debug="No se encontró la foto en la base de datos"; } else { extract(mysql_fetch_array($result)); $this->id_foto=$id; //Archivo de Imagen $this->img=$img; //Imagen, incluyendo ruta para ser mostrada $this->src=$dirfotos.$img; //Pie de foto sin las arrobas $this->quienes=str_replace("@", "", $quienes); //Más variables $this->visitas=$visitas; $this->idEvento=$idEvento; $this->nombreEvento=$NombreEvento; $this->fotografo=$Fotografo; $this->idLugar=$Lugar; $this->lugar=$NOMBRE; $this->FechaEvento=$FechaEvento; $this->logoantro="plantillas/".$LogoAntro; //Obtener en un arreglo todos los nombres. $personas=explode(",",$quienes); list($personas[count($personas)-1], $personas[count($personas)])=explode(" y ", $personas[count($personas)-1]); //Si no hay 'y' para concatenar el último elemento (ej. Un solo nombre) se introduce un vacío, hay que quitarlo if(!strlen($personas[count($personas)-1])) array_pop($personas); //Separar hombres y mujeres $this->hombres=array(); $this->mujeres=array(); for($x=0;$xmujeres, str_replace("@","",$personas[$x])); $this->quienes=str_replace(str_replace("@","",$personas[$x]), "".str_replace("@","",$personas[$x])."", $this->quienes); } else { array_push($this->hombres, $personas[$x]); $this->quienes=str_replace($personas[$x], "".$personas[$x]."", $this->quienes); } } } } } ?>