Ligand coordination and spin crossover in a nickel porphyrin anchored to mesoporous TiO2 thin films.