Hello every one,
I've just updated from 2.12 to 2.13.
I have a page i've wrote in the code module to display the images in 4 folders but after the update it doesn't work anny more.
does somone know what is wrong?
below is my code:
$map4 = "../../modules/sponsors/sponsors4/";
$map3 = "../../modules/sponsors/sponsors3/";
$map2 = "../../modules/sponsors/sponsors2/";
$map1 = "../../modules/sponsors/sponsors1/";
$bestanden4 = scandir($map4);
$bestanden3 = scandir($map3);
$bestanden2 = scandir($map2);
$bestanden1 = scandir($map1);
echo "<div style=\"text-align: center;\">";
foreach ($bestanden4 as $foto){
echo 'test';
if (substr($foto, -4)=='.jpg'|| substr($foto, -5)=='.jpeg' || substr($foto, -4)=='.JPG' || substr($foto, -4)=='.png'){
$info = pathinfo($foto);
$filename = basename($foto,'.'.$info['extension']);
if (file_exists("$map4/$filename.txt")){
$file = fopen("$map4/$filename.txt","r");
$website = fgets($file);
echo "\n <a href='$website' target='_blank'><img src=\"$map4/$foto\" alt=\"\" style=\"width: 220px; margin: 20px;\"/></a>";
fclose($file);
}
else{
echo "\n <img src=\"$map4/$foto\" alt=\"\" style=\"width: 220px; margin: 20px;\"/>";
}
}
}
foreach ($bestanden3 as $foto){
if (substr($foto, -4)=='.jpg'|| substr($foto, -5)=='.jpeg' || substr($foto, -4)=='.JPG' || substr($foto, -4)=='.png'){
$info = pathinfo($foto);
$filename = basename($foto,'.'.$info['extension']);
if (file_exists("$map3/$filename.txt")){
$file = fopen("$map3/$filename.txt","r");
$website = fgets($file);
echo "\n <a href='$website' target='_blank'><img src=\"$map3/$foto\" alt=\"\" style=\"width: 220px; margin: 20px;\"/></a>";
fclose($file);
}
else{
echo "\n <img src=\"$map3/$foto\" alt=\"\" style=\"width: 220px; margin: 20px;\"/>";
}
}
}
foreach ($bestanden2 as $foto){
if (substr($foto, -4)=='.jpg'|| substr($foto, -5)=='.jpeg' || substr($foto, -4)=='.JPG' || substr($foto, -4)=='.png'){
$info = pathinfo($foto);
$filename = basename($foto,'.'.$info['extension']);
if (file_exists("$map2/$filename.txt")){
$file = fopen("$map2/$filename.txt","r");
$website = fgets($file);
echo "\n <a href='$website' target='_blank'><img src=\"$map2/$foto\" alt=\"\" style=\"width: 220px; margin: 20px;\"/></a>";
fclose($file);
}
else{
echo "\n <img src=\"$map2/$foto\" alt=\"\" style=\"width: 220px; margin: 20px;\"/>";
}
}
}
foreach ($bestanden1 as $foto){
if (substr($foto, -4)=='.jpg'|| substr($foto, -5)=='.jpeg' || substr($foto, -4)=='.JPG' || substr($foto, -4)=='.png'){
$info = pathinfo($foto);
$filename = basename($foto,'.'.$info['extension']);
if (file_exists("$map1/$filename.txt")){
$file = fopen("$map1/$filename.txt","r");
$website = fgets($file);
echo "\n <a href='$website' target='_blank'><img src=\"$map1/$foto\" alt=\"\" style=\"width: 220px; margin: 20px;\"/></a>";
fclose($file);
}
else{
echo "\n <img src=\"$map1/$foto\" alt=\"\" style=\"width: 220px; margin: 20px;\"/>";
}
}
}
echo "</div>";
thanks in advance,
Maarten