Discrepancy in MO diagrams for Period 2 homonuclear diatomics
As molecular orbital diagrams are qualitative ways to understand bonding, there are different ways in which they may be drawn.

In the simplest possible cases, molecular oxygen (O=O), for instance, it is okay to assume that s-orbitals mix only with s-orbitals (of similar energy), and that the p-orbitals only mix with p-orbitals. This works fine for molecular oxygen, and explains many of its properties: double bond between O and O, paramagnetic etc. 

In other cases, molecular nitrogen being the common example, this is not sufficient, and we have to account for orbitals mixing with orbitals of other kinds. This is called s-p mixing. 

Firstly, you construct a MO diagram where orbitals of the same kind mix (the same as you would have done for oxygen), you then allow these MO's to interact with other MO's of the same symmetry to produce a new set of mixed orbitals. When the MO's interact in this way, they produce new MO's of higher and lower energy, which accounts for the different order of the MO's between diagrams where s-p mixing has been taken into account. 

In general, any homonuclear diatomic molecules below oxygen (lithium, nitrogen, boron etc.) need s-p mixing to be considered. 

For more information about s-p mixing (and other kinds of orbital mixing) do a search here on stack exchange. There are plenty of other similar questions with answers to suit.