javascript alert bij een nieuw privebericht

Hulp nodig bij een modificaties of op zoek naar een MOD? Bekijk ons archief. Support wordt helaas niet meer verleend.
Forumregels

Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
phpBB2.0.x
Gesloten
Saven
Berichten: 59
Lid geworden op: 13 mar 2005, 16:53
Contacteer:

javascript alert bij een nieuw privebericht

Bericht door Saven » 20 mar 2005, 11:21

weet iemand een mod/hack/script zodat als je een nieuwe pm hebt, dat je zo'n javascript alert krijgt? heb dat nodig voor mijn forum ;)
als je mijn style moet weten: MorpheusXSteelBlue

alvast bedankt :thumb:

Gebruikersavatar
Paul
Beheerder
Beheerder
Berichten: 20316
Lid geworden op: 23 okt 2003, 11:38
Locatie: Utrecht
Contacteer:

Bericht door Paul » 20 mar 2005, 11:36

ik heb hem hier nog liggen. maar weet niet waar ik hem heb gedownload :D

Code: Selecteer alles

##############################################################
## 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

Saven
Berichten: 59
Lid geworden op: 13 mar 2005, 16:53
Contacteer:

Bericht door Saven » 20 mar 2005, 11:54

thanks :)
het werkt goed :thumb:

Gebruikersavatar
Paul
Beheerder
Beheerder
Berichten: 20316
Lid geworden op: 23 okt 2003, 11:38
Locatie: Utrecht
Contacteer:

Bericht door Paul » 20 mar 2005, 12:01

graag gedaan :thumb:

Gesloten