Commit 1fd9cc79 authored by Antoine Cellerier's avatar Antoine Cellerier

* put the mirror dir function in a different file than the pkgitem function

   since some pages define their own pkgitem functions
parent e9244597
<?php
function mirrordir($dir)
{ ?>
<li>Select a mirror :
<ul><li><a href="http://download.videolan.org/pub/videolan/<?php echo $dir ?>">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>';
}
?>
......@@ -34,27 +34,4 @@ 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 $dir ?>">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