lang . " AS title, " . " description_" . $this->lang . " AS description, " . " dtime, " . " uploaded, " . " place, " . " approved, " . " username " . "FROM photo " . "WHERE " . " approved = 1 AND " . " ( " . " id = '$id' OR " . " permalink = '$id' " . " );"; $q = mysqli_query($this->db, $s); if (mysqli_num_rows($q) > 0){ $r = mysqli_fetch_array($q); $this->id = $r["id"]; $this->file = $r["file"]; $this->permalink = $r["permalink"]; if (!is_null($r["title"])){ $this->title = $r["title"]; } if (!is_null($r["description"])){ $this->description = $r["description"]; } if (!is_null($r["dtime"])){ $this->dtime = $r["dtime"]; } $this->uploaded = $r["uploaded"]; if (!is_null($r["place"])){ $this->place = New Place($this->db, $this->lang, $r["place"]); } $this->approved = $r["approved"]; if (!is_null($r["username"])){ $this->username = $r["username"]; } } $s_comment = "SELECT id " . "FROM photo_comment " . "WHERE " . " photo = " . $this->id . " AND " . " approved = 1;"; $q_comment = mysqli_query($this->db, $s_comment); while($r_comment = mysqli_fetch_array($q_comment)){ array_push($this->comment, new Photo_Comment($this->db, $r_comment["id"])); } } } ?>