Cleaning monstrous code of newbb_viewtopic