Commit 7bf419af authored by Antoine Cellerier's avatar Antoine Cellerier

* add a function mirrordir($dir) adapted to listing mirrors when dealing

   with directories and not files
parent b3186b70
......@@ -34,4 +34,27 @@ function pkgitem($version,$name,$top)
}
echo '</ul></li>';
}
function mirrordir($dir)
{ ?>
<li>Select a mirror :
<ul><li><a href="http://download.videolan.org/pub/videolan/<?php echo $top."/".$version."/".$name; ?>">VIA, Ecole Centrale Paris (France)</a></li>
<?php
$file = $_SERVER["DOCUMENT_ROOT"]."/include/mirrors";
$file_id = fopen( $file , "r" );
$all = fread( $file_id, filesize( $file ) );
fclose( $file_id );
$mirrors = explode( "\n", $all );
array_pop($mirrors);
foreach( $mirrors as $mirror )
{
$esp = strpos( $mirror, " " );
$url = substr( $mirror, 0, $esp );
$mirror_name = substr( $mirror, $esp+1, strlen( $mirror ) - $esp -1 );
echo " <li><a href=\"http://www.videolan.org/mirror.html?mirror=$url&file=$dir/\">$mirror_name</a></li>\n ";
}
echo '</ul></li>';
}
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment