source: extensions/gvideo/maintain.inc.php @ 14713

Last change on this file since 14713 was 3697, checked in by patdenice, 15 years ago

Allow to add videos from Wat.tv.

File size: 1.3 KB
Line 
1<?php
2
3function 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'),
10    'vimeo' => array('480', '640', '1'),
11    'wat' => array('480', '640', 'true'),
12    );
13
14        $q = 'REPLACE INTO ' . CONFIG_TABLE . ' (param,value,comment)
15VALUES ("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
20function 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'])
32    or ($params = unserialize($conf['PY_GVideo']) and !isset($params['wat'])))
33  {
34    plugin_install();
35  }
36}
37
38function 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
51?>
Note: See TracBrowser for help on using the repository browser.