1- make it a php file (rename it as index.php)
2- add:
PHP Code:
<?php require('boardurl/global.php'); ?>
in the begining of this file..
3- before ?> part you can query the db to get pms
PHP Code:
if ($bbuserinfo[userid]>=1)
{
$ignoreusers="";
if (trim($bbuserinfo['ignorelist'])!="") {
$ignoreusers='AND fromuserid<>'.implode(' AND fromuserid<>',explode(' ', trim($bbuserinfo['ignorelist'])));
}
$allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
$newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");
}
Now you can use variables ($unreadpm, $newpm, $allpm) to refer main page visitor's pms if he is a member..
Well this is basically the structure you need but a little bit PHP knowledge to apply will help a lot..