Hello all. I have this code:
<?php
echo '
<br><br>
<center>
<table border="1" cellspacing="0" cellpadding="0" width="540">
<tr>
<th bgcolor="3a3a3a" align="center"><font face="Arial, Helvetica, sans-serif" size="2"> Název mapy </font></th>
<th bgcolor="3a3a3a" align="center"><font face="Arial, Helvetica, sans-serif" size="2"> Download </font></th>
<th bgcolor="3a3a3a" align="center"><font face="Arial, Helvetica, sans-serif" size="2"> Screenshot </font></th>
</tr>';
$file = fopen("T:/hns/cstrike/mapcycle.txt", "r");
while (($buffer = fgets($file, 4096)) != false)
{
if(file_exists("maps/".$buffer.".zip"))
$download = "<a href='http://www.traxxzone.cz/maps/".$buffer.".zip'>Download</a>";
else
$download = "---";
if(file_exists("maps/screenshots/".$buffer.".jpg"))
$screen = "<a href='http://www.traxxzone.cz/maps/screenshots/".$buffer.".jpg'>Screenshot</a>";
else
$screen = "---";
echo "<tr><th>".$buffer."</th><th>".$download."</th><th>".$screen."</th></tr>";
}
echo "</table></center>";
fclose($file);
?>
That should print out all maps listed in mapcycle.txt (counter-strike server) and if the mapname exists in maps/map_name.zip, then there is a download link. However it doesn't work as should. Map name is always true in first TH, no problems with that. However the link is all the time only on the last row (even if I change the map order in mapcycle.txt). Can anybody help me?
Edit: And for the screenshots, there aren't any now, so I can't check.