HTML Pop-Up Window
Moderator: General Moderators
-
Majoraslayer
- Forum Commoner
- Posts: 64
- Joined: Thu Jun 30, 2005 11:50 am
- Location: In Your Mind...
- Contact:
HTML Pop-Up Window
Is there a way to make a pop-up window that pops up when the user opens the page, written completely in HTML? I can't use Javascript or anything else that would require editing the header because I'm working on a personal MOD for phpBB. So, the header has already been sent by phpBB's scripts and I'm not sure where from. I just need a pop-up window that pops up automatically without Javascript etc. if at all possible. Thanks for any help or suggestions. 
Re: HTML Pop-Up Window
None that I know of...Majoraslayer wrote:Is there a way to make a pop-up window that pops up when the user opens the page, written completely in HTML?
The phpBB template engine spits out output as it goes. So if it needs to be done before headers it needs to be done during or before /includes/header.php is included.
If you want a pop-up window gotta use JS.
-
Majoraslayer
- Forum Commoner
- Posts: 64
- Joined: Thu Jun 30, 2005 11:50 am
- Location: In Your Mind...
- Contact:
Since its header information, I should theoretically be able to include it via PHP echo before everything else in the script, correct?
Actually, I'm taking a shot in the dark and guessing that I should be able to add it to the header template file that the admin pages read from. There's only one problem.....I don't know what file that is, and I don't know how to skin phpBB's admin pages with it! I know you can skin over a regular page by simply including page_header.php, but the ACP of 2.0.18 doesn't seem to be as simple >_<.
Actually, I'm taking a shot in the dark and guessing that I should be able to add it to the header template file that the admin pages read from. There's only one problem.....I don't know what file that is, and I don't know how to skin phpBB's admin pages with it! I know you can skin over a regular page by simply including page_header.php, but the ACP of 2.0.18 doesn't seem to be as simple >_<.
It doesn't matter what happens in the header, it doesn't affect your browser in any way. What I mean by that is that you can't make any client-side changes with server-side code. You _must_ use JS to open a new window or do anything on the client-side, for that matter. I'm sure you could fiddle around with phpbb's JS code so it would do what you want it to.
-
Majoraslayer
- Forum Commoner
- Posts: 64
- Joined: Thu Jun 30, 2005 11:50 am
- Location: In Your Mind...
- Contact:
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Why would you get headers already sent errors if you're writing a mod for phpBB?Majoraslayer wrote:Well, the main reason I'm concerned about where to put the code is a server side "Headers Already Sent" error. I know it won't affect the client side, other than in most cases the users would see the error at the top of the page.
You'll only see those errors if you are trying to set HTTP headers using header() or session_..() etc...
JavaScript doesn't intefere with the headers, it just redirects the browser location elsewhere.
Perhaps if you explain exactly what you need to acheive we'll figure it out
- AKA Panama Jack
- Forum Regular
- Posts: 878
- Joined: Mon Nov 14, 2005 4:21 pm
You can use javascript to initiate a popup window anywhere in the body of the html page. You are not required to place javascript in the header.Majoraslayer wrote:Well, the main reason I'm concerned about where to put the code is a server side "Headers Already Sent" error. I know it won't affect the client side, other than in most cases the users would see the error at the top of the page.
Code: Select all
<script language="Javascript" type="text/javascript">
<!--
window.open('/newprivatemessages.php', '_privatemsg', 'HEIGHT=225,resizable=yes,WIDTH=400');
//-->
</script>-
Majoraslayer
- Forum Commoner
- Posts: 64
- Joined: Thu Jun 30, 2005 11:50 am
- Location: In Your Mind...
- Contact:
That told me everything I needed to know, thanks.AKA Panama Jack wrote:You can use javascript to initiate a popup window anywhere in the body of the html page. You are not required to place javascript in the header.Majoraslayer wrote:Well, the main reason I'm concerned about where to put the code is a server side "Headers Already Sent" error. I know it won't affect the client side, other than in most cases the users would see the error at the top of the page.
The above will cause a 400 pixel wide, 225 pixel wide window to open and execute the newprivatemessages.php program through that window. The script can be placed anywhere in the main body of the html page and it will open a popup window.Code: Select all
<script language="Javascript" type="text/javascript"> <!-- window.open('/newprivatemessages.php', '_privatemsg', 'HEIGHT=225,resizable=yes,WIDTH=400'); //--> </script>
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- AKA Panama Jack
- Forum Regular
- Posts: 878
- Joined: Mon Nov 14, 2005 4:21 pm
If you want to bypass ANY popup blocker you make it a div layer on the html page with a close button.
This way it's a popup no matter what type of popup blocker they use.
Last edited by AKA Panama Jack on Tue Nov 29, 2005 6:08 pm, edited 1 time in total.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Very true... but YuckAKA Panama Jack wrote:If you want to buypass ANY popup blocker you make it a div layer on the html page with a close button.This way it's a popup no matter what type of popup blocker they use.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
You know how Mozilla blocks ads and notifies you? It makes this little bar come down from the top, notifying you that something happened, lets you close it too.
I'd love to see a JavaScript implementation of that. It'd be so nice and non-intrusive too...
By the way, d11wtq, check out AdBlock plus, which allows blocking of DIVs.
I'd love to see a JavaScript implementation of that. It'd be so nice and non-intrusive too...
By the way, d11wtq, check out AdBlock plus, which allows blocking of DIVs.
-
Majoraslayer
- Forum Commoner
- Posts: 64
- Joined: Thu Jun 30, 2005 11:50 am
- Location: In Your Mind...
- Contact: