Matthew -
sorry, I had no choice with the Outlook thing at the office :-(
I'll elm this time :-]
>
> > first of all -
> > most of the options on config.php could be moved to an SQL table.
>
> Agreed, but it should be on a module to module basis.
Well, Alessandro seems to have this one under control already ;)
>
> > second -
> > create a generic theme that reads CSS values from SQL. That would let
> > admins change the primary website colors and fonts without having to make
> > a new theme or modify an existing one.
>
> The funny thing about CSS is it does not like any php code in them at all.
> I am thinking of writing a CSS editor module that writes a CSS file or
> prints to screen for uploading.
>
> Having a CSS file alone is pretty essential as it ties together all the
> other modules. I think having a module change colors and such on the fly
> would limit the module/plugin developers as they would design with it in
> mind. If I can be proven wrong great ;) but I think that style by DB would
> be difficult.
>
True. However there are several ways to implment this (i'm sure this one sucks - i'm not that good with
PHP yet, but the concept seems ok)
Say, you have a table (styletable) that has a couple of fields - 'theme' (varchar) and 'stylesheet'
(text).
you populate the table with stylesheets corresponding to the theme(s).
then, you could write a little wrapper (e.g. getstylesheet.php) like this -
(sans error checking for now...)
<?php
$result = mysql_query("select stylesheet from styletable where theme like '$HTTP_GET_VARS[theme]'");
$style = mysql_fetch_object($result);
echo $style->stylesheet;
mysql_free_result($style);
?>
then, in your theme header:
<link rel="stylesheet" href="/getstylesheet.php?theme=MyFavoriteTheme" type="text/css" />
this way, you only change one line in the theme...
would this not work?...
best regards,
Vlad
|