TinyPortal

Development => Block Codes => Topic started by: Zetan on June 03, 2009, 08:25:47 AM

Title: [Block] Popup Window - User configurable
Post by: Zetan on June 03, 2009, 08:25:47 AM
This is a simple user configurable Popup Window, useful for streaming media such as a Shoutcast Radio Player where you want people to be able to listen to music, for example, while being able to continue browsing your website without the player being interupted and restarting each time a page is changed or refreshed. Many modern Flash players now feature their own popout player launched from within the application itself, but there are still other players and other uses for a Popup Window.

I have created a demo page at my website for you to view the Popup Window. In the demo, I have used some elements of the style.css from the SMF Default Core Theme as the basic theme for the Popup:

Popup Demo (http://www.slayingsteel.com/index.php?page=PopupDemo)



I have written this Popup Window so that it uses:

Title: Re: [Block] Popup Window - User configurable
Post by: Zetan on June 04, 2009, 07:16:55 PM
[UPDATE]

Added a second demo featuring an audio player and custom theme. Currently uploading tracks to the player which need some name edits. I'll post the code for the demo later when it's finished.
Title: Re: [Block] Popup Window - User configurable
Post by: FERNSIDEâ„¢ on June 11, 2009, 11:59:57 AM
Hi Zetan,
love your popup code mate.

I cannot get the button to work though.
Where you state this "Edit the address of the link to launch the Popup to the path where you have uploaded the html file."
could you show me where to do this please?
Which part of the code using an example?
I've tried a few things with no success.

Thanks mate :)
Title: Re: [Block] Popup Window - User configurable
Post by: Zetan on June 11, 2009, 12:14:16 PM
This is the section for the button:



<!-- Create the button START -->

<div align="center">
<A HREF="javascript:popUp('PopupDemo.html')">Launch Popup Window</A>
</div>

<!-- Create the button END -->




<A HREF="javascript:popUp('http://www.example.com/PopupDemo.html')">Launch Popup Window</A>

You shouldn't need a complete URL unless the file is hosted externally from the site where the link is.

Title: Re: [Block] Popup Window - User configurable
Post by: FERNSIDEâ„¢ on June 11, 2009, 12:30:18 PM
Yep, that was the original place I added the url, but for some reason nothing happens when I click the link.
I can go to the popup box in my browser, its just the button that isnt working for me.
Im putting it in a block(scriptbox) as Im still on TP v0.9.8, should that matter? Ive tried an html block also to no avail.
I havent edited any of the code, as Im trying to get it to work first lol
Title: Re: [Block] Popup Window - User configurable
Post by: Zetan on June 11, 2009, 12:32:52 PM
Would you mind if I take a look? You are welcome to PM me with a temp admin account, password and username. Plus the complete URL to the file.
Title: Re: [Block] Popup Window - User configurable
Post by: FERNSIDEâ„¢ on June 11, 2009, 01:19:06 PM
Thanks mate, PM sent :)
Title: Re: [Block] Popup Window - User configurable
Post by: Zetan on June 11, 2009, 01:28:06 PM
Looking now..

You have a weird site address going on, whats with the 3 slashes? ///index.php?
Title: Re: [Block] Popup Window - User configurable
Post by: FERNSIDEâ„¢ on June 11, 2009, 01:33:44 PM
Yeah, I havent had time to sort that out yet, only just started that site to start testing again instead of coding live.
Im not worried as its a mates host, but I'll sort that out tomorrow.
Off to bed.
Thanks for having a look mate :)
Ciao
Title: Re: [Block] Popup Window - User configurable
Post by: Zetan on June 11, 2009, 01:35:21 PM
Well, I just copied the code from my demo page, it works. I'll check over the code posted above.

[edit] Removed temporary test page link.
Title: Re: [Block] Popup Window - User configurable
Post by: FERNSIDEâ„¢ on June 11, 2009, 01:37:49 PM
Thanks mate.
I popup on your site?
Yeah I went to that page to check out the popup before I tried the code.
Title: Re: [Block] Popup Window - User configurable
Post by: Zetan on June 11, 2009, 01:45:10 PM
No, thats a new test page, with the address of your popup demo :)

I've ammended the code for the button in the first post, you can test it for me if you don't mind.

Thanks for bug hunting, lol.. it can be a bit finiky sometimes.. might have been a comment causing it.

[edit] It was actually the line I mentioned before:



'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=600,height=500');");




it needs to be all on the same line:



eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=1,statusbar=1,menubar=1,resizable=1,width=540,height=420');");





My fault! .... stoopid finiky code
Title: Re: [Block] Popup Window - User configurable
Post by: FERNSIDEâ„¢ on June 12, 2009, 03:29:26 AM
lol yeah, I saw that before I crashed last night after you mentioned that line.
Thanks for your assistance, and I'll lead the bug hunt for you anytime! lol ;)
Gonna tear down that site and install smf2 n the latest TP.
About time I started learning the layout :)

Cheers
Title: Re: [Block] Popup Window - User configurable
Post by: ZarPrime on June 12, 2009, 05:02:56 AM
Quote from: Sabreâ„¢ on June 12, 2009, 03:29:26 AM
lol yeah, I saw that before I crashed last night after you mentioned that line.
Thanks for your assistance, and I'll lead the bug hunt for you anytime! lol ;)
Gonna tear down that site and install smf2 n the latest TP.
About time I started learning the layout :)

Cheers

Time Out Sabreâ„¢.  TP will not currently work with SMF 2 unless you happen to be a team member and have a copy of TP 2 Alpha.  I don't think any of this applies, does it?

ZarPrime
Title: Re: [Block] Popup Window - User configurable
Post by: FERNSIDEâ„¢ on June 12, 2009, 06:40:20 AM
Well as you can see ZarPrime, No I am not a team member, that therefore means I would not, or should not have a copy of TP 2 Alpha. Shouldn't it?
What I meant is to install smf2 on one of my test sites, and install the latest TP on another, as I have multiple test sites for other projects, and have not done so yet. Anybody that has been here long enough usually knows that there is no version of TP publicly available for smf 2.0 RC1-1. I may explain my intentions completely next time.
But thank You for the heads up anyway. (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.getsmile.com%2Femoticons%2Fsmileys-91853%2F_950%2Fumbrella.gif&hash=2bd8db0a0ae84a802b1074a77fa8b260f0561683)

Back on topic
Quote from: Zetan on June 11, 2009, 01:45:10 PMI've ammended the code for the button in the first post, you can test it for me if you don't mind.

Yep, works as designed.
Cheers mate :)
Title: Re: [Block] Popup Window - User configurable
Post by: Zetan on June 12, 2009, 06:59:49 AM
Quote from: Sabreâ„¢ on June 12, 2009, 06:40:20 AM

Quote from: Zetan on June 11, 2009, 01:45:10 PMI've ammended the code for the button in the first post, you can test it for me if you don't mind.

Yep, works as designed.
Cheers mate :)

You're welcome :)
Title: Re: [Block] Popup Window - User configurable
Post by: ZarPrime on June 12, 2009, 12:30:37 PM
Quote from: Sabreâ„¢ on June 12, 2009, 06:40:20 AM
Well as you can see ZarPrime, No I am not a team member, that therefore means I would not, or should not have a copy of TP 2 Alpha. Shouldn't it?
What I meant is to install smf2 on one of my test sites, and install the latest TP on another, as I have multiple test sites for other projects, and have not done so yet. Anybody that has been here long enough usually knows that there is no version of TP publicly available for smf 2.0 RC1-1. I may explain my intentions completely next time.
But thank You for the heads up anyway. (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.getsmile.com%2Femoticons%2Fsmileys-91853%2F_950%2Fumbrella.gif&hash=2bd8db0a0ae84a802b1074a77fa8b260f0561683)

NP Sabre, I think I knew that you knew that TP 1 doesn't work on SMF 2, but there are people who have tried to install it on SMF 2 and later found out they made a mistake.  I was just trying to make sure the same thing didn't happen to you. :up:

Back to topic.

ZP
Title: Re: [Block] Popup Window - User configurable
Post by: Lord Anubis on July 13, 2009, 12:07:51 AM
works great, nice code Zetan :up:
Title: Re: [Block] Popup Window - User configurable
Post by: Zetan on July 13, 2009, 08:35:49 AM
Quote from: Lord Anubis on July 13, 2009, 12:07:51 AM
works great, nice code Zetan :up:

Thanks Lord Anubis :)