account for tree structure in calculating post and topic totals. fixes #145