You can do this fairly easily, but you ideally need an up to date IP list for the bots. You could use the free ones, but suspect you'd need the fantomas list. Also, being a forum and not just a run of the mill site, integrating it could be trouble some.
I actually think i have a script somewhere that allows you to do this, it's one of the one's within Search Engine Optimisation with PHP by Wrox, pm me if you want it and i'll make the effort to find it.
Google would also eventually ban you in all likelihood, as they see it as cloaking, simply because their spiders get a different view of the site than someone who follows a link. They allow NY Times to do it, but when it comes to us little guys it's just tough luck.