Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | function theme_activate($id, $version, &$errors) |
---|
4 | { |
---|
5 | global $prefixeTable, $conf; |
---|
6 | |
---|
7 | if (!isset($conf['hr_os'])) |
---|
8 | { |
---|
9 | $config = array( |
---|
10 | 'home' => true, |
---|
11 | 'categories' => true, |
---|
12 | 'picture' => false, |
---|
13 | 'other' => true, |
---|
14 | ); |
---|
15 | |
---|
16 | $query = ' |
---|
17 | INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) |
---|
18 | VALUES ("hr_os" , "'.pwg_db_real_escape_string(serialize($config)).'" , "hr_os parameters");'; |
---|
19 | |
---|
20 | pwg_query($query); |
---|
21 | } |
---|
22 | if (isset($conf['derivatives'])) { |
---|
23 | $new = @unserialize($conf['derivatives']); |
---|
24 | $new['d']['Optimal']=ImageStdParams::get_custom(730,9999); |
---|
25 | $query = ' |
---|
26 | UPDATE '.CONFIG_TABLE.' |
---|
27 | SET value="'.pwg_db_real_escape_string(serialize($new)).'" |
---|
28 | WHERE param = "derivatives" |
---|
29 | LIMIT 1'; |
---|
30 | pwg_query($query); |
---|
31 | load_conf_from_db(); |
---|
32 | } |
---|
33 | } |
---|
34 | |
---|
35 | function theme_deactivate() |
---|
36 | { |
---|
37 | global $prefixeTable; |
---|
38 | |
---|
39 | $query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="hr_os" LIMIT 1;'; |
---|
40 | pwg_query($query); |
---|
41 | if (isset($conf['derivatives'])) { |
---|
42 | $new = @unserialize($conf['derivatives']); |
---|
43 | if( isset($new['d']['Optimal'])) |
---|
44 | { |
---|
45 | unset($new['d']['Optimal']); |
---|
46 | $conf['derivatives']=serialize($new); |
---|
47 | $query = ' |
---|
48 | UPDATE '.CONFIG_TABLE.' |
---|
49 | SET value="'.addslashes(serialize($new)).'" |
---|
50 | WHERE param = "derivatives" |
---|
51 | LIMIT 1'; |
---|
52 | pwg_query($query); |
---|
53 | } |
---|
54 | } |
---|
55 | } |
---|
56 | |
---|
57 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.