[RELEASE] Centered PM Popup Window

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
User avatar
Platinum
Registered User
Posts: 31
Joined: Mon Dec 10, 2001 8:32 pm
Location: Calgary, AB
Contact:

[RELEASE] Centered PM Popup Window

Post by Platinum »

Ok, my first MOD.. *gulp*

This MOD will make all PM Popup Notifications arrive in the absolute center of the users screen, regardless of resolution.

Code: Select all

################################################################# 
## Mod Title: PM Popup Center
## Mod Version: 1.0 
## Author: Platinum < platinum@gamesniffer.com > - http://www.gamesniffer.com
## Description: PM Popup notifications arrive in the center of your screen. 
## 
## Installation Level: easy
## Installation Time: 1 Minutes
## Files To Edit: overall_header.tpl 
## Included Files: n/a 
################################################################# 
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites 
################################################################# 
## 
## Author Note: 
## 
## Special Thanks:
## Eric King (http://redrival.com/eak/index.shtml)
## Dynamic Drive (http://www.dynamicdrive.com)
##
################################################################# 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
################################################################# 

# 
#-----[ OPEN ]------------------------------------------ 
#

overall_header.tpl

# 
#-----[ FIND ]------------------------------------------ 
#

<!-- 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">
<!--

/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function phpBBPOPUP(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
	if ( {PRIVATE_MESSAGE_NEW_FLAG} )
	{
		phpBBPOPUP('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', '400', '225', 'no');;
	}
//-->
</script>
<!-- END switch_enable_pm_popup -->

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
Feedback is appreciated.
Last edited by Platinum on Wed Apr 17, 2002 10:57 pm, edited 2 times in total.

User avatar
Platinum
Registered User
Posts: 31
Joined: Mon Dec 10, 2001 8:32 pm
Location: Calgary, AB
Contact:

Post by Platinum »

The guilt of stripping the authors tag from inside of his code overwhelmed me, so I placed it back where it belongs. :oops:

Hardout
I am too lazy to register

Post by Hardout »

Works for me thanks alot!!!

I did my first mod a while ago, but this is a really good first mod, keep it up.

The problem is now i cant remember where it used to pop up~!!

User avatar
Platinum
Registered User
Posts: 31
Joined: Mon Dec 10, 2001 8:32 pm
Location: Calgary, AB
Contact:

Post by Platinum »

Hehe.. thank ya !

It used to popup in the top left corner of the screen .. by not handing it actual X,Y startpoints, it just defaulted to 0,0 ..

MJ
Registered User
Posts: 180
Joined: Thu Jan 03, 2002 10:20 pm
Contact:

Post by MJ »

Beautiful!!! :D

Locked

Return to “[2.0.x] MODs in Development”