Luminescence and second harmonic generation in KTiOPO4-derived compositions