Click to See Complete Forum and Search --> : PHP for updating audio page


novemberGrey
07-19-2007, 03:47 PM
Hey on my churches audio download page we have a list of the 15 most recent sermons. The sermons are displayed in a table with alternating row colors, see here (http://www.ccgulfbreeze.com/media/audio/). When it comes time for updating this page, its a big headache and it takes forever. When we add a new song we have to go back through and change all the row classes so they fluctuate, then you have to search through all this coding to find the right link to update. Could there be any easier way of doing this using php? I'd like simply be able to delete and add a sermon without havign to go through and rename a bunch of stuff. Here's the XHTML coding for that table...

<table id="audioDownloads"><!-- 15 ROWS MAXIMUM -->
<tr class="headingRow"><td>Date</td><td>Message/Scripture</td><td>Speaker</td><td>Format</td></tr>
<tr class="lightRow"><td>07/15/07</td><td>2 Samuel 11:1</td><td>Pastor John Spencer</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070715_2Samuel11_John.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070715_2Samuel11_John.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="darkRow"><td>07/11/07</td><td>Mexico Mission Update</td><td>Mexico 2007 Team</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070711_MexicoRecap_Team.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070711_MexicoRecap_Team.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="lightRow"><td>06/27/07</td><td>Isaiah 26:1</td><td>Pastor John Spencer</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070627_Isaiah26_John.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070627_Isaiah26_John.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="darkRow"><td>06/24/07</td><td>1 Samuel 16:3</td><td>Pastor John Spencer</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070624_1Samuel16_John.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070624_1Samuel16_John.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="lightRow"><td>06/20/07</td><td>Isaiah 24:1</td><td>Pastor John Spencer</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070620_Isaiah24_John.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070620_Isaiah24_John.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="darkRow"><td>06/13/07</td><td>Isaiah 22:1</td><td>Pastor John Spencer</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070613_Isaiah22_John.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070613_Isaiah22_John.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="lightRow"><td>06/10/07</td><td>Mark 15:42</td><td>Pastor John Spencer</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070610_Mark15_John.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070610_Mark15_John.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="darkRow"><td>06/06/07</td><td>Seasons Part 2</td><td>Pastor Neil Spencer</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070606_Seasons2_Neil.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070606_Seasons2_Neil.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="lightRow"><td>06/03/07</td><td>Mark 15:22</td><td>Pastor John Spencer</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070603_Mark15_John.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070603_Mark15_John.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="darkRow"><td>05/30/07</td><td>Seasons Part 1</td><td>Pastor Neil Spencer</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070530_Seasons1_Neil.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070530_Seasons1_Neil.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="lightRow"><td>05/27/07</td><td>God's not finished</td><td>Pastor Fidel Gomez</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070527_NotFinished_Fidel.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070527_NotFinished_Fidel.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="darkRow"><td>05/23/07</td><td>Prayer</td><td>Pastor Steve Feeley</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070523_Prayer_Steve.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070523_Prayer_Steve.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="lightRow"><td>05/20/07</td><td>Mark 15:1</td><td>Pastor John Spencer</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070520_Mark15_John.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070520_Mark15_John.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="darkRow"><td>05/16/07</td><td>Isaiah 19:1</td><td>Pastor John Spencer</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070516_Isaiah19_John.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070516_Isaiah19_John.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
<tr class="lightRow"><td>05/13/07</td><td>Psalm 127</td><td>Pastor John Spencer</td><td><a href="http://multimedia.ccgulfbreeze.com/audio/mp3/20070513_Psalm127_John.mp3" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/windows.jpg" width="18" height="16" class="left" alt="Download Windows Format"/></a><a href="http://multimedia.ccgulfbreeze.com/audio/real/20070513_Psalm127_John.rm" target="_blank"><img src ="http://www.ccgulfbreeze.com/media/audio/images/real.jpg" width="18" height="16" class="right rightPush" alt="Download Realplayer Format"/></a></td></tr>
</table>

jasonahoule
07-19-2007, 04:49 PM
It would be very easy to do that with php. Do you have a database? You can store the related data in the database, retrieve it with php, have the script alternate your class on your rows for you. You could then create an "admin" page where you could upload the new file and insert the data to the table through an html form. You could remove the old ones from this page too. It would be very easy to implement. You could also do it with an XML file or other flat file but that becomes a little more complicated.