Trust me. You are not alone. I was going great for a few years but really got my act together in 05-06. I went to the gym 6-7 times a week and I was looking and feeling great until 07 rolled around. I exercised every now and then but it wasn't like before. Weight settled back on me.
But I've slowly gained my motivation back and I'm getting there again. I never really liked the gym too much so I invested in some exercise dvds that I enjoy - several of them so I can keep it fun and different. I also wrote down 3 main reasons that I want to lose weight/eat healthy. I try to look at those reasons/goals often to remind myself. What really helped too is that I changed my outlook. Before, I was striving for perfection in my weight and eating habits (which is impossible and insane). Now, my mantra is 'progress not perfection'. I also remind myself on lazy days or in tempting situations that I want to be the 'best me that I can be'. It helps to keep a food journal. And I've always thought that counting calories was tedious but I've just started doing it and it's pretty effective.
Hope this helps.