Shapley Optical Survey - I. Luminosity functions in the supercluster environment