I am using Private message as PHP in a block on the node of a page so that a person can contact the node author without having to leave the page. Here is the code:
$node = menu_get_object();
if ($node->uid != 0) {
module_load_include('pages.inc','privatemsg');
$recipients = $node->uid;
print "<div>Contact " . $node->name ." about this post.</div>";
$subject = $node->title ." question.";
print drupal_render(drupal_get_form('privatemsg_new', $recipients, $subject));
}
However, Private message hijacks the title of the entire page, and now every single node value is 'Write so-and-so' a new message, instead of what the page title should actually be.
Thoughts on how to correct this?
You can check out what's happening here on the test server:
http://g.hokkaido-select.com/classifieds/cars-and-vehicles/motorcycles-and-scooters/2006-150cc-scooter (note, you have to be logged into see the block, but the page title error can still be seen)