Hi
I "solved" it by using an iframe,
I just added target="_top" to the link in the iframe and it worked, it redirects the page to smf profile page so you can view the new messages.
The full code I use, if anyone wants to do the same, is:
First create a new php file and call it what you want, maybe smfCustomProfileDisplay.php, and place it in the root folder of smf.
add this to the php:
<?php
require_once('/home/www/forum/SSI.php');
echo '<span id="left_profile">';
if ($context['user']['is_logged']){
echo $txt['hello_member_ndt'],'<em> ', $context['user']['name'],'</em><br /><br />', $txt['bksmf_welcome_back'],'
<br />
<span id="smfiframe">
<a href="index.php?action=pm" target="_top">';
$messtext = (($context['user']['unread_messages'] == 0) ? "no" : $context['user']['unread_messages']);
echo ''.$txt['unread_messages_pre'].' '.$messtext.' ',$txt['unread_messages_post'],'.
</a>
</span>';
}else{
echo $txt['bksmf_hello'],'<em> ', $txt['guest'],'</em><br />', $txt['bksmf_welcome_to'],' <em>', $context['forum_name'],'</em>';
}
echo '</span>';
?>
where
$txt['unread_messages_pre'] = "You have";
$txt['unread_messages_post'] = "new messages";
and then add this to your template.html file in your favorite coppermine theme:
<iframe src="/forum/smfCustomProfileDisplay.php" width="220px" height="100px" scrolling="no" frameborder="0" ></iframe>
And you will get a display like:
Hello Philip
Welcome back
You have 4 new messages
or
Hello Guest
Welcome to My Forum
/Philip