Location: PHPKode > projects > MyOWNSpace > MyOWNspace_v8.2/www/myowncharts.php
<?php
/// VŽrifie id


include "config.php";
$page="";
$playlisttags = array ('title', 'annotation', 'creator', 'info', 'location', 'license');
$tracktags = array('file', 'date', 'playlist');
$tracktags1 = array('location', 'creator', 'image','info','album','title','annotation');
$track=array();
$id=array();
$a=array();
$myoldmp3top = array();
$date=date("W-Y");
$filename = 'myownmp3/statistics'.$date.'.txt';

$content = '';

if(file_exists($filename)&&filesize($filename)!=0){
if ($f = @fopen($filename, 'r')) { //lecture du fichier
//echo "reading".$i."...<br>";
			while (!feof($f)) {
				$content .= fgets($f, 4096);
			}
			fclose($f);
			// Parse PLAYLIST info
}
$content=explode("\n", $content);

}
for($i=0;$i<=count($content);$i++){
//echo $track[$i];
$a = explode(",", $content[$i]);
$track[$i]=$a[0];
if($a[1]!=''&&intval($a[1])!=0) $id[$i]=$a[1];
}

//print_r($track);
//print_r($id);
// Mise à jour du alltime hits
$rand_keys2 = array_count_values ($id);

arsort ($rand_keys2);
include "myownmp3/statisticsALLTIME.php";
arsort ($myownmp3top,SORT_NUMERIC);
$ALLTIMEBEST="<center><div class=\"big_offer_title\"><img src=\"images/small_arr.jpg\" height=\"9\" width=\"9\"> MyOwnSpace All Times 50!</div><br><table width=450 NOSPAN><tr>";
$output = 1;
$row=0;
foreach ($myownmp3top as $key => $val)
{ 

if ($output>51)break;
if ($row>=3) {$row=1;$ALLTIMEBEST.='</tr><tr>';}
else $row++;
//$ALLTIMEBEST.= '<td valign=top align=right><font style="font-size:80px;color:red;font-decoration:bold;">'.$output.'</font><td>';
$ALLTIMEBEST.='<td width="50" valign="top" nowrap><a href="/'.$key.'"><img src="'.$myspace[$key]['image'].'" border=0 height=80><br><b>'.$myspace[$key]['artiste']."</a> <small>($val hits)</small><br>".$myspace[$key]['titre']."<br><br><br></td> \n";
$output++;
}
$ALLTIMEBEST.="</tr></table></center>";


//classement des MP3
$rand_keys = array_count_values ($track);
arsort ($rand_keys);
/*
foreach ($rand_keys as $key => $val) {
   if($key!='') echo "<b>$val</b> / $key<br>";
}*/
//classement hebdomadaire des id
$face="/images/unknown.gif";
$i=0;
echo '<center><br><div class="big_offer_title"><img src="images/small_arr.jpg" height="9" width="9"> MyOwnSpace Weekly TOP 10 Underground Artists</div><br>';
foreach ($rand_keys2 as $key => $val) {
$i++;
if($myspace[$key][image]==""||$myspace[$key][image]=="http://") $myspace[$key][image]=$face;
   if($key!=''&&$i<=10) echo '<div style="text-align:left;width:350px"><font style="font-size:80px;color:red;background-color:white">'.$i.'</font><a href="/'.$key.'"><img border=0 src="'.$myspace[$key][image].'" height=80><br><b><img border="0" src="http://myownspace.fr/images/red_arr.jpg">&nbsp;'.$myspace[$key][artiste].'</a> ('.$val.')</b></div><hr>';
}

echo "</center>";
/////
echo $ALLTIMEBEST;
/*
$XSPF='<playlist version="1">';
$XSPF.= '
<title>MyOWNSPACE random playlist</title>
  <annotation>Self Generated Random Playlist of MyOwnSpace MUSIC</annotation>
  <creator>MyOWNSpace</creator>
  <info>http://myownspace.fr</info>
  <location>http://myownspace.fr/random.php</location>
  <license>nopyright</license>
<trackList>   
';
for($j=0;$j<=10;$j++){
$trackdata="";
foreach($tracktags as $tags)
			{
			    
				if($track[$rand_keys[$j]][location]!=""&&$track[$rand_keys[$j]][location]!="http://webjay.org/audio/webjay44.mp3") {
				$trackdata.= "<".$tags.">".$track[$rand_keys[$j]][$tags]."</".$tags.">
				";
				
				}
			}
if($track!="") $XSPF.= '<track>
'.$trackdata.'</track>
';
//print $track[$rand_keys[$j]][location]."\n";

}
$XSPF.= '  </trackList>
</playlist>';
$filename='myownmp3/random.xml';
//writeTXT($filename,$XSPF); 
//header('Content-type: application/xml');
//echo $XSPF;
*/
?>
Return current item: MyOWNSpace