1){
$artistes_liste = implode(', ', $albumartists);
}
else{
$artistes_liste = array_keys($albumartists)[0];
}
$nb_titres = count($filez);
$description = $artistes_liste . ' — ' . $nb_titres . ' track' . ($nb_titres > 1 ? 's' : '');
// Échappement des variables pour le HTML
$album_safe = htmlspecialchars($album.' - A Crem Road album', ENT_QUOTES, 'UTF-8');
$description_safe = htmlspecialchars($description, ENT_QUOTES, 'UTF-8');
$cover_http_url_safe = htmlspecialchars($cover_http_url, ENT_QUOTES, 'UTF-8');
// 3. Construction des balises OpenGraph
$html_og_oe = "\n";
$html_og_oe .= '' . "\n";
$html_og_oe .= '' . "\n";
$html_og_oe .= '' . "\n";
if (isset($covers[$album])){
$html_og_oe .= '' . "\n";
if ($img_width > 0 && $img_height > 0) {
$html_og_oe .= '' . "\n";
$html_og_oe .= '' . "\n";
}
}
// 4. Construction du lien OEmbed
// L'URL de la page actuelle (souvent passée dans le paramètre "url" du oembed)
$current_page_url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
// On passe l'identifiant de l'album en paramètre GET au endpoint oembed.json/index.php
$oembed_endpoint = 'https://' . $server_clean . '/oembed.json/index.php?album=' . urlencode($album) . '&url=' . urlencode($current_page_url);
$html_og_oe .= "\n\n";
$html_og_oe .= '' . "\n";
$html_twit = '
';
$output = $html_og_oe.$html_twit;
if ($output!=''){
file_put_contents('./sharerCaceh/'.str_replace('/', '_',base64_encode($album)).'.dat', $output);
}
return $output;
}
if (
$ForceWebchatAsHomepage &&
!isset($_SESSION['forceWebchat']) &&
!isset($_GET['artist']) &&
!isset($_GET['album']) &&
!isset($_GET['track']) &&
!isset($_GET['offset']) &&
!isset($_GET['autoplay']) &&
!isset($_GET['vid']) &&
!isset($_GET['twist']) &&
!isset($_GET['embed']) &&
!isset($_GET['body']) &&
!isset($_GET['target[]']) &&
!isset($_POST['overload_form']) &&
!isset($_POST['page_purge'])
)
{
header('Location: '.$proto.'://'.$server.'/webchat', true, 301);
exit(0);
}
//Whoever you are, you deserve a cleaning
//LOCKING
//By the way, let's remove old locks on callbacks ping recently played
if (array_key_exists('recently_callback_id' , $_SESSION)){
foreach (array_keys($_SESSION['recently_callback_id']) as $stamped){
if (floatval($_SESSION['recently_callback_id'][$stamped]['stamp'])+300microtime(true)){
unlink('./recently_ping.lock');
session_reset();
}
sleep(1);
}
touch ('./recently_ping.lock');
//LOCKED
$recentsjailed=Array();
if (file_exists('./d/recent.dat')){
$recentsjailed=unserialize(file_get_contents('./d/recent.dat'));
}
$recentsfinal=Array();
if ($recentjailed){
foreach ($recentsjailed as $recent){
if($recent['jailed']==false||(($recent['jailed']===true)&&(floatval($recent['date'])+90.0)>floatval(time()))){
array_push($recentsfinal, $recent);
}//if jailed && jailtime < 90 secondes OR not jailed
}
file_put_contents('./d/recent.dat', serialize($recentsfinal));
}
unlink('./recently_ping.lock');
//UNLOCKED
if (array_key_exists('void', $_GET)){
echo 'Initializing...';
throw new SystemExit();
}
function checkOverload ($apiResponse) {
if ($apiResponse===false){
echo '
Oooops... We are currently over capacity. Please try again later