Magnetic ordering in diluted Ising and Heisenberg systems with competing interactions: Theory and application to EuxSr1−xS