HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Developers' Forum (http://www.howtoforge.com/forums/forumdisplay.php?f=33)
-   -   using 'sys_config' vs 'sys_ini' table? (http://www.howtoforge.com/forums/showthread.php?t=58142)

cfoe 31st July 2012 18:19

using 'sys_config' vs 'sys_ini' table?
 
I need to add some vars for the templates to the db.

Could or should I use
sys_config table or
sys_ini table

or should I add a new table?

till 31st July 2012 18:42

If the variables are available for all themes or general interface settings, then please use sys_ini table. The variables are defined in the system.ini file in the install/conf/ folder and in the form and template file of the interface config form. No database fields have to be added.

cfoe 31st July 2012 18:47

and for theme specific parameters?

till 31st July 2012 19:42

Good questions indeed :) Maybe we should use the sys_ini table for this.

cfoe 31st July 2012 21:38

The structure of the sys_config table is a little more complex and I think it will leave a lot more leeway for future extension.
What have you planned to put in there?

EDIT/ADD: Or a new table? Like 'sys_tpl' ?

till 1st August 2012 11:02

I had planned to use the sys_config table as general key value store and to implement user defined overrides for default values with it (http://bugtracker.ispconfig.org/inde...=582&project=3). The sys_ini system that we use for server and interface values at the moment is easy and works fine, but in case that we reach the limits of the ini style storage in future (e.g. requirements for multiline values), it might be migrated to sys_config values as well.

Quote:

EDIT/ADD: Or a new table? Like 'sys_tpl' ?
Thats an option too. But then we might have to write some kind of script in the installer / updater that automatically detects the existing themes and adds them to this table, so that we replace the current "scan dir" like functionality for themes with a table that holds the details of the themes and some default values..

Which values do you plan to store for the theme?

cfoe 2nd August 2012 12:20

I was planning to make "branding" totally global but I had to realize that if themes should be as flexible as possible branding needs to vary on a theme basis.
for example the logo might need different dimensions.

one more thing to consider is the future possibility to set branding on a per user/per reseller basis. (maybe for 3.0.6)

cfoe 7th August 2012 13:55

I have added tables in the format of
tpl_*theme-title*

for the standard themes: tpl_default + tpl_default-v2

Tables and config pages will not be required for a theme but will be possible by 3.0.5 to make parameters changeable within the frontend

till 7th August 2012 15:30

I dont think that its a good idea to have a table for each theme, this will clutter the database and each table will have just one record anyway.

We should change this to one table "sys_user_theme" or "sys_theme" to match the naming scheme and the table has a field for the theme name.

cfoe 7th August 2012 15:43

how many themes do you want to install?

I think I will be happy with 1.

But I think we can manage with 1 table for most themes


All times are GMT +2. The time now is 02:14.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.