[24/01/07] PM Popup Blocker Fix

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
12
55%
Very Good
5
23%
Good
1
5%
Fair
0
No votes
Poor
4
18%
 
Total votes: 22

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 28683
Joined: Sat Aug 16, 2003 7:36 am

[24/01/07] PM Popup Blocker Fix

Post by Extensions Robot »

MOD Name: PM Popup Blocker Fix
Author: tomlevens
MOD Description: This MOD changes the private message notification to a JavaScript dialog box instead of the popup window to get around the popup blocker included in many browsers.

MOD Version: 1.0.1 (Updated 01/24/07)
Tested on phpBB Version: 2.0.22

Download File: pm_popup_blocker_fix_101a.mod
mods overview page: View
File Size: 4279 Bytes



Support for this MOD needs to be asked within this topic. The phpBB Teams are not responsible or required to give anyone support for this MOD. By installing this MOD, the phpBB Support Team or phpBB MODifications Team may not be able to provide support.

This MOD has only been tested by the phpBB MOD Team with the phpBB version listed in the topic. It may not work in any other versions of phpBB.
Last edited by Extensions Robot on Mon Apr 30, 2007 12:30 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric »

MOD Validated/Released

Notes:
This MOD turns the popup you get when you have a new Private Message into a javascript alert message so that popup blockers don't block the Private Message popup.
zanejin
Registered User
Posts: 182
Joined: Sun Oct 19, 2003 10:58 am

Post by zanejin »

Is this MOD compatible with the Open Inbox in a new window MOD?
User avatar
smithy_dll
Former Team Member
Posts: 7632
Joined: Tue Jan 08, 2002 6:27 am
Location: Australia
Name: Lachlan Smith
Contact:

Post by smithy_dll »

I would imagine so, you should test on a test phpBB installation first tho.
Systems Engineering
zanejin
Registered User
Posts: 182
Joined: Sun Oct 19, 2003 10:58 am

Post by zanejin »

Yep, it's compatible 8) . However, the choice to open the inbox in a new window is now unavailable :( . Good MOD ;) .
tomlevens
Registered User
Posts: 131
Joined: Mon Aug 18, 2003 8:52 pm

Post by tomlevens »

zanejin wrote: Yep, it's compatible 8) . However, the choice to open the inbox in a new window is now unavailable :( . Good MOD ;) .

Yeah, the popup blockers block new windows opening from javascript... so the option isn't really available!
Last edited by tomlevens on Thu Nov 23, 2006 5:16 pm, edited 1 time in total.
chatasos
Registered User
Posts: 748
Joined: Wed May 15, 2002 1:16 pm
Location: Paralia

Post by chatasos »

The following should make both methods word.
If popups are blocked then the dialog should appear.
If popups are not blocked then the normal popup window should appear.

Code: Select all

<!-- BEGIN switch_enable_pm_popup -->
<script language="Javascript" type="text/javascript">
<!--
	if ( {PRIVATE_MESSAGE_NEW_FLAG} )
	{
		pmWindow = window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');
		if (!window.pmWindow) {
			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
			}
		}
	}
//-->
</script>
<!-- END switch_enable_pm_popup -->
countingcrow
Registered User
Posts: 18
Joined: Mon Jul 19, 2004 2:00 am
Contact:

Post by countingcrow »

I recently installed this mod, a great addition, thanks for making a great peice of code!
The Black Hat
Registered User
Posts: 3
Joined: Thu Jun 17, 2004 11:05 am

Nice Mod

Post by The Black Hat »

Hey man just installed this MOD. Very nice for us FireFox users :)
dragonfoundry
Registered User
Posts: 8
Joined: Sat Oct 16, 2004 11:29 am
Contact:

Post by dragonfoundry »

I got round this by adding a comment in forum support that if users want the popup window feature they would have to add my site to the whitelist of their popup blocker.

Mind you saying that you then get hit with users saying
"exactly how do i do that?"

:D
richard_5421
Registered User
Posts: 521
Joined: Tue Dec 30, 2003 12:57 am

Post by richard_5421 »

Hi can you paste this in a text file because I have a problem with reading
it for some reason using gVim, thanks 8)
Web Request - Virtual Shared / Reseller / VPS / Dedicated
Multiple Domain Hosting .... 24/7 Technical Support - UK Website
Shof515
Registered User
Posts: 1169
Joined: Wed Mar 19, 2003 4:36 am

Post by Shof515 »

Code: Select all

##############################################################
## 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
Whos missing up my sig?
richard_5421
Registered User
Posts: 521
Joined: Tue Dec 30, 2003 12:57 am

Post by richard_5421 »

Ahh very nice, I found that adding the above code so I can have both
version was alot better instead of being interupted :lol:

Thanks simple but great
Web Request - Virtual Shared / Reseller / VPS / Dedicated
Multiple Domain Hosting .... 24/7 Technical Support - UK Website
User avatar
Bard
Registered User
Posts: 449
Joined: Fri Sep 10, 2004 9:49 am
Location: Texas
Contact:

Post by Bard »

I just installed this mod. I used chatasos' script to use either popup or dialog.
It works great

This should be built in to the core phpBB. Thanks guys!
A computer once beat me at chess, but it was no match for me at kick boxing.
Old Time Radio Talk | Visit OTR Talk Town
juiced
Registered User
Posts: 204
Joined: Sat Nov 27, 2004 9:23 am
Contact:

Post by juiced »

Any chance the new "double" choice code could be integrated into the D/L so people with little PHP experiance (such as myself) are less confused?
Image
Do your part in the environment! The best investment for your kids & future.
Post Reply

Return to “[2.0.x] MOD Database Releases”