Synthesis, characterization, and gas-sensing properties of macroporous Ag/SnO2 composite by a template method