How can I use PHP to print a view in the content area of a page? The Private Message module displays conversations between users as "threads" that resemble e-mail or forum friends.  I am attempting to customize the default display by printing a view that shows the recipient/sender profile information.  

Through trial and error I arrived at the following code, which prints out the view content pane that I want.

  foreach($thread['participants'] as $participants =&gt; $participant ) {
    global $user;
    if ($user-&gt;uid !== $participant-&gt;uid) {
      print views_embed_view('profile_show_user_interests','show_interests_own', $participant-&gt;uid);
    }
  }


This code resides in privatemsg.pages.inc in function privatemsg_view($thread), which returns the content of the page for rendering.

The problem with this is that print views_embed_view() prints the content pane out at the top of the page, above the header, with no extra markup.  How can I print the content pane in the content region of the page?
As a starting point I would have the function return the view rather than attempting to print it. Try:

 $content['view'][] = views_embed_view('profile_show_user_interests','show_interests_own', $participant-&gt;uid);


and then render it in the page at the proper place. (views_get_view might be better in this context.)