Starting from the Emery model, which is assumed to describe the copper-oxygen planes, and including direct oxygen hopping matrix elements, tpp, we have been able to derive the effective t-J Hamiltonian for the copper orbitals using the linked cluster expansion method up to fourth order in tpd, the hybridization matrix element. The spin-dependent part of the effective Hamiltonian is composed of two contributions: the superexchange interaction, and another one of RKKY type. The effective parameters (t and J) depend on doping, delta . This Hamiltonian can be used to study the magnetic properties of the high-T, materials versus delta .