NASTY SQL for ordering things by votes count for a given period of time