array_filter($instances_json['instances'], fn($n) => !$n['librey']); function list_instances($instances) { echo "<div>"; echo "<a " . (!isset($opts->engine) ? "selected" : ""; $options .= "<option value="" " . (!isset($opts->language) ? "selected" : ""; ?> ><br> <label><?php printtext("settings_frontends_disable");?></label> <input type="checkbox" name="safe_search" <?php echo $opts->safe_search ? "checked" : ""; $options .= "<option value="$lang_code" $selected>$name</option>"; } echo $options; ?> </select> </div> <div> <label><?php printtext("settings_number_of_results");?></label> <input type="number" name="number_of_results" value="<?php echo htmlspecialchars($opts->number_of_results ?? "10") ?>" > </div> </div> <?php require_once "misc/header.php"; require_once "misc/tools.php"; if (!$opts->query) { echo "<p>" . TEXTS["api_unavailable"] . "</p>"; die(); } $results = fetch_search_results($opts, false); if (array_key_exists("error", $results)) { http_response_code(500); } header("Content-Type: application/json"); echo json_encode($results); ?> #!/bin/sh while