Using MySQL, I created a simple table with only two columns: variable and value. Into this table I can simply place the name of the marker ("login_form", "name.of.pet") and it's value.
I then use a similar script to the following:
Code: Select all
<?php
$conn = db_connect();
$query = "SELECT * FROM variables";
$result = mysql_query($query, $conn);
$template = load_template();
while ($row = mysql_fetch_array($result))
{
$variable = "{" . $row['variable'] . "}";
$value = $row['value'];
$template = str_replace($variable, $value, $template);
}
echo $template;
?>It is easy to expand this script to include categories, so instead of having to use "{style_td_header}" you could use "{style:td_header}" or even "{style:td:header}".
It's been an interesting read so far. I hope this thread is kept up!