getMainSiteLogos(true,true);
function getMainSiteLogos($download=false,$echo=false)
{
global $g_mainsite,$g_logospath,$g_listfile,$g_remotelistfile;
$result = array();
if($download)
{
$list = file_get_contents("$g_remotelistfile");
file_put_contents($g_listfile,$list);
chmod($g_listfile,0777);
}
if(!file_exists($g_listfile))
{
return $result;
}
$handle = fopen($g_listfile,"r");
while(!feof($handle))
{
$ins = trim(fgets($handle,4096));
if($ins!="")
{
$row = explode(";",$ins);
array_push($result,$row);
}
}
fclose($handle);
if($download)
{
for($i=0;$i\n";
}
$data = file_get_contents("$g_mainsite/$path");
$pathinfo = pathinfo($path);
$filename = $pathinfo["basename"];
if($echo)
{
echo "Storing $g_logospath/$filename
\n";
}
file_put_contents("$g_logospath/$filename",$data);
chmod("$g_logospath/$filename",0777);
}
}
return $result;
}
?>