/*****READ ALL OF THE DIRECTIONS CAREFULLY!!!*********
*****MAKE BACKUPS OF YOUR FILES PRIOR TO EDITING*****/
/*************************************************
* phpBB 2.1 Port Popup New PM's Hack *
* *
* Written by: feignofdeath aka Elantra *
* *
* This hack enables the New PM window to popup *
* anywhere in the site that a user browses, *
* and not just in the Forums!!!! *
* *
* Please follow the directions carefully! *
* (hack tested with phpNuke 6.0 & * 2.0.6 port *
* *
* http://webpromod.sourceforge.net *
*************************************************/
modules/Forums/includes/page_header.php:
Replace this line (line 262):
$s_privmsg_new = 1;
With this:
$s_privmsg_new = 0;
blocks/block-Who_is_online.php (Note: This block must be on the lefthand side for the popup to appear @ every location, if you don't use this block follow alternate step)
Add this chunk on the line before ?> (line 65)
cookiedecode($user);
$username = $cookie[1];
$result = sql_query("select user_new_privmsg from ".$user_prefix."_users where username='$username'", $dbi);
list($numrow) = sql_fetch_row($result, $dbi);
if ($numrow > 0) {
$content .= "<script language='javascript'>\n"
."<!--\n"
."var win = window.open('modules.php?name=Private_Messages&popup=1&mode=newpm', '', 'height=225,width=400')"
."//-->\n"
."</script>";
}
/////////////////// END OF HACK UNLESS YOU NEED ALTERNATE BLOCK STEP /////////////////////
Alternate Step for 2nd part of hack
first make sure that the block at least has a statement that reads:
global $user, $cookie, $prefix, $dbi, $user_prefix;
this line should be near the top (normally within the first 10 lines of code)
if not add that line as for this hack needs it.
You should now be able to copy this code into any block you want that shows up in the lefthand side:
cookiedecode($user);
$username = $cookie[1];
$result = sql_query("select user_new_privmsg from ".$user_prefix."_users where username='$username'", $dbi);
list($numrow) = sql_fetch_row($result, $dbi);
if ($numrow > 0) {
$content .= "<script language='javascript'>\n"
."<!--\n"
."var win = window.open('modules.php?name=Private_Messages&popup=1&mode=newpm', '', 'height=225,width=400')"
."//-->\n"
."</script>";
}
/////////////////// END OF ALTERNATE BLOCK STEP HACK ///////////////////////////////////
If you have a problem... Post on the boards @ http://webpromod.sourceforge.net