PDA

View Full Version : Pop up box help




andypullen
Oct 15, 2009, 12:36 PM
I have a podcast XML file that automatically updates a PHP page using a XML parser. What I have going is each entry in the podcast loads a flash audio player that users can click on and listen to that specific entry. The issue is that the page takes a very long time to load, as it's loading each mp3 file plus the little flash player for each audio file.

What I want to do is have a link in each entry that has a lightbox-ish pop up with the audio player contained there, so the page only loads what users want it to.

Thanks for the help. The site is at http://podcast.foothillsstayton.org/ (http://podcast.foothillsstayton.org), but beware it will take a while to load!



SrWebDeveloper
Oct 15, 2009, 01:09 PM
I checked the site - it loaded in a reasonable amount of time (about 8-10 seconds) and I see all the Flash audio player links, tried a few and they work.

And I'm using a POS Windows XP box without tons of RAM at work now, not my powerful Mac at home.

Okay, so you converted an RSS feed into that web page, i.e. each channel item becomes a Flash player to play the associated audio file. Got it. Your approach is almost correct. Here's how I might handle this, re-writing your script to do this:

Normally I'd store all the music stuff in database, make a unique ID for each part of the friendly name in your RSS feed (i.e. http://yoursite.com/rss/music/beatles1) to find the right feed in the database, then dynamically output the player with the proper fields passed as arguments to the player.

If you're not familiar with friendly URL's and .htaccess URL redirects, just use standard arguments instead i.e. ?id=beatles1 and use $_GET['id'] to get it, of course testing to ensure it's set, it's an integer, in range, SQL injection and XSS proof.

Get the idea? If you need further explanation, just ask. Hoping you're "in tune" with me now.

-jim