Howto: Any pop-up window in phpbb menu

phpBB integration forum

Howto: Any pop-up window in phpbb menu

Postby illonavamp » Wed Jan 17, 2007 6:21 am

Just thought this might help. I have a basic phpbb and am currently looking at adding in items like eqdkp etc as pop-ups. Was reading another thread and have taken this to its most basic level.

1. Create a test html which you can replace with whatever once you see how this works.

Code: Select all
<html>
<head>
</head>
<body>
Boo
</body>
</html>


2. Save as boo.html and upload this to your phpbb root.

3. Open overall_header.tpl in your templates directory.

4. Find
Code: Select all
</head>


5. Before this, paste:

Code: Select all
<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=1000,height=600,left = 140,top = 212');");
}
// End -->
</script>


(you can change the window width/height/position to whatever)

Now to place the link on the main menu: for a link with an image:

6. Find
Code: Select all
<a href="{U_SEARCH}"


7. Before this

Code: Select all
<a href="javascript:popUp('boo.html')"><img src="templates/path/to/your/image.gif" width="12" height="13" border="0" alt="boo" hspace="3" />Boo</a>


for a basic text link:

Code: Select all
<a href="javascript:popUp('boo.html')">Boo</a>


8. Upload your new overall_header.tpl file.

That's it.

If you want another pop-up to have different size etc copy the chunk of java and paste it, give it a 2, like so:

Code: Select all
<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=1000,height=600,left = 140,top = 212');");
}
function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=1000,height=600,left = 140,top = 212');");
}

// End -->
</script>


- and the link would look like:

Code: Select all
<a href="javascript:popUp2('boo.html')">Boo</a>


Hope this helps, I like to strip things down to their most basic level to work on.

Sam
Last edited by illonavamp on Wed Jan 17, 2007 6:23 am, edited 1 time in total.
illonavamp
WR.net Apprentice
WR.net Apprentice
 
Posts: 5
Joined: Thu Dec 07, 2006 5:04 pm
Location: England

Return to phpBB

Who is online

Users browsing this forum: No registered users and 0 guests

cron