I fixed the problem I was having where when a user would click login to the forums, it would redirect them to the wordpress login and once they logged in there, it would redirect them to the profile. I wanted it to redirect back to the forum.
So here's what I did.
in wp-login.php at line 470
<input type="hidden" name="redirect_to" value="<?php echo attribute_escape($redirect_to); ?>" />
change it to look like this
<?php
if($_SERVER['HTTP_REFERER'] === "your forum address here")
{
?>
<input type="hidden" name="redirect_to" value="<?php echo attribute_escape("your forum address here"); ?>" />
<?php
}else{
?>
<input type="hidden" name="redirect_to" value="<?php echo attribute_escape($redirect_to); ?>" />
<?php
}
?>
So what this will do is say, if you are coming from my forums, once logged in, go back to my forums.
I'm sure there's a more elegant way to do this, but it works for me...at least until I have to update wordpress. Hope this helps someone.