Events List

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bristols
Forum Newbie
Posts: 1
Joined: Thu Oct 01, 2009 9:33 am

Events List

Post by bristols »

I have a list of about 60 events. This list is in one HTML file. I want to have a 'Forthcoming Events' list displayed on every page of my website, showing three forthcoming events from my list of 60 at a time. I want the events shown in the Forthcoming list to automatically update itself so that only forthcoming events are ever shown.

My full list of 60 is marked up in one HTML file, using a TABLE. In the code, the events start after the TBODY tag. Each event has its own table row (TR). It begins like this:

Code: Select all

 
 
<table class="events">
    <thead>
        <tr>
            <th id="event-date">Date</th>
            <th id="event-title">Title</th>
        </tr>
    </thead>
    <tbody>
        <tr class="vevent event-performance">
            <th headers="event-date"><abbr class="dtstart" title="2009-10-01T2000+0100">01 Oct 2009</abbr></th>
            <td headers="event-title" class="summary"><a href="/events/2009/first-event.html" rel="bookmark">First Event</a></td>
        </tr>
        <tr class="vevent event-radio">
            <th headers="event-date"><abbr class="dtstart" title="2009-10-02T1000+0100">02 Oct 2009</abbr></th>
            <td headers="event-title" class="summary"><a href="/events/2009/second-event.html" rel="bookmark">Second Event</a></td>
        </tr>
....
 
I am a complete PHP novice! Would anyone know how I could grab three forthcoming events at a time from this list, and output those three in EXACTLY the same code as shown above to all the pages of my website?

I realise that I would need to produce a 'forthcoming events' template and include that in my web pages. I just don't know how to produce that template!

Any help or pointers would be much appreciated!
Turv
Forum Commoner
Posts: 25
Joined: Fri Mar 13, 2009 3:56 pm

Re: Events List

Post by Turv »

You will find it much easier if you was to store that data in a database. What you are after could be done in a matter of minutes if that was the case.
Post Reply