diff --git a/scripts/species_tools.php b/scripts/species_tools.php index 3d9c216..b59296a 100644 --- a/scripts/species_tools.php +++ b/scripts/species_tools.php @@ -48,8 +48,8 @@ foreach ([$confirm_file, $exclude_file, $whitelist_file] as $file) { } $confirmed_species = file_exists($confirm_file) ? file($confirm_file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) : []; -$excluded_species = file_exists($exclude_file) ? file($exclude_file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) : []; -$whitelisted_species = file_exists($whitelist_file) ? file($whitelist_file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) : []; +$excluded_species = file_exists($exclude_file) ? array_map(fn($l) => explode('_', trim($l), 2)[0], file($exclude_file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)) : []; +$whitelisted_species = file_exists($whitelist_file) ? array_map(fn($l) => explode('_', trim($l), 2)[0], file($whitelist_file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)) : []; $config = get_config(); $sf_thresh = isset($config['SF_THRESH']) ? (float)$config['SF_THRESH'] : 0.0; @@ -220,8 +220,8 @@ $result = $db->query($sql); $common_link = "{$common}"; $is_confirmed = in_array($identifier_sci, $confirmed_species, true); - $is_excluded = in_array($identifier, $excluded_species, true); - $is_whitelisted = in_array($identifier, $whitelisted_species, true); + $is_excluded = in_array($identifier_sci, $excluded_species, true); + $is_whitelisted = in_array($identifier_sci, $whitelisted_species, true); $comnamegraph = str_replace("'", "\'", $row['Com_Name']); $chart_cell = sprintf("", $comnamegraph); @@ -234,12 +234,12 @@ $result = $db->query($sql); : ""; $excl_cell = $is_excluded - ? "" - : ""; + ? "" + : ""; $white_cell = $is_whitelisted - ? "" - : ""; + ? "" + : ""; $sciname_raw = $row['Sci_Name']; $info_url = get_info_url($sciname_raw);