[3609] | 1 | <?php |
---|
| 2 | |
---|
| 3 | function plugin_install() |
---|
| 4 | { |
---|
| 5 | $params = array( |
---|
| 6 | 'gvideo' => array('480','640','true','en'), |
---|
| 7 | 'ytube' => array('480','640','1'), |
---|
| 8 | 'dm' => array('480','640','1'), |
---|
| 9 | 'wideo' => array('480', '640', 'true'), |
---|
[3697] | 10 | 'vimeo' => array('480', '640', '1'), |
---|
| 11 | 'wat' => array('480', '640', 'true'), |
---|
[3609] | 12 | ); |
---|
| 13 | |
---|
| 14 | $q = 'REPLACE INTO ' . CONFIG_TABLE . ' (param,value,comment) |
---|
| 15 | VALUES ("PY_GVideo","' . addslashes(serialize($params)) . '" , "PY Gvideo plugin parameters");'; |
---|
| 16 | pwg_query($q); |
---|
| 17 | } |
---|
| 18 | |
---|
| 19 | // La table de config se met à jour automatiquemlent lors de l'activation |
---|
| 20 | function plugin_activate() |
---|
| 21 | { |
---|
| 22 | global $conf; |
---|
| 23 | |
---|
| 24 | // Suppression des anciens paramètres (version < 1.7.o) |
---|
| 25 | if (isset($conf['pywaie_gvideo'])) |
---|
| 26 | { |
---|
| 27 | pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param LIKE "pywaie_%";'); |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | // Vérification des nouveaux paramètres |
---|
| 31 | if (!isset($conf['PY_GVideo']) |
---|
[3697] | 32 | or ($params = unserialize($conf['PY_GVideo']) and !isset($params['wat']))) |
---|
[3609] | 33 | { |
---|
| 34 | plugin_install(); |
---|
| 35 | } |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | function plugin_uninstall() |
---|
| 39 | { |
---|
| 40 | global $conf; |
---|
| 41 | |
---|
| 42 | // Suppression des anciens paramètres (version < 1.7.o) |
---|
| 43 | if (isset($conf['pywaie_gvideo'])) |
---|
| 44 | { |
---|
| 45 | pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param LIKE "pywaie_%";'); |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param = "PY_GVideo";'); |
---|
| 49 | } |
---|
| 50 | |
---|
[3296] | 51 | ?> |
---|