$read_status = $remote->remote_readfile($mapfile, $map_array); // If file was found and read successfully then lets seperate the maps. if ($read_status == 1) { $map_array = preg_split("/\n/", $map_array); $maps_found = "FILE"; } else { $map_array = $read_status; } } // If we could not find maps from the maps file lets try directory listing // if possible. if ($maps_found === FALSE && $server_xml->maps_location) { // replace mod with the modname if nessessary. $map_path = $home_info['home_path'] . "/" . preg_replace("/mod/", $home_info['mods'][$mod_id]['mod_key'], $server_xml->maps_location); // Then we use the directory. $map_array = $remote->remote_dirlist($map_path); // If it is array then we successfully read maps. if (is_array($map_array)) { $map_array = cleanFilenames($map_array); $maps_found = "DIR"; } } $check_ok = TRUE; // If there is map list or location defined we should have maps available. if ($server_xml->map_list || $server_xml->maps_location) { if (is_array($map_array)) { echo "<tr><td class='right'>" . get_lang('available_maps') . ":</td><td class='left'>\n"; // We remove all lines that start with // because we // expect those lines to be comments. $comments = preg_grep("/^\\s*\\/\\//", $map_array); $map_array = array_diff($map_array, $comments);