Facing a problem in enthalpy calculation
$\ce{P4}$ forms a molecular solid, whereas diamond is a covalent-network solid (see eg definitions here).

In a molecular solid, molecules containing a discrete number of covalently bonded atoms are arranged in a lattice stabilized by weak interactions such as van der Waals forces or hydrogen bonds between the molecules. In a covalent-network solid, the "molecules" are extended with no finite stoichiometry definining a molecular size. 

When estimating the enthalpy change, you consider only covalent bonds, not weak intermolecular forces. Therefore, for $\ce{P4}$ you consider only the 6 P-P bonds, whereas in diamond you consider covalent bonds to nearest neighbours, and correct for the fact that when you rupture a bond to a neighbour, that neighbour also loses a bond, therefore the division by 2.