. */ if (empty($GLOBALS['audioPlayer'])) $GLOBALS['audioPlayer'] = 1; function tpl_function_audio($params, &$tpl) { global $nk; $nb_player =& $GLOBALS['audioPlayer']; if (!empty($params['title'])) $title = $params['title']; else $title = "Lecteur audio"; unset($params['title']); $tracks = array(); foreach ($params as $key=>$value) { if (!preg_match('!^(\S*/([^/]+)(?:\.mp3))(?:\s*\|\s*(.+))?$!i', $value, $match)) { return nk_plugin_error("{audio} Ce fichier source est invalide : ".$value); } $tracks[$key] = array($match[1], !empty($match[3]) ? $match[3] : strtr(urldecode($match[2]), '_-', ' ')); } if (empty($tracks)) return nk_plugin_error("{audio} Aucun fichier fournit en paramètre."); $html = ''; if ($nb_player == 1) { $html .= ''; } $html .= '
'.(int)$key.'. '.htmlspecialchars($track[1]).' | MP3 |
---|