Magnetic activity in the young solar analog AB Dor: Active longitudes and cycles from long-term photometry