Hi all im just showing you here my template/style system in a hope that someone can help me make it into a proper system or give me advice on bits to change etc. So here goes...
The way im doing it right now is you have a table called style in there is the name of style which is also the name of the styles folder. Inside the styles folder is the css style and template files for the site.
On the site index i then have this;
// Style system
$style=mysql_fetch_assoc(mysql_query("SELECT * FROM styles WHERE `used` = '1'"));
This finds the current style being used from the styles table. Then this;
// Bring in the index template from the current style
include("styles/$style[name]/index.tpl.php");
Which then includes the styles index template...inside the index template is this;
<?php
Print <<< END
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#000000">
<td height="82" colspan="3" valign="top">
<div align="center"><img src="styles/{$style[name]}/logo.png" width="462" height="82"></div></td>
</tr>
<tr>
<td class="blocks" width="117" height="18" valign="top">
END;
// Left blocks
while ($block = mysql_fetch_assoc($record_set))
{
include('blocks/'.$block['name'].'.tpl.php');
}
// End left blocks
Print <<< END
<br><div align="center"><a href="DOCS/CHANGELOG.txt">CHANGELOG</a></div>
</td>
<td class="blocks" width="761" valign="top">
END;
// Module loading
include('modules/'.$module.'/index.php');
// End module loading
Print <<< END
</td>
<td class="blocks" width="117" valign="top">
END;
// Right blocks
while ($block2 = mysql_fetch_assoc($record_set2))
{
include('blocks/'.$block2['name'].'.tpl.php');
}
// End right blocks
Print <<< END
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="copyright"><div align="center">{$your_copy}<br>{$our_copy}</div></td>
</tr>
</table>
END;
?>
Ive seen almost all others have no <?php & ?> tags in there template files...how do they manage to do it?...and this is a pretty bad way isn't it?