Generation of a multi-photon Greenberger–Horne–Zeilinger state with linear optical elements and photon detectors