Location: PHPKode > projects > MyOWNSpace > MyOWNspace_v8.2/www/maj.php
<?
include "login.inc.php";
include "config.php";
//MISE A JOUR ALLTIME HITS   
$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();
//$olddate=date("(W-1)-Y");
$oldfile = 'myownmp3/statistics46-2006.txt';

$content = '';

if(file_exists($oldfile)&&filesize($oldfile)!=0){
if ($f = @fopen($oldfile, '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);

$topfile="myownmp3/statisticsALLTIME.php";
$top='<? $myownmp3top=array(';
for($i=1;$i<=count($myspace);$i++){
$count=0;
foreach ($rand_keys2 as $key => $val) {

   if($key==$i) {
   $count++;
   $myownmp3top[$i]=$val;
   }
   }
   if($count>0) $top.='"'.$i.'"=>"'.($val+$myownmp3top[$i]).'",
   ';
   else $top.='"'.$i.'"=>"'.$myownmp3top[$i].'",
   ';
   }
   $top.='); ?>';
//sauvegarde
writeTXT($topfile,$top);
print_r ($myownmp3top);
?>
Return current item: MyOWNSpace