Topic: Showing new private message count on external page?

Hi

At the moment I'm working on a log in script for an external page that once logged in displays the user avatar, a link to edit there profile, how many messages they have and also a log out link.

I have success with displaying all of these apart from the message link, could some one point me in the right direction as to what page I should be looking at? I am using the pun_pm package coded by the punbb development team.

My current coding looks like this... ( please bare in mind it is ugly and basic at the moment as I am just working out the best way to achieve the effect )

<?php 
 if($forum_user['id'] > 2)
{
  echo forum_htmlencode($forum_user['username']); 
  echo $user_avatar = '<img src="forums/'.$forum_config['o_avatars_dir'].'/'.$forum_user['id'].'.jpg" '.' width="30" height="30" alt="" />'; 
  echo '******* PRIVATE MESSAGE OUTPUT SHOULD GO HERE ******* ';
  echo $links['profile'] = '<li id="navprofile"'.((substr(FORUM_PAGE, 0, 7) == 'profile') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['user'], $forum_user['id']).'">'.$lang_common['Profile'].'</a></li>';
  echo $links['logout'] = '<li id="navlogout"><a href="'.forum_link($forum_url['logout'], array($forum_user['id'], generate_form_token('logout'.$forum_user['id']))).'">'.$lang_common['Logout'].'</a></li>';

}

else
{
  echo "Log In Form Will Go Here";
}
?>

any help would much appreciated  wink

2 (edited by Source Code 2009-12-12 11:27)

Re: Showing new private message count on external page?

Ok, slight update, if i add the line

  echo $links['profile'] .= "\n\t\t".'<li id="nav_pun_pm"'.('pun_pm' == substr(FORUM_PAGE, 0, 6) ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['pun_pm']).'"><span>'.$lang_pun_pm['Private messages'].'</span></a></li>';

To the script it creates the bullet point, and if I had text inbetween </span></a> it creates a link that works, but what I really want to use is the same system the forum uses ie - New messages (2) etc etc


any idea? I feel I am close but yet so far  big_smile

Re: Showing new private message count on external page?

bump, any developers point me in the right direction please? I know you guys really know your stuff so your help would be much appriacted  wink

Re: Showing new private message count on external page?

Study out the code of the "pun_pm_unread_messages" fucntion. It should help you.