Well, you can install any of the Social Networking scripts available out there for free or buy one. You can also install a CMS, and extend it's capabilities to work like a social network
1. For JOOMLA, try User Home Pages or UHP, it's an extension
2. Dolphin
3. Xoops
Write your own in PHP. If you don't know it, learn it. It's not that easy, you're not just going to conjure up a massive script like that from thin air. You need to put the effort into coding it yourself and learn from it. As mentioned above, a company called Boonex makes a community software called Dolphin which is ready made and works out of the box. vBulletin (forum software) can also be extended to work like this.
-Luke.
Here's a 15 Part tutorial that I've found quite useful:
http://devzone.zend.com/tag/PHP101