Last change
on this file since 19815 was
19815,
checked in by julien1311, 12 years ago
|
first working version
|
-
Property svn:eol-style set to
LF
|
File size:
938 bytes
|
Line | |
---|
1 | <?php |
---|
2 | function mtt_install($config) { |
---|
3 | $query = 'INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("mobile_theme_for_tablets" ,"'.pwg_db_real_escape_string(serialize($config)).'", "Mobile Theme for Tablets plugin parameters");'; |
---|
4 | pwg_query($query); |
---|
5 | } |
---|
6 | |
---|
7 | function mtt_update_db() { |
---|
8 | global $conf; |
---|
9 | include(dirname(__FILE__).'/config_default.inc.php'); |
---|
10 | |
---|
11 | $config = array(); |
---|
12 | if (isset($conf['mobile_theme_for_tablets'])) |
---|
13 | $conf_mtt = unserialize($conf['mobile_theme_for_tablets']); |
---|
14 | |
---|
15 | if (isset($conf_mtt)) { |
---|
16 | foreach ($config_default as $key => $value) { |
---|
17 | if (isset($conf_mtt[$key])) |
---|
18 | $config[$key] = $conf_mtt[$key]; |
---|
19 | else |
---|
20 | $config[$key] = $config_default[$key]; |
---|
21 | } |
---|
22 | mtt_delete_conf("mobile_theme_for_tablets"); |
---|
23 | mtt_install($config); |
---|
24 | } else { |
---|
25 | mtt_install($config_default); |
---|
26 | } |
---|
27 | } |
---|
28 | |
---|
29 | function mtt_delete_conf($where) { |
---|
30 | $query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE (param="'.$where.'");'; |
---|
31 | pwg_query($query); |
---|
32 | } |
---|
33 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.