pulling files on date.

Soldato
Joined
6 Mar 2008
Posts
10,080
Location
Stoke area
Hi all,

We run monthly promotions on our site and our hosts need to be able to see what is running by day, week or month.

Each promo will have an image, description and T&Cs. Each promo needs to be in order of importance as well.

Using html5/javascript (as a noob) will this be possible and how would you go about it.

All I can think of is having one folder for all the images, desc & T&Cs name them starting with a number to show importance, name of promo, then dates it runs from and too and then using javascript to pull the info and display it in the correct order.
 
You're getting into the realms of dynamic content here, as FabienO suggests, you really want to be considering a database and some server-side scripting here.

You would have a database table containing the promotions which would include all the fields you need such as image url (text), description (text), T&Cs (text), valid from date (date or datetime), valid to date (date or datetime) and probably a rank (int) to be able to set importance. This would easily allow you to show the current valid promotions based on the current date and their rank with a minimal amount of server side code. You could also provide a basic administration interface to add/remove promotions without the aid of a developer/admin.
 
Back
Top Bottom