1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | $params = unserialize($conf['PY_GVideo']); |
---|
6 | |
---|
7 | $idvideo = file_get_contents($picture['current']['path']); |
---|
8 | $sp = explode("/", $idvideo); |
---|
9 | |
---|
10 | $template->assign(array( |
---|
11 | 'ID_GVIDEO' => $sp[0], |
---|
12 | 'H_GVIDEO' => !empty($sp[1]) ? $sp[1] : $params[$extension][0], |
---|
13 | 'W_GVIDEO' => !empty($sp[2]) ? $sp[2] : $params[$extension][1], |
---|
14 | 'AUTO_GVIDEO' => $params[$extension][2], |
---|
15 | 'HEIGHT_IMG' => !empty($sp[1]) ? $sp[1] : $params[$extension][0], |
---|
16 | 'WIDTH_IMG' => !empty($sp[1]) ? $sp[1] : $params[$extension][0], |
---|
17 | )); |
---|
18 | |
---|
19 | if ($extension == 'gvideo') |
---|
20 | { |
---|
21 | $template->assign(array( |
---|
22 | 'LANG_GVIDEO' => $params[$extension][3], |
---|
23 | 'START_GVIDEO' => !empty($sp[3]) ? "initialTime=" . $sp[3] : '')); |
---|
24 | } |
---|
25 | |
---|
26 | // bouton de telechargement |
---|
27 | unset($template->smarty->_tpl_vars['current']['U_DOWNLOAD']); |
---|
28 | $pi = pathinfo($picture['current']['path']); |
---|
29 | $location = get_filename_wo_extension($pi['dirname'] . '/pwg_high/' . $pi['basename']); |
---|
30 | foreach(array('.asf', '.wmv', '.divx', '.xvid', '.avi', '.AVI', '.qt', '.mov', '.mpg', '.mpeg', '.mp4', '.flv', '.zip', '.rar') as $high_ext) |
---|
31 | { |
---|
32 | if (file_exists($location . $high_ext)) |
---|
33 | { |
---|
34 | $template->smarty->_tpl_vars['current']['U_DOWNLOAD'] = $location . $high_ext; |
---|
35 | } |
---|
36 | } |
---|
37 | |
---|
38 | $template->set_filenames(array('py_content' => dirname(__FILE__) . '/template/pywaie_' . $extension . '.tpl')); |
---|
39 | $content = $template->parse('py_content', true); |
---|
40 | |
---|
41 | ?> |
---|