Page 1 of 1

[MOD] Replace popup for new private messages

PostPosted: Fri Apr 14, 2006 3:57 am
Author: evolver
The 'Private Messages'-popup doesn't work when you brower doesn't allow popups... (a standard option in Firefox)
Because of that, visitors might forget to look at them...

I've applied this very small MOD to my site...
This gives a Javascript box instead of a popup.

I've tested it on my IntegraMOD site.
Very easy to install... works like a charm


Code: Select all
################################################################ MOD Title]http://www.phpbb.hotschi.de/#[/url]# MOD Description:  As everybody has a popup blocker today, this mod replaces the popup for new##           private messages with a confirmation Java Script Box. It tells you, that##           you have a new private message (or even how many, if you have more than one)##           and asks you if you want to go to your privat messages.##           Then you can click on Ok, or Abort.## MOD Version:       1.0.0#### Installation Level:   Easy## Installation Time:    2 Minute## Files To Edit:    3##           includes/page_header.php ##           templates/overall_header.tpl##           language/lang_english/lang_main.php###### Included Files:   n/a################################################################ For Security Purposes, Please Check: [url=http://www.phpbb.com/mods/]http://www.phpbb.com/mods/[/url] 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: [url=http://www.phpbb.com/mods/#]http://www.phpbb.com/mods/#[/url]############################################################### MOD History:####   2005-08-13 - Version 1.0.0##   - First release################################################################## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD##############################################################  # #-----[ OPEN ]------------------------------------------#  includes/page_header.php  # #-----[ FIND ]------------------------------------------#         $template->assign_block_vars('switch_enable_pm_popup', array());  # #-----[ AFTER, ADD ]------------------------------------------#                 $l_new_message = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['You_new_pm'] : $lang['You_new_pms'];                 $l_new_message_text = sprintf($l_new_message, $userdata['user_new_privmsg']);                 $href = append_sid("privmsg.".$phpEx."?folder=inbox");                 $template->assign_vars(array(                 'L_MESSAGE' => $l_new_message_text,                 'U_HREF' => $href));  # #-----[ OPEN ]------------------------------------------#  templates/overall_header.tpl  # #-----[ FIND ]------------------------------------------#         window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;  # #-----[ REPLACE WITH ]------------------------------------------#         if ( confirm("{L_MESSAGE}") )         {             top.location.href="{U_HREF}";         }  # #-----[ 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 ]------------------------------------------#$lang['You_new_pm'] = 'A new private message is waiting for you in your Inbox.nDo you want to go to your private messages?';$lang['You_new_pms'] = '%d new private messages are waiting for you in your InboxnDo you want to go to your private messages?';      # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------# # EoM

Re: [MOD] Replace popup for new private messages

PostPosted: Wed May 03, 2006 5:46 am
Author: found it
I can clarify this works as I have it on 2 sites..

nice one

:mrgreen:

PostPosted: Wed May 03, 2006 8:57 am
Author: Bush
I do as well, works great and no one missing the clan meetings b/c of some stupid pop-up blocker!

Re: [MOD] Replace popup for new private messages

PostPosted: Wed May 17, 2006 4:49 pm
Author: Dr. Bantham
I like this mod, but I dislike the fact that the main page in the background clears to a blank screen when the pop-up initiates. It is disorienting and perhaps even alarming for some members, as it appears that something has gone wrong. Can it be affixed after the page_footer instead?

Also, would a javascript window statement call for the original method not accomplish the same intent, or do pop-up blockers eat these without discretion?

Re: [MOD] Replace popup for new private messages

PostPosted: Tue Jun 13, 2006 8:34 am
Author: Sadasius2
Works great, awesome. Thank you very much!