Community site with ads from group on groups blogs

I have a vision for a local social networking site in which business owners can form Power Groups and also create an Ad Exchange to promote each other on their blogs and website through banners and text links. I can find community script, blog and group. What would it take to integrate an ad exchange script?