require("../aves.inc.php"); if (isset($_GET['lk'])) $lk = preg_replace("/http(s)*/", "", $_GET['lk']); else $lk = ''; if (preg_match("£\.mp3£", $lk)) { $sql = "SELECT espece, nom, id_espece, com FROM chants, especes WHERE (path = '".$lk."' OR path = '".str_replace("mp3", "wav", $lk)."') AND especes.id = id_espece"; if (preg_match("/([A-Za-z]+_[a-z]+){1}(_[a-z\.])*/ui", $lk, $req)) { $ioc_name = str_replace("_", " ", $req[1]); $sql_ioc = "SELECT espece, nom, id_aves FROM especes, taxo_ioc WHERE scientific_name = '".$ioc_name."' AND especes.id = id_aves"; } if($res = mysqli_query($GLOBALS['link'], $sql) AND mysqli_num_rows($res) > 0) { $sp = mysqli_result($res, 0, "espece"); $nom = mysqli_result($res, 0, "nom"); $com = mysqli_result($res, 0, "com"); $titre = $nom. ", ".$sp; $key = $nom. ", ".$sp; $titre_com = " ".$sp." - ".$com; } elseif (isset($ioc_name) AND $res_ioc = mysqli_query($GLOBALS['link'], $sql_ioc)) { $sp = mysqli_result($res_ioc, 0, "espece"); $nom = mysqli_result($res_ioc, 0, "nom"); $titre = $nom. ", ".$sp; $key = $nom. ", ".$sp; $titre_com = " ".$sp.""; } else $sp = $com = $nom = $titre = $key = $titre_com = ''; $mask = "/[A-Za-z]+_[a-z]+_([_a-z]+)\.mp3$/ui"; if (preg_match($mask, $lk, $req)) $titre_com .= ' - '.str_replace("_", " ", $req[1]); $lk_path = $GLOBALS['chants_path']."mp3/".$lk; $lk_im = $GLOBALS['chants_path']."spectro/".preg_replace("$.mp3$", ".jpg", $lk); $image = $GLOBALS['server_path'].$GLOBALS['site_path'].$lk_im; $mp3 = $GLOBALS['server_path'].$GLOBALS['site_path'].$lk_path; list($width, $height) = getimagesize($GLOBALS['chants_path_f'].'spectro'.$GLOBALS['slash'].preg_replace("$.mp3$", ".jpg", $lk)); $back = ''; if (isset($_SERVER['HTTP_REFERER'])) $back .= 'Retour - '; $back .= 'Accueil'; $back = '