Shared badges working

Unfortunately speeding up this part of the dashboard also seems to have slightly broken it. I've reverted this to older code that is functional, but apologies for the lack of efficiency.