Kód:
##############################################################
## MOD Title: PM Popup Blocker Fix
## MOD Author: tomlevens < tom@tomlevens.co.uk > (Tom Levens) http://www.tomlevens.co.uk/
## MOD Description: The PM notification popup window is blocked by most browsers "Popup Blockers" - this MOD fixes it by displaying the notification as a dialog box instead.
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 3 Minutes
## Files To Edit: includes/page_header.php
## language/lang_english/lang_main.php
## templates/subSilver/overall_header.tpl
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## The idea of this mod is quite simple! Browsers featuring "Popup Blockers" stop the user from
## seeing PM notification popup. This MOD gets around this problem by using a dialog box (not
## blocked) for the notification instead of the popup window.
##
## This mod was inspired by the system used in vBulletin (Boo Hiss!) ;)
##
##############################################################
## MOD History:
##
##Ę Ę2004-08-10 - Version 1.0.0
##Ę Ę Ę - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
'L_PRIVATEMSGS' => $lang['Private_Messages'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
// MOD: PM Popup Blocker Fix - by tomlevens (tom@tomlevens.co.uk)
// (1 line added)
//
'L_PRIVATEMSG_NEW' => ($userdata['user_new_privmsg'] == 1) ? $lang['You_new_pm'] : $lang['You_new_pms'],
//
// END MOD
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['You_new_pm'] = 'A new private message is waiting for you in your Inbox';
$lang['You_new_pms'] = 'New private messages are waiting for you in your Inbox';
#
#-----[ REPLACE WITH ]------------------------------------------
#
# NOTE: This step isn't really necessary. All it does is changes the
# dialog message to tell the user to click OK to display their Inbox.
#
// MOD: PM Popup Blocker Fix - by tomlevens (tom@tomlevens.co.uk)
// (2 lines replaced - original lines follow)
//
// $lang['You_new_pm'] = 'A new private message is waiting for you in your Inbox';
// $lang['You_new_pms'] = 'New private messages are waiting for you in your Inbox';
//
$lang['You_new_pm'] = 'A new private message is waiting for you in your Inbox. Click OK to view it.';
$lang['You_new_pms'] = 'New private messages are waiting for you in your Inbox. Click OK to view them.';
//
// END MOD
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------
#
# NOTE: you will need to do this for all your templates!
#
<!-- BEGIN switch_enable_pm_popup -->
<script language="Javascript" type="text/javascript">
<!--
if ( {PRIVATE_MESSAGE_NEW_FLAG} )
{
window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
}
//-->
</script>
<!-- END switch_enable_pm_popup -->
#
#-----[ REPLACE WITH ]------------------------------------------
#
<!-- BEGIN switch_enable_pm_popup -->
<script language="javascript" type="text/javascript">
<!--
// MOD: PM Popup Blocker Fix - by tomlevens (tom@tomlevens.co.uk)
// (4 lines replaced - original lines follow)
//
// if ( {PRIVATE_MESSAGE_NEW_FLAG} )
// {
// window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
// }
//
if({PRIVATE_MESSAGE_NEW_FLAG})
{
new_pm_prompt = confirm('{L_PRIVATEMSG_NEW}');
if(new_pm_prompt == true) {
// Redirect to Inbox if OK is clicked
window.location = '{U_PRIVATEMSGS}';
}
else {
// Close prompt if cancel is clicked
}
}
//
// END MOD
//-->
</script>
<!-- END switch_enable_pm_popup -->
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM