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
'; throw new SystemExit(); } } if ((filectime('./ypservices.lock')+intval(60))>time()){ unlink ('./ypservices.lock'); } if (array_key_exists('ypservices', $_GET)){ touch ('./ypservices.lock'); $ypindex=$_GET['ypservices']; if (!is_numeric($ypindex)){ throw new SystemExit(); } $ypindex=intval($ypindex); $arryp=array(); if (file_exists('./ypservices.dat')){ $ypfile=file_get_contents('./ypservices.dat'); $ypdata=unserialize($ypfile); $arryp=$ypdata; //Note that in the case of the file was not readable, //we will continue anyway, //and ypdata will be an FALSE boolean no longer an//empty array } if (count($creroypservices)>0){ //let's do some cleanup in the .dat record $barryp=array(); foreach ($creroypservices as $srv){ if (array_key_exists($srv, $arryp)) { $barryp[$srv]=$arryp[$srv]; } } $arryp=$barryp; $data=serialize($arryp); file_put_contents('./ypservices.dat', $data);//note that it can return false on failure and we won't handle such a thing. //Here comes the main stuff if (isset($creroypservices[$ypindex])){ $ypservice=$creroypservices[$ypindex]; $ypre=null; if (!is_array($arryp[$ypservice])) { $arryp[$ypservice]=array(); } if (array_key_exists('ping', $_GET)){//We only ping YP when homepage is displayed, not upon every call to the AJAX $ypre=file_get_contents(trim($ypservice).'?url='.urlencode('http://'.$server).'&name='.urlencode($sitename).'&description='.urlencode($description).'&forceHTTPS='.urlencode($YPForceHTTPS)); if (($ypre===false)){ $arryp[$ypservice]['hasFailed']=true; $arryp[$ypservice]['repliedFailureTime']=time(); } else {//we pinged since ypre is no longer null, and YP replied, since it is not false, so store the pong reply $yppong=explode (' ', $ypre); $arryp[$ypservice]['hasFailed']=false; $arryp[$ypservice]['repliedSuccessTime']=time(); $arryp[$ypservice]['pong']=array(); $arryp[$ypservice]['pong']=$yppong; } //we didn't ping'ed, but can continue //at this point is soon enough to save the .dat on disk, since we will only need read access from now $data=serialize($arryp); file_put_contents('./ypservices.dat', $data);//note that it can return false on failure and we won't handle such a thing. } //and now let's thing about our web browser waiting for data $yp_server_addr_no_proto = $ypservice; $yp_server_addr_no_proto = str_replace('https://', '', $yp_server_addr_no_proto); $yp_server_addr_no_proto = str_replace('http://', '', $yp_server_addr_no_proto); if (isset($arryp[$ypservice]['pong'])){//3 is enough for now and stricly necessary according to protocol RTFS specifications $pong_saved_status=boolval ($arryp[$ypservice]['pong'][0]=='0'); $pong_force_https=boolval (strtoupper($arryp[$ypservice]['pong'][1])=='HTTPS'); $pong_public=boolval (strtolower($arryp[$ypservice]['pong'][2])=='public'); } else {//lets use default value suitable in most cases $pong_saved_status=true;//never got a failure, never, before pong replies introduction $pong_force_https=false; if (!(strpos($ypservice, 'https://')===false)&&strpos($ypservice, 'https://')==0){ $pong_force_https=true;//if nothing more indicated, let's trust what have been entered by CreRo admins } $pong_public=true; } $ourproto='http://'; if ($pong_force_https){ $ourproto='https://'; } if($pong_public){ echo '['.$ourproto.str_replace('"','', $yp_server_addr_no_proto).'] ('; if (array_key_exists('hasFailed', $arryp[$ypservice])){ $yp_hasfailed=$arryp[$ypservice]['hasFailed']; } else $yp_hasfailed=null; if (array_key_exists('repliedFailureTime', $arryp[$ypservice])){ $yp_failuretime=$arryp[$ypservice]['repliedFailureTime']; } else $yp_failuretime=null; if (array_key_exists('repliedSuccessTime', $arryp[$ypservice])){ $yp_successtime=$arryp[$ypservice]['repliedSuccessTime']; } else $yp_successtime=null; if (!isset($yp_hasfailed)) echo 'Last ping success is unknown'; else if ($yp_failuretime>$yp_successtime){ echo 'Last ping has failled '; if (isset($yp_failuretime)){ echo ''.date(DATE_RSS, $yp_failuretime).' '; } else echo 'an unkown time ago.'; } if (isset($yp_successtime)){ echo 'Last ping success '.date(DATE_RSS, $yp_successtime).' '; if (!$pong_saved_status){ echo 'but the YP replied that its record was not updated'; } } else echo 'Last ping success is unknown '; echo ') '; } } else {//we finished, going bybye unlink ('./ypservices.lock'); throw new SystemExit(); } } //and now we're done, now we can go home unlink ('./ypservices.lock'); throw new SystemExit(); }//Ajax reply to ypservices get parameter if (isset($_GET['embed'])){ $embed=$_GET['embed']; //as a temporary measure, to comply with per-site cookies isolation introduced in modern mozilla //we disable download_cart //to allow download on embeding sites //awaiting for further dev. enabling it $enableDownloadCart=false; }else{$embed=false;} /********************************************************************** * IMPORTANT NOTICE ABOUT $embed * Embed can be of two types ! Either a String, or a Boolean * So never write of !!!!!! * Instead, write * * Otherwise, if the embed string contains the name of an artist who * has for name "0", it will evaluate as false * and will not embed properly * so a strict double check is necessary * firstly without strict type checking for normal name artists * secondary with an OR (||) with strict type checking * to be sure it's not strictly a boolean that has its value "false" * ********************************************************************/ //$sessionstarted=session_start(); header("Content-Type: text/html; charset=utf-8"); if (!array_key_exists('crero_uid', $_SESSION)){ $_SESSION['crero_uid']=microtime(true).'-'.random_int(1, 1000000); } ob_start(); if (!isset($_SESSION['origin'])){ $_SESSION['origin']=$_SERVER['HTTP_REFERER']; } srand(); if (isset($_SESSION['random'])&&$_SESSION['random']){ $_GET['twist']='random';//necessary if cache enabled } if (array_key_exists('noscript', $_GET)&&$_GET['noscript']=='footer'){ ?> '."\n"; } echo getHTMLSharer($clewnapiurl, $clewnaudiourl, $_GET['album'], $server); ?> <?php echo htmlspecialchars($sitename).' - '.htmlspecialchars($footerReadableName); ?> >
purgeCache(); echo 'Cache purged. Proceed'; throw new SystemExit(); } } if (isset($_POST['page_purge'])&&$activatehtmlcache){ $pseudoget=json_decode(base64_decode($_POST['page_purge']),true); $cachingkey='key:'; $get_keys=array_keys($pseudoget); foreach ($get_keys as $get_key){ if (in_array($get_key, $whitelist)){ $cachingkey.=$get_key."\n".$pseudoget[$get_key]; } } $myhtmlcache->purgePage($cachingkey); $redirect_proto='http'; if (isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']!==''){ $redirect_proto='https'; } $querystring='?'; $get_keys=array_keys($pseudoget); foreach ($get_keys as $get_key){ if (in_array($get_key, $whitelist)){ if ($get_key!='body'&&$get_key!='no-infinite-loop-please'){ $querystring=$querystring.$get_key.'='.urlencode($pseudoget[$get_key]).'&'; } } } if ($querystring=='?'){ $querystring=''; } header_remove(null); header("Location: ".$redirect_proto.'://'.$_SERVER['SERVER_NAME'].str_replace ('index.php', '', $_SERVER['PHP_SELF']).$querystring, true, 302); echo 'Cache page purgingThe page was purged from the cache.
Continue...'; throw new SystemExit(); } if (isset($_GET['getinfo'])){ echo file_get_contents($clewnapiurl.'?getinfo='.urlencode($_GET['getinfo'])); throw new SystemExit(); } //some last pre-caching thing //***************PRE CACHING THINGS*************************** //We want to store in the recent.dat //The album currenlty played (if any) //If the RecentPlay option has been desired //And the session started, just to keep many bots //Out of the log //And polite bots are not wished as well //thanks to them for being polite if (((array_key_exists('recently_callback', $_GET)&& array_key_exists('recently_callback_id', $_GET)) &&isset($_GET['album']) &&(((!array_key_exists('recently_callback_id', $_SESSION))||!array_key_exists($_GET['album'], $_SESSION['recently_callback_id']))&&$_SESSION['recently_callback_id'][$_GET['album']]['id']!=$_GET['recently_callback_id'])) &&!isset($_GET['listall'])&&$recentplay&&$sessionstarted ) { //LOCKING if (file_exists('./recently_ping.lock')&&(floatval(filectime('./recently_ping.lock'))+5.0) $_GET['recently_callback_id'], 'stamp' => microtime(true)); if (true){ if (count($recents)>=10000){//hey guys, let's store 1000 times more than we need, just to keep the jailed ones, unjail the legitimates upon validation, and with a certain incertainyty get 0.1% of our list that is valid visitors. $recents=array_slice($recents, 1, 9999); } array_push($recents, $recent); $dat=serialize($recents); if ($dat!==false){ file_put_contents('./d/recent.dat', $dat); } if ($activatechat&&array_key_exists('nick', $_SESSION)){ $data['long']=$_SESSION['long']; $data['lat']=$_SESSION['lat']; $data['nick']=$_SESSION['nick']; $data['range']=$_SESSION['range']; $data['message']=' is playing '.html_entity_decode($recent['album']).' *'; $data['color']=$_SESSION['color']; $dat=serialize($data); file_put_contents('./network/d/'.microtime(true).'.dat', $dat); } } } //by the way, it's time to delete jailed album in recently played //that haven't been validated within a minute and a half //just by keeping those jailed //since less than this period $recentsjailed=Array(); if (file_exists('./d/recent.dat')){ $recentsjailed=unserialize(file_get_contents('./d/recent.dat')); } $recentsfinal=Array(); 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('recently_callback', $_GET)){ throw new SystemExit(); } //*************PRE CACHING ENDS************** //* caching of htmlpage ; here we are if ($activatehtmlcache&&!isset($_POST['validateemail'])&&!isset($_GET['pingstat'])){ if ($_SERVER['HTTP_USER_AGENT']==''){ http_response_code(403); exit(0); } if ($myhtmlcache->hasPageExpired($cachingkey)){ $willhavetocache=true; } else { if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])){ if (strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= floatval($myhtmlcache->getCachedPageDate($cachingkey))){ header(null); session_abort(); header('HTTP/1.0 304 Not Modified'); throw new SystemExit(); } } header('Last-Modified: '.date(DATE_RFC822, $myhtmlcache->getCachedPageDate($cachingkey))); echo $myhtmlcache->getCachedPage($cachingkey); throw new SystemExit(); } } //caching of html page ; almost done. Just cache the output buffer once the page is fully generated. See end of this file $album_scores=Array(); if ($activatestats&&false) { //The scoring system for each album is no longer used due to refactoring of the stats module to make it usable with htmlcache $raw_scores=Array(); $scoredats=array_diff(scandir ('./admin/d/stats/'), Array ('.', '..', '.htaccess')); foreach ($scoredats as $score_dat){ $thisscoredat=unserialize(file_get_contents('./admin/d/stats/'.$score_dat)); if (strstr($thisscoredat['page'], '?')){ $scoretokens=explode('?', $thisscoredat['page']); $scoreuri=$scoretokens[1]; $scoregets=explode('&', $scoreuri); foreach ($scoregets as $scoreget){ $scorepair=explode('=', $scoreget); for ($dex=0;$dex0){ if($_GET['listall']=='albums') unset($_GET['listall']); $mosaic=false; } if (array_key_exists('listall', $_GET)&&$_GET['listall']!='albums'&&$_GET['listall']!='material'&&$_GET['listall']!='bogus'){ $mosaic=false; } if (isset($_GET['random'])&&$_GET['random']=='true'&&!isset($_GET['artist'])){ $_SESSION['random']=true; } else if (isset($_GET['random'])&&$_GET['random']=='false'){ $_SESSION['random']=false; } else if (isset($_GET['artist'])||isset($_GET['listall'])){ $_SESSION['random']=false; } if (isset($_GET['artist'])) { //$artist=$_GET['artist']; //$favicon='//'.$server.'/favicon.png'; $arturl='&artist='.urlencode($_GET['artist']); //$title=htmlspecialchars($_GET['artist']).' - A '.htmlspecialchars($sitename).' artist'; $artists_file=trim(file_get_contents('./d/artists.txt')); $artists=explode("\n", $artists_file); if (!in_array($_GET['artist'], $artists)&&(file_exists('./d/artists.txt')&&count($artists)>0)) { echo 'ooops... Invalid artist ! Browse the site, maybe?'; throw new SystemExit(); } } else { //$favicon='/favicon.png'; $arturl=''; $artist=''; } if (!isset($_GET['artist'])){ $artists_file=trim(file_get_contents('./d/artists.txt')); $artists=explode("\n", $artists_file); if (count($artists)==0) { $artists=explode("\n", trim(file_get_contents($clewnapiurl.'?listartists=true'))); } } else { $artists=Array($_GET['artist']); } $material_artists_file=htmlentities(trim(file_get_contents('./d/material_artists.txt')), ENT_COMPAT); $material_artists=explode("\n", $material_artists_file); $material_blacklist_file=htmlentities(trim(file_get_contents('./d/material_blacklist.txt')), ENT_COMPAT); $material_blacklist=explode("\n", $material_blacklist_file); if (isset($_GET['listall'])&&($_GET['listall']==='material'||($_GET['listall']==='mixed'&&isset($_GET['album'])))) { $artists=$material_artists; $material_currency=trim(file_get_contents('./d/material_currency.txt')); $material_paypal_address=trim(file_get_contents('./d/material_paypal_address.txt')); $material_shipping_file=trim(file_get_contents('./d/material_shipping.txt')); $material_shippings=explode("\n", $material_shipping_file); $material_shipping=Array(); $count=count($material_shippings); $i=0; while ($i < $count){ $material_shipping[$material_shippings[$i]]=$material_shippings[$i+1]; $i++; $i++; } $material_supports_file=trim(file_get_contents('./d/material_supports_and_prices.txt')); $material_supports=explode("\n", $material_supports_file); $material_support=Array(); $i=0; $count=count($material_supports); while ($i<$count){ $material_support[$material_supports[$i]]['description']=$material_supports[$i+1]; $material_support[$material_supports[$i]]['price']=$material_supports[$i+2]; $material_support[$material_supports[$i]]['options']=$material_supports[$i+3]; $i++; $i++; $i++; $i++; } } function featuredvids(){ } function cacheTracklist($album_entitified, $myserverapi) { if (!file_exists('./d/albums_track_counter.dat')){ file_put_contents('./d/albums_track_counter.dat', serialize(array())); } $data=unserialize(file_get_contents('./d/albums_track_counter.dat')); if ($data!==false){ $localfreshness=filectime('./d/albums_track_counter.dat'); $remotefreshness=file_get_contents($myserverapi.'?freshness=1'); if ($remotefreshness!==false){ if (floatval($localfreshness)>=floatval(trim($remotefreshness))){ if (array_key_exists($album_entitified, $data)){ return $data[$album_entitified]; } } } } /////NOT IN CACHE, QUERYING $remotedat=file_get_contents($myserverapi.'?gettracks='.urlencode($album_entitified)); if ($remotedat!==false){ $data=unserialize(file_get_contents('./d/albums_track_counter.dat')); if ($data!==false){ if (array_key_exists($album_entitified, $data)&&(strlen($data[$album_entitified])<=strlen($remotedat))){ $data[$album_entitified]=$remotedat; file_put_contents('./d/albums_track_counter.dat', serialize($data)); return $remotedat; } else if (array_key_exists($album_entitified, $data)){ return $data[$album_entitified]; } else if (!array_key_exists($album_entitified, $data)){ $data[$album_entitified]=$remotedat; file_put_contents('./d/albums_track_counter.dat', serialize($data)); return $remotedat; } else { return false; } } } return false; } function loginpanel($activateaccountcreation){ if (!$activateaccountcreation) { return; } /* if (isset($_SESSION['logged'])&&$_SESSION['logged']) { } else if (!isset($_GET['login'])&&!isset($_GET['createaccount'])&&!isset($_POST['validateemail'])){ // echo 'Login or Create account'; */ else if (!isset ($_POST['validateemail'])){ echo '
Let\'s make friends !
'; } else if (isset($_GET['createaccount'])) { echo 'ease enter a valid email adress. You will receive a link to set your password and activate your account.
'; echo '
Your email address :
'; } else if (isset ($_POST['validateemail'])&&file_exists('./d/mailing-list-owner.txt')) { $_POST['validateemail']=explode("\n",$_POST['validateemail'])[0]; $_POST['validateemail']=trim($_POST['validateemail']); $message ='Hello
'; $message.="\r\n".'Someone requested mailing list '; $message.="\r\n".'subscription using the email address
'.htmlentities($_POST['validateemail']); $message.="\r\n".''; $message=chunk_split($message); if ( mail(trim(file_get_contents('./d/mailing-list-owner.txt')), 'Mailing list subscription request', $message, 'Content-Type: text/html;charset=UTF-8') ){ echo 'A subscription request has been sent for the address '.htmlspecialchars($_POST['validateemail']).'. We will get in touch shortly to confirm. Close'; } else { echo 'The system has not been able to subscribe '.htmlspecialchars($_POST['validateemail']).'. Please try again later'; } } } function outputArtistSiteLink($artistHTML, $albumHTML, $ArtistSites){ $returnLink=''; if (is_array($ArtistSites)&&count($ArtistSites)>0&&array_key_exists(html_entity_decode($artistHTML), $ArtistSites)){ $returnlink='Also available on '.$artistHTML.' site'; } return $returnlink; } function generatevideo($track_name, $album, $track_artist, $videoapiurl, $videourl, $albumhasvid) { //let's see if there is a video available if ($videoapiurl===false||intval($albumhasvid)<=0){ return; } $videotarget=trim(file_get_contents($videoapiurl.'?artist='.urlencode($track_artist).'&album='.urlencode($album).'&title='.urlencode($track_name).'&gettarget=y')); $hasvideo=false; $haslyrics=false; if ($videotarget!==''){ $hasvideo=true; } //if has video and GET vid not set, dislplay video display link //if has lyrics display lyrics link if (($hasvideo || $haslyrics)){ echo '
'; if ($hasvideo&&!isset($_GET['vid'])){ echo 'Video available'; } echo '
'; } if ($hasvideo&&isset($_GET['vid'])&&isset($_GET['artist'])&&isset($_GET['album'])&&isset($_GET['track'])){ echo '
'; $videoformatsfile=trim(file_get_contents($videoapiurl.'?listformats='.urlencode($videotarget))); $videoformats=explode("\n",$videoformatsfile); $videotargetfiles=Array(); foreach ($videoformats as $videoformat){ $downgradefile=trim(file_get_contents($videoapiurl.'?hasdowngrade='.$videotarget.'&format='.$videoformat)); $downgradelist=explode("\n", $downgradefile); sort($downgradelist); if (count($downgradelist)>0) { $videotargetfiles[$videoformat]=$downgradelist[0].'.'.$videotarget.'.'.$videoformat; } else { $videotargetfiles[$videoformat]=$videotarget.'.'.$videoformat; } } echo ''; echo '
'; echo 'Download : '; foreach ($videoformats as $videoformat) { echo ''.htmlspecialchars($videoformat).' '; } echo '
'; echo htmlspecialchars(trim(file_get_contents($videourl.$videotarget.'.description.txt'))); echo '
'; } } function showsongsheet($track) { if (file_exists('./songbook/'.$track.'.txt')){ echo '
Lyrics/chords
'; echo ''; } } function displaycover($album, $ratio, $param='cover', $AlbumsToBeHighlighted = 0, $highlightcounter = 0){ if (file_exists('./d/covers.txt')){ if ($highlightcounter<$AlbumsToBeHighlighted){ $ratio=$ratio*2; } $coversfile=trim(file_get_contents('./d/covers.txt')); $coverslines=explode("\n", $coversfile); $i=0; $url=null; while ($i'; /*$output.=''; */ $output.='
'.str_replace(" ", ' ', $album).'
'; return $output; } else {//if (!get_page_init()){init_page()};gogetit();if (this.src.endsWith(\'favicon.png\')){increment_thumbnail_max();};if (this.src.endsWith(\'favicon.png\')){ return ' '.$album.'
'.str_replace(" ", '
', $album).'
'; } } else{ return ' '.$album.'
'.str_replace(" ", '
', $album).'
'; } } $albumhasvid=null; function checkalbhasvid($alb, $videoapiurl){ if (filter_var($videoapiurl, FILTER_VALIDATE_URL)){ $cont = file_get_contents($videoapiurl.'?hasalbum='.urlencode($alb)); return (intval(trim($cont))); } else { return 0; } } if (!(array_key_exists('body', $_GET)&&$_GET['body']=='ajax')) { ?> '."\n"; } echo getHTMLSharer($clewnapiurl, $clewnaudiourl, $_GET['album'], $server); ?> <?php echo htmlspecialchars($sitename.' - '.strip_tags($title)); ?> Random videos
Browse videos';} ?>

-
Initializing... - 🔈 + ⏯ ⏴| |⏵
Nothing playing
In your download cart: items
'; echo ''; if (file_exists('./splash.php')){ include ('./splash.php'); } echo ''; echo ''; if (isset ($_GET['message'])&&isset($message[$_GET['message']])){ echo '
'.$message[$_GET['message']].'X
'; } echo ''; if (count($socialmediaicons)>0){ //let's display the social media icons echo '
Various stuff: '; foreach ($socialmediaicons as $socialicon){ echo ''; echo str_replace(' ', ' ', htmlspecialchars($socialicon['letter'])); echo ' '; } echo '
'; } echo '
'; echo ''; echo ''; if ($hasradio){ echo '
Now on the radio:
'; echo 'Initializing...'; echo ''; echo '
'; } echo '
'; ?>

Recently played?


Home > '.htmlspecialchars($_GET['track']).' on '.htmlspecialchars($_GET['album']).'
'; } else if (isset ($_GET['artist'])) { echo 'Home > '.htmlspecialchars($_GET['artist']).'
'; } ?>
Material releases

What we offer :

'; echo 'All prices are indicated in '.htmlspecialchars($material_currency); echo '
This is the '; if ($ismaterialnameyourprice){ echo 'recommended'; } else{ echo 'minimum'; } echo ' price. You name you price, actually, and you can pay more'; if ($ismaterialnameyourprice){ echo ' or less'; } echo ' than this if you wish to.
'; $material_items=array_keys($material_support); echo ''; echo ''; $material_item_lines=array_keys($material_support[$material_items[0]]); foreach ($material_item_lines as $material_item_line) { echo ''; } echo ''; foreach ($material_items as $material_item) { echo ''; echo ''; $material_item_lines=array_keys($material_support[$material_item]); foreach ($material_item_lines as $material_item_line) { echo ''; } echo ''; } echo '
Product'.htmlspecialchars($material_item_line).'
'.htmlspecialchars($material_item).''; if (isset($material_support[$material_item][$material_item_line])&&$material_support[$material_item][$material_item_line]!==''){ echo htmlspecialchars($material_support[$material_item][$material_item_line]); } echo '
'; } echo '
'; } }//************************************************IF NOT EMBED ENDS $weactuallydisplayedsomething=false; //here we are, let's query apis to fill the content arrays $supported_formats_remote=explode("\n", file_get_contents($clewnapiurl.'?listformats=true')); $supported_formats_local=explode("\n", file_get_contents($serverapi.'?listformats=true')); $content=Array(); $querystring = ''; $artists_file=file_get_contents('./d/artists.txt'); $artists=explode("\n", trim($artists_file)); if (!file_exists('./d/artists.txt')||count($artists)==0) { $artists=explode("\n", trim(html_entity_decode(file_get_contents($clewnapiurl.'?listartists=true'), ENT_COMPAT | ENT_HTML401 ))); } if (isset($_GET['artist'])) { $artists=array(($_GET['artist'])); } $querystring=''; foreach ($artists as $artist) { $querystring.='l2[]='.urlencode($artist).'&'; } $timeout=18; if (file_exists('./overload.dat')){ $timeout=intval(file_get_contents('./overload.dat')); } else { file_put_contents('./overload.dat', '18'); } //$opts = array( // 'http'=>array( // 'timeout'=>$timeout //) //); $overloadmove=$timeout+2; //$albums_file=file_get_contents($clewnapiurl.'?'.$querystring, false, stream_context_create($opts)); $fresh=file_get_contents($clewnapiurl.'?freshness=true'); if ($fresh!==false){ $fresh=floatval($fresh); if (floatval($fresh)>=floatval(filemtime('./remoteapicache-v2.dat'))){ unlink('./remoteapicache-v2.dat'); } } $cache_dl_count=file_get_contents($server.'/gimme_dl_album_count.php'); if ($cache_dl_count===false){ unlink('./remoteapicache-v2.dat'); } else { $remoteapicache=unserialize(file_get_contents('./remoteapicache-v2.dat')); if (isset($remoteapicache[$querystring])){ $albums_file=$remoteapicache[$querystring]; $albums=json_decode($albums_file, true); if (!is_array($albums)){$albums=Array();} if (count($albums)!=intval($cache_dl_count)){ unlink('./remoteapicache-v2.dat'); } } } if (!file_exists('./remoteapicache-v2.dat')){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$clewnapiurl.'?l2=true'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $querystring); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,$timeout); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $albums_file_json= curl_exec ($ch); curl_close ($ch); $albums_file=$albums_file_json; if ($albums_file_json===false){ echo '

Sorry ! It seems that the free albums host, is currently over capacity.

That is why this page took so long to load, and free albums will not display. '; //20221130 : Autorepair of media tier overcapacity ?> An attempt to repair the broken page may be attempted soon. If not, your can try to refresh this page. Deeply sorry ! It seems that the host of the free albums, is currently over capacity.That is why this page took so long to load, and free albums will not display.'; } } $overloadmove=$timeout-2; if ($overloadmove<=0){ $overloadmove=18; } file_put_contents('./overload.dat', $overloadmove); $albums=json_decode($albums_file, true); if (!is_array($albums)){$albums=Array();} ksort($albums); $albums=array_reverse($albums); $content=$albums; //let's query the local storage $querystring = ''; foreach ($artists as $artist) { $querystring.='l2[]='.urlencode($artist).'&'; } $albums_file=file_get_contents($serverapi.'?'.$querystring); //****************************NEEDS WORK /* $timeout=300; if (file_exists('./loverload.dat')){ //$timeout=intval(file_get_contents('./loverload.dat')); } else { file_put_contents('./loverload.dat', '180'); } //$opts = array( // 'http'=>array( // 'timeout'=>$timeout //) //); $overloadmove=$timeout+2; //$albums_file=file_get_contents($clewnapiurl.'?'.$querystring, false, stream_context_create($opts)); $fresh=file_get_contents($serverapi.'?freshness=true'); if ($fresh!==false){ $fresh=floatval($fresh); if (floatval($fresh)>=floatval(filemtime('./lremoteapicache-v2.dat'))){ unlink('./lremoteapicache-v2.dat'); } } /*$cache_dl_count=file_get_contents($server.'/gimme_str_album_count.php'); if ($cache_dl_count===false){ unlink('./lremoteapicache-v2.dat'); } else {*/ /* $remoteapicache=unserialize(file_get_contents('./lremoteapicache-v2.dat')); if (isset($remoteapicache[$querystring])){ $albums_file=$remoteapicache[$querystring]; $albums=json_decode($albums_file, true); if (!is_array($albums)){$albums=Array();} //if ($albums===false||count($albums)!=intval($cache_dl_count)){ // unlink('./lremoteapicache-v2.dat'); //} //} } if (!file_exists('./lremoteapicache-v2.dat')){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$serverapi.'?l2=true'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $querystring); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,$timeout); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $albums_file_json= curl_exec ($ch); curl_close ($ch); $albums_file=$albums_file_json; if ($albums_file_json===false){ echo '

Sorry ! It seems that the streaming albums host, is currently over capacity.

That is why this page took so long to load, and streaming albums will not display. '; //20221130 : Autorepair of media tier overcapacity ?> An attempt to repair the broken page may be attempted soon. If not, your can try to refresh this page. Deeply sorry ! It seems that the host of the streaming albums, is currently over capacity.That is why this page took so long to load, and streaming albums will not display.'; ?> An attempt to repair the broken page may be attempted soon. If not, your can try to refresh this page.
An error was encountered, due to overcapacity.
Dig newer...
';; } } else { $offset=0; if (array_key_exists('artist', $_GET)){ $_GET['offset']=0; } } if ($_SESSION['random']){ echo 'Skip this album'; } $counter=1; $secondcounter=0; if ($_SESSION['random']&&!isset($_GET['artist'])){ echo ' Stop random'; } else if (!isset($_GET['artist'])&&!$material) { //echo 'random play'; //Regression bug, random not working anymore, has to be disabled } if ($mosaic) { echo '
'; } //the main block of artists if enabled $flipcoin=true; $boolflipcoin=false; /// echo ''; if ($mosaic&&$artisthighlighthomepage){ $flipcoin=true; echo ''; $nobr=true; echo ''; foreach ($hlartists as $hlart){ echo ''; if (!$nobr) { echo ''; $nobr=true; } else { $nobr=false; } } echo '
'; //echo ''..'
'; echo ''; echo htmlspecialchars($hlart['name']); echo '
'; echo '
'; echo ''.htmlspecialchars($hlart['styles']).''; echo '
'; echo ''.htmlspecialchars($hlart['infos']).''; echo '
'; echo '
'; } /// echo '
'; $highlightcounter=0; //local ***** foreach ($contentlocal as $item){ $ran=false; if ($counter>$offset && $secondcounter==0 || isset($_GET['listall'])) { $running=true; if ((isset($_GET['album'])&&$_GET['album']!=html_entity_decode($item['album']))||(isset($_GET['listall'])&&$_GET['listall']==='material')) { $running=false; } if (isset ($item['album'])&&$running){ if((isset($_GET['album'])||isset($_GET['offset']))&&$albumhasvid==null){ $albumhasvid = checkalbhasvid(html_entity_decode($item['album']), $videoapiurl); } $weactuallydisplayedsomething=true; $ran=true; if (!isset($_GET['listall'])&&!$mosaic&&isset($_SESSION['nick'])){ echo '

Album : '; } else if (!$mosaic){ echo '

'; } if (!$mosaic) { if (!((true==$embed)||(false!==$embed))){ echo ''; } echo $item['album']; if (!((true==$embed)||(false!==$embed))){ echo ''; } echo '

'; if (array_key_exists('track', $_GET)){ echo '

Track: '.htmlspecialchars($_GET['track']).'

'; } echo '
'.displaycover($item['album'], 0.65).'
'; } else { if ($activatestats&&false){ //the album score is no longer used due to refactoring of stats to make them compatible with HTMLcache if (isset($album_scores[$item['album']])){ $thisalbumscore=intval($album_scores[$item['album']])+100; } else { $thisalbumscore=0; } } else { $thisalbumscore=177; } $displaythatcover=true; if (file_exists('./d/covers.txt')){ $coversfile=trim(file_get_contents('./d/covers.txt')); $coverslines=explode("\n", $coversfile); if (!in_array(html_entity_decode($item['album'], ENT_COMPAT | ENT_HTML401 ), $coverslines)){ $displaythatcover=false; } } echo ''; if ($mixed){ echo ''; } else { echo ''; } echo displaycover($item['album'], $streaming_albums_ratio, 'cover', $AlbumsToBeHighlighted, $highlightcounter); $highlightcounter++; } if ($mixed||!isset($_GET['listall'])){ if (!$mixed){ if (isset($streamingAlbumsInfoHeader[$item['album']])){ echo '
'; echo $streamingAlbumsInfoHeader[$item['album']]; echo '
'; } echo '
Controls / tracklisting
'; } else { echo ''; } //here we go, query local API for track list $tracks_file=cacheTracklist($item['album'],$serverapi);//.'?gettracks='.urlencode($item['album'])); if ($tracks_file===false){ $tracks_file=array(); } $tracks=explode("\n", $tracks_file); $trackcounter=0; $hasntautoplayed=true; $track_artist=''; $weactuallydisplayedatrack=false; $eachtrackwasdisplayedok=true; foreach ($tracks as $track) { if ($track!==''){ $weactuallydisplayedatrack=true; //we want its name and the artist name as well $track_name=trim(file_get_contents($serverapi.'?gettitle='.urlencode($track))); $track_artist=trim(file_get_contents($serverapi.'?getartist='.urlencode($track))); if ($track_name==''||(!((true==$embed)||(false!==$embed)))&&$track_artist==''){ $eachtrackwasdisplayedok=false; } if (!isset($_GET['track'])||$_GET['track']==html_entity_decode($track_name)) { if (in_array(html_entity_decode($track_artist), $artists)){ ?> *
', , false));" id="">▶ '; ?> - '; //echo ''; } echo $track_name; if (!((true==$embed)||(false!==$embed))) { echo ''; } ?>
Early access download not available for now
', , false, true));" > '; ?>
An error was encountered, due to overcapacity.
'; } } } if ($ran) { $secondcounter++; } $counter++; } //remote **** //material header if($material) { if (!$mixed) { echo '

Order form

Please indicate your shipping option, then select your desired items in the list below. Once you are done, please click on the payment button that is repeated below each release
'; } echo 'Shipping option : '; if (!$mixed) { echo '

Albums available as physical releases :

';} else {echo '
';} $itemid=0; } $animindex=0; foreach ($content as $item){ $ran=false; if ($counter>$offset && $secondcounter==0||isset($_GET['listall'])) { $running=true; if (isset($_GET['album'])&&$_GET['album']!=html_entity_decode($item['album'])) { $running=false; } if (!(in_array($item['artist'], $material_artists)&&!in_array($item['album'], $material_blacklist))&&(isset($_GET['listall'])&&$_GET['listall']==='material')) { $running=false; } if (isset ($item['album'])&&$running){ if((isset($_GET['album'])||isset($_GET['offset']))&&$albumhasvid==null){ $albumhasvid = checkalbhasvid(html_entity_decode($item['album']), $videoapiurl); } $weactuallydisplayedsomething=true; $ran=true; $float=true; if (!$mosaic) { if (!((true==$embed)||(false!==$embed))){ echo ''; } echo '

'.$item['album'].'

'; if (array_key_exists('track', $_GET)){ echo '

Track: '.htmlspecialchars($_GET['track']).'

'; } if (!((true==$embed)||(false!==$embed))){ echo '
'; } echo '
'.displaycover($item['album'], 0.65).'
'; if ($mixed){ echo '
'; echo '
'; } } else { $animindex++; if ($activatestats&&false){ //the album scores are no longer used due to refactoring of stats to make them usable with htmlcache if (isset($album_scores[$item['album']])){ $thisalbumscore=intval($album_scores[$item['album']])+100; } else { $thisalbumscore=0; } } else { $thisalbumscore=177; } $displaythatcover=true; if (file_exists('./d/covers.txt')){ $coversfile=trim(file_get_contents('./d/covers.txt')); $coverslines=explode("\n", $coversfile); if (!in_array(html_entity_decode($item['album'], ENT_COMPAT | ENT_HTML401 ), $coverslines)){ $displaythatcover=false; } } echo ''; echo ''; echo ''; echo displaycover($item['album'], 0.1, 'cover', $AlbumsToBeHighlighted, $highlightcounter); $highlightcounter++; } //material order form if ($material) { $material_items=array_keys($material_support); echo ''; foreach ($material_items as $material_item) { echo ''; } echo ''; echo '
'.htmlspecialchars($material_item).'
quantity : '; echo ''; ?> '; echo ''; $i=1; while ($i<=50) { echo ''; $i++; } echo ''; $itemid++; if (isset($material_support[$material_item]['options'])&&$material_support[$material_item]['options']!=''){ ?> '; foreach ($options as $option) { if (!$optionheader) { echo htmlspecialchars($option); echo ''; $itemid++; } echo '
'; echo ''; } if (in_array($item['artist'], $material_artists)&&!in_array($item['album'], $material_blacklist)&&!$material&&!$mosaic){ echo 'available on material support at our
physical releases shop
'; } if ($mixed||!isset($_GET['listall'])){ if (!$mixed){ if (isset($albumsForDownloadInfoNotice[$item['album']])){ echo '
'; echo $albumsForDownloadInfoNotice[$item['album']]; echo '
'; } if ($enableDownloadCart) { echo ''; echo 'Download full album
'; } echo '
Controls / tracklisting
'; } else { echo ''; } if ($enableDownloadCart) { if (!isset($_SESSION['album_tracklisting'])) { $_SESSION['album_tracklisting']=array(); } $_SESSION['album_tracklisting'][$item['album']]=array(); } //here we go, query Clewn API for track list //$tracks_file=file_get_contents($clewnapiurl.'?gettracks='.urlencode($item['album'])); $tracks_file=cacheTracklist($item['album'],$clewnapiurl);//.'?gettracks='.urlencode($item['album'])); if ($tracks_file===false){ $tracks_file="\n"; } $tracks=explode("\n", $tracks_file); $trackcounter=0; $hasntautoplayed=true; $track_artist=''; $weactuallydisplayedatrack=false; $eachtrackwasdisplayedok=true; foreach ($tracks as $track) { if ($track!==''){ $weactuallydisplayedatrack=true; //we want its name and the artist name as well $track_name=trim(file_get_contents($clewnapiurl.'?gettitle='.urlencode($track))); $track_artist=trim(file_get_contents($clewnapiurl.'?getartist='.urlencode($track))); if ($track_name==''||((!((true==$embed)||(false!==$embed)))&&$track_artist=='')){ $eachtrackwasdisplayedok=false; } if ($enableDownloadCart&&in_array(html_entity_decode($track_artist), $artists)) { $mypair=array(); $mypair['title']=$track_name; $mypair['file_basename']=$track; array_push($_SESSION['album_tracklisting'][$item['album']],$mypair ); } if (!isset($_GET['track'])||$_GET['track']==html_entity_decode($track_name)) { if (in_array(html_entity_decode($track_artist), $artists)){ ?> * ', , true));" id="">▶ '; ?> - '; //echo ''; } echo $track_name; ?> '; } ?>
Download ['.htmlspecialchars($mat); ?>] '; } if ($hasntautoplayed){ ?> ', , true, true));" > '; ?>
An error was encountered, due to overcapacity.
'; echo '
'; ?>

Tip download : Name your price and get instant download access to in available formats " />
I want to pay or get it for free

Item details :

'; echo 'All prices are indicated in '.htmlspecialchars($material_currency); echo '
This is the '; if ($ismaterialnameyourprice){ echo 'recommended'; } else{ echo 'minimum'; } echo ' price. You name you price, actually, and you can pay more'; if ($ismaterialnameyourprice){ echo ' or less'; } echo ' than this if you wish to.
';$material_items=array_keys($material_support); echo ''; echo ''; $material_item_lines=array_keys($material_support[$material_items[0]]); foreach ($material_item_lines as $material_item_line) { echo ''; } echo ''; foreach ($material_items as $material_item) { echo ''; echo ''; $material_item_lines=array_keys($material_support[$material_item]); foreach ($material_item_lines as $material_item_line) { echo ''; } echo ''; } echo '
Product'.htmlspecialchars($material_item_line).'
'.htmlspecialchars($material_item).''; if (isset($material_support[$material_item][$material_item_line])&&$material_support[$material_item][$material_item_line]!==''){ echo htmlspecialchars($material_support[$material_item][$material_item_line]); } echo '
'; } } if ($mosaic) { echo '
'; } } } if ($ran) { $secondcounter++; } $counter++; }//foreach $content if (!isset($_GET['listall'])&&isset($_GET['album'])&&file_exists('./album_sleeve.php')){ require_once ('./album_sleeve.php'); } if (!$_SESSION['random']&&$weactuallydisplayedsomething&&!isset($_GET['listall'])){ $autourl=''; if (false&&isset($_GET['autoplay'])&&boolval($_GET['autoplay'])){//this case is managed by some other code place $autourl='&autoplay=true'; } if (!isset($_GET['target_album'])){ $embedurl=''; if (((true==$embed)||(false!==$embed))) { $embedurl='&embed='.urlencode($embed); } /* Dig older...
'; } else { //Never used echo 'Dig more...
'; } } if (!$weactuallydisplayedsomething){ /**** * * if (document.getElementById('infiniteloop')!=null){ if (document.getElementById('bodyajax_arttruc').value!=''){ set_artist(document.getElementById('bodyajax_arttruc').value); } page_init=true; document.getElementById('infiniteloop').click(); **********************************************************/ unset($_GET['album']); unset($_GET['artist']); unset($_GET['offset']); $_GET['listall']='failed'; echo ' Yeah! You reached the bottom... There is nothing older...Continuing to newer
'; } echo '
'; if($material) { echo '
'; echo $materialreleasessalesagreement.'
'; } if ($mosaic) { echo '
'; } if (!((true==$embed)||(false!==$embed))){// IF NOT EMBED STARTS ************************************************** echo $pageFooterSplash; ?> '; }?> The Great Random Player'; }?> General podcast (click to copy to clipboard)'; echo '
  • '; echo 'Artist podcasts: (click to copy to clipboard)'; foreach ($artists as $a){ echo '['.str_replace(" ", " ", htmlspecialchars($a)).'] '; } echo '
  • '; }?> '; }?>
    ';}">