What this mod does is that it checks the database every 30s (or whatever time you set), and if the user has new pm it returns a pop up about it asking if you want to go to your inbox.
First you need to copy both of the files I'm attaching to the base directory where you have pmbt.
Then you need to open header.php, find this line:
and change it to this:
echo "<body onload=\"pm_ajax()\">\n";
Then add this line:echo "<script type=\"text/javascript\" src=\"pm_ajax.js\"></script>";
before:echo "<title>".$sitename."</title>\n";
After that find this line:include("blocks/usercp.php"); and add before it these lines:
$pm_div = ($has_newpm) ? "pm_notif" : "nopm_notif";
echo "<div id=\"".$pm_div."\"></div>";
Next you need to add this line to language/english.php
define("_jscriptconfirmtext","You have a new PM, please click OK to go to your PM Inbox.");
spanish.php:define("_jscriptconfirmtext","Tienes un nuevo Mensaje Privado, da click en OK para ir a tu Bandeja de Entrada de Mensajes Privados."); brazilian.php:define("_jscriptconfirmtext","Voce tem uma nova mensagem, por favor clique OK para ir para sua caixa de mensagens."); czech.php:define("_jscriptconfirmtext","Mate novou PM, kliknete na OK pro prechod do schranky.");
If you want to set the pm check for a different interval (not the default 30s), then open pm_ajax.js and change the number 30000 to any number you want (the number is in ms) in this line:window.setInterval('sendPmId()', 30000);
That's it
If you'd want to have the pop up of new pm even when you load the page and know about the pm then just add these lines to header.php:
if ($has_newpm)
{
echo "<script type=\"text/javascript\" language=\"JavaScript\">";
echo "sPath = window.location.pathname;";
echo "sPage = sPath.substring(sPath.lastIndexOf('/') + 1);";
echo "if (sPage != \"pm.php\"){ var answer = confirm (\""._jscriptconfirmtext."\");";
echo "if (answer) window.location=\"pm.php?op=inbox\";";
echo "}";
echo "</script>";
} before this line:include("blocks/usercp.php"); But this part of the code is not needed for functionality..
Enjoy!