moved favourites code out of posts