  Combined data from gamma-ray telescopes and cosmic-ray detectors have
produced some new surprising insights regarding intergalactic and galactic
magnetic fields, as well as extragalactic background light. We review some
recent advances, including a theory explaining the hard spectra of distant
blazars and the measurements of intergalactic magnetic fields based on the
spectra of distant sources. Furthermore, we discuss the possible contribution
of transient galactic sources, such as past gamma-ray bursts and hypernova
explosions in the Milky Way, to the observed flux of ultrahigh-energy
cosmic-rays nuclei. The need for a holistic treatment of gamma rays, cosmic
rays, and magnetic fields is a unifying theme for these seemingly unrelated
phenomena.
