Temperature controlled RGB LED (Noob programming question)

Well,i finally understood the code in reply #8 after reading it.
Just another questions in the code because i didn't use the IDE very much..
First, i think that i must put the pins variables in the first (int redpin..etc) right or wrong?
Second, must i put any codes from the temperature sensor tutorial (Serial.begin parts..etc)?
Third and final, where can i put the code that you made in reply #8? (of course after the variables..Ok but if there is any others?)

EDIT: I've found a project doing the same as i wanted.. Link: itp.nyu.edu/~bms415/blog/2011/10/stupid-pet-trick/ But using another sensor and lots of RGB LEDs..So can someone help me in changing the code?

-Nexusrex