Hi there guys,
I've done this a couple of times with mysql, but this time I have to figure out how to do it with nothing more than a config file.
I'm creating a site that uses a random template. What determines where the template is allowed to be shown is: whether it is active and if the page in question will allow it.
To explain better, it's a home building site, and they want their finished pics in the background on all pages., but want to allow the under construction pics to show only on their process and clients pages.
So, say I have five templates.
1: finished and active
2: under construction and active
3:finished and active
4:under construction and active
5: Not active yet, so shouldn't be shown at all.
And these pages that will require a template to be chosen:
index: finished only should show
contact: finished only should show
Our Process: finished or under construction should show
Our Clients: finished or under construction should show
Hopefully, this explains my requirements.
I imagine it would take a flat file of available templates, maybe with csv values representing A) if it's active and 😎 if it's finished or under construction.
My question is two parts:
1) What's the best way to format this(hopefully allowing for future fine tuning, like adding a condition)
2) How do I randomly choose the background on the page in question? In mysql, it was a simple RAND query WHERE my conditions were met, but I don't know how to do this with a normal flat file.
thanks,
json