source: extensions/imgpreview/maintain.inc.php @ 13741

Last change on this file since 13741 was 11948, checked in by flop25, 13 years ago

new parameters in database and managed by the admin page
fr lang updated
need translations

File size: 941 bytes
Line 
1<?php
2
3function plugin_install()
4{
5    global $prefixeTable;
6    $q = '
7INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
8        VALUES
9        ("imgpreview" , "600#600#true#true" , "max-width#max-height#title#opacity");';
10    pwg_query($q);
11
12}
13
14
15
16function plugin_activate()
17{
18  global $prefixeTable, $conf;
19        //////////// Check Config
20        $query = '
21        SELECT COUNT(*) AS result FROM '.CONFIG_TABLE.'
22        WHERE param IN (\'imgpreview\')
23        ;';
24        $data_table = pwg_db_fetch_assoc(pwg_query($query));
25        $exist = $data_table['result'];
26        if ( $exist == 0 )
27        {
28                plugin_install();
29        } 
30        else {
31                load_conf_from_db();
32
33                if (count(explode("#" , $conf['imgpreview']))!=4)
34                {
35                        pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param IN (\'imgpreview\')');
36                        pwg_query($q);
37                        plugin_install();
38                }
39        }
40}//fin active
41
42
43
44
45function plugin_uninstall()
46{
47        global $prefixeTable;
48  pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param IN (\'imgpreview\')');
49}//fin uninstall
50
51
52?>
Note: See TracBrowser for help on using the repository browser.