1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | // Chargement des parametres |
---|
6 | $params = unserialize($conf['PY_GVideo']); |
---|
7 | |
---|
8 | // Mise a jour de la base de donnee |
---|
9 | if (isset($_POST['submit'])) |
---|
10 | { |
---|
11 | $params = array( |
---|
12 | 'gvideo' => array( |
---|
13 | $_POST['pywaie_gvideo_h'], |
---|
14 | $_POST['pywaie_gvideo_w'], |
---|
15 | $_POST['pywaie_gvideo_autoplay'], |
---|
16 | $_POST['pywaie_gvideo_hl']), |
---|
17 | 'ytube' => array( |
---|
18 | $_POST['pywaie_ytube_h'], |
---|
19 | $_POST['pywaie_ytube_w'], |
---|
20 | $_POST['pywaie_ytube_autoplay']), |
---|
21 | 'dm' => array( |
---|
22 | $_POST['pywaie_dm_h'], |
---|
23 | $_POST['pywaie_dm_w'], |
---|
24 | $_POST['pywaie_dm_autoplay']), |
---|
25 | 'wideo' => array( |
---|
26 | $_POST['pywaie_wideo_h'], |
---|
27 | $_POST['pywaie_wideo_w'], |
---|
28 | $_POST['pywaie_wideo_autoplay']), |
---|
29 | 'vimeo' => array( |
---|
30 | $_POST['pywaie_vimeo_h'], |
---|
31 | $_POST['pywaie_vimeo_w'], |
---|
32 | $_POST['pywaie_vimeo_autoplay']), |
---|
33 | 'wat' => array( |
---|
34 | $_POST['pywaie_wat_h'], |
---|
35 | $_POST['pywaie_wat_w'], |
---|
36 | $_POST['pywaie_wat_autoplay']) |
---|
37 | ); |
---|
38 | |
---|
39 | $query = ' |
---|
40 | UPDATE ' . CONFIG_TABLE . ' |
---|
41 | SET value="' . addslashes(serialize($params)) . '" |
---|
42 | WHERE param="PY_GVideo" |
---|
43 | LIMIT 1'; |
---|
44 | pwg_query($query); |
---|
45 | |
---|
46 | array_push($page['infos'], l10n('py_info4')); |
---|
47 | } |
---|
48 | |
---|
49 | $template->assign(array( |
---|
50 | 'PYWAIE_GVIDEO_H' => $params['gvideo'][0], |
---|
51 | 'PYWAIE_GVIDEO_W' => $params['gvideo'][1], |
---|
52 | 'PYWAIE_GVIDEO_HL' => $params['gvideo'][3], |
---|
53 | 'PYWAIE_YTUBE_H' => $params['ytube'][0], |
---|
54 | 'PYWAIE_YTUBE_W' => $params['ytube'][1], |
---|
55 | 'PYWAIE_DM_H' => $params['dm'][0], |
---|
56 | 'PYWAIE_DM_W' => $params['dm'][1], |
---|
57 | 'PYWAIE_WIDEO_H' => $params['wideo'][0], |
---|
58 | 'PYWAIE_WIDEO_W' => $params['wideo'][1], |
---|
59 | 'PYWAIE_VIMEO_H' => $params['vimeo'][0], |
---|
60 | 'PYWAIE_VIMEO_W' => $params['vimeo'][1], |
---|
61 | 'PYWAIE_WAT_H' => $params['wat'][0], |
---|
62 | 'PYWAIE_WAT_W' => $params['wat'][1])); |
---|
63 | |
---|
64 | if ($params['gvideo'][2] == 'true') |
---|
65 | { |
---|
66 | $template->assign(array('PYWAIE_GVIDEO_AUTOPLAY_TRUE' => 'checked="checked"')); |
---|
67 | } |
---|
68 | else |
---|
69 | { |
---|
70 | $template->assign(array('PYWAIE_GVIDEO_AUTOPLAY_FALSE' => 'checked="checked"')); |
---|
71 | } |
---|
72 | if ($params['ytube'][2] == '1') |
---|
73 | { |
---|
74 | $template->assign(array('PYWAIE_YTUBE_AUTOPLAY_TRUE' => 'checked="checked"')); |
---|
75 | } |
---|
76 | else |
---|
77 | { |
---|
78 | $template->assign(array('PYWAIE_YTUBE_AUTOPLAY_FALSE' => 'checked="checked"')); |
---|
79 | } |
---|
80 | if ($params['dm'][2] == '1') |
---|
81 | { |
---|
82 | $template->assign(array('PYWAIE_DM_AUTOPLAY_TRUE' => 'checked="checked"')); |
---|
83 | } |
---|
84 | else |
---|
85 | { |
---|
86 | $template->assign(array('PYWAIE_DM_AUTOPLAY_FALSE' => 'checked="checked"')); |
---|
87 | } |
---|
88 | if ($params['wideo'][2] == 'true') |
---|
89 | { |
---|
90 | $template->assign(array('PYWAIE_WIDEO_AUTOPLAY_TRUE' => 'checked="checked"')); |
---|
91 | } |
---|
92 | else |
---|
93 | { |
---|
94 | $template->assign(array('PYWAIE_WIDEO_AUTOPLAY_FALSE' => 'checked="checked"')); |
---|
95 | } |
---|
96 | if ($params['vimeo'][2] == '1') |
---|
97 | { |
---|
98 | $template->assign(array('PYWAIE_VIMEO_AUTOPLAY_TRUE' => 'checked="checked"')); |
---|
99 | } |
---|
100 | else |
---|
101 | { |
---|
102 | $template->assign(array('PYWAIE_VIMEO_AUTOPLAY_FALSE' => 'checked="checked"')); |
---|
103 | } |
---|
104 | if ($params['wat'][2] == 'true') |
---|
105 | { |
---|
106 | $template->assign(array('PYWAIE_WAT_AUTOPLAY_TRUE' => 'checked="checked"')); |
---|
107 | } |
---|
108 | else |
---|
109 | { |
---|
110 | $template->assign(array('PYWAIE_WAT_AUTOPLAY_FALSE' => 'checked="checked"')); |
---|
111 | } |
---|
112 | |
---|
113 | $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/config.tpl')); |
---|
114 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
115 | |
---|
116 | ?> |
---|