Page 1 of 1
HTML Pop-Up Window
Posted: Mon Nov 28, 2005 7:28 pm
by Majoraslayer
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
Posted: Mon Nov 28, 2005 9:29 pm
by neophyte
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?
None that I know of...
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.
Posted: Tue Nov 29, 2005 9:06 am
by Majoraslayer
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 >_<.
Posted: Tue Nov 29, 2005 9:11 am
by foobar
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.
Posted: Tue Nov 29, 2005 9:47 am
by Majoraslayer
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.
Posted: Tue Nov 29, 2005 11:43 am
by Chris Corbyn
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.
Why would you get headers already sent errors if you're writing a mod for phpBB?
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

Posted: Tue Nov 29, 2005 12:01 pm
by Burrito
my guess is that you're echoing something or sending something down to the client before php is trying to send headers down...
are you doing something on a page that "redirects"?
Posted: Tue Nov 29, 2005 12:31 pm
by AKA Panama Jack
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 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.
Code: Select all
<script language="Javascript" type="text/javascript">
<!--
window.open('/newprivatemessages.php', '_privatemsg', 'HEIGHT=225,resizable=yes,WIDTH=400');
//-->
</script>
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.
Posted: Tue Nov 29, 2005 1:58 pm
by Majoraslayer
AKA Panama Jack wrote: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 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.
Code: Select all
<script language="Javascript" type="text/javascript">
<!--
window.open('/newprivatemessages.php', '_privatemsg', 'HEIGHT=225,resizable=yes,WIDTH=400');
//-->
</script>
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.
That told me everything I needed to know, thanks.

Posted: Tue Nov 29, 2005 5:36 pm
by Chris Corbyn
Beware of the mighty popup blocker

Posted: Tue Nov 29, 2005 5:49 pm
by AKA Panama Jack
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.
Posted: Tue Nov 29, 2005 6:02 pm
by Chris Corbyn
AKA 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.
Very true... but Yuck

I really hate those things. It'll be pretty difficult for ad-blockers to automatically stop them too I would think.
Posted: Tue Nov 29, 2005 7:38 pm
by Ambush Commander
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.
Posted: Tue Nov 29, 2005 8:40 pm
by Majoraslayer
Ad-blockers aren't really an issue anyway. This is one of those rare cases where I'm the only one that has to be satisfied, because it goes in my new site administration panel I'm building. Thanks for the tips anyway
