source: extensions/gvideo/gvideo.php @ 5819

Last change on this file since 5819 was 3609, checked in by patdenice, 15 years ago

Convert all php and tpl files in Unix format for my plugins.

File size: 1.3 KB
Line 
1<?php
2
3if (!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
16if ($extension == 'gvideo')
17{
18  $template->assign(array(
19    'LANG_GVIDEO' => $params[$extension][3],
20    'START_GVIDEO' => !empty($sp[3]) ? "initialTime=" . $sp[3] : ''));
21}
22
23// bouton de telechargement
24unset($template->smarty->_tpl_vars['current']['U_DOWNLOAD']);
25$pi = pathinfo($picture['current']['path']);
26$location = get_filename_wo_extension($pi['dirname'] . '/pwg_high/' . $pi['basename']);
27foreach(array('.asf', '.wmv', '.divx', '.xvid', '.avi', '.AVI', '.qt', '.mov', '.mpg', '.mpeg', '.mp4', '.flv', '.zip', '.rar') as $high_ext)
28{
29  if (file_exists($location . $high_ext))
30  {
31    $template->smarty->_tpl_vars['current']['U_DOWNLOAD'] = $location . $high_ext;
32  }
33}
34
35$template->set_filenames(array('default_content' => dirname(__FILE__) . '/template/pywaie_' . $extension . '.tpl'));
36$content = $template->parse('default_content', true);
37
38?>
Note: See TracBrowser for help on using the repository browser.