Is it better to have a template system in the database or in a template file.
Example 1:
template_forums.php:
$forum_top = "<table><tr><td>{forum_name}</td></tr>";
and then on forums.php:
include("templates/default/template_forums.php");
$body = str_replace("{forum_name}", $forum_name);
echo $body;
or this method
a row in mysql db:
forum_top TEXT "<table><tr><td>{forum_name}</td></tr>"
and then in forums.php:
$result = query("SELECT forum_top FROM templates WHERE styleid='1'");
$row = mysql_fetch_array($result);
$body = str_replace("{forum_name}", $row[forum_top]);
Example 1:
template_forums.php:
$forum_top = "<table><tr><td>{forum_name}</td></tr>";
and then on forums.php:
include("templates/default/template_forums.php");
$body = str_replace("{forum_name}", $forum_name);
echo $body;
or this method
a row in mysql db:
forum_top TEXT "<table><tr><td>{forum_name}</td></tr>"
and then in forums.php:
$result = query("SELECT forum_top FROM templates WHERE styleid='1'");
$row = mysql_fetch_array($result);
$body = str_replace("{forum_name}", $row[forum_top]);















