add sorting by first detection

This commit is contained in:
frederik
2025-05-24 16:26:36 +02:00
parent df1d202e3f
commit 697352620b
2 changed files with 11 additions and 1 deletions
+5
View File
@@ -399,6 +399,9 @@ if(!isset($_GET['species']) && !isset($_GET['filename'])){
<button <?php if(isset($_GET['sort']) && $_GET['sort'] == "confidence"){ echo "class='sortbutton active'";} else { echo "class='sortbutton'"; }?> type="submit" name="sort" value="confidence">
<img src="images/sort_conf.svg" title="Sort by confidence" alt="Sort by confidence">
</button>
<button <?php if(isset($_GET['sort']) && $_GET['sort'] == "date"){ echo "class='sortbutton active'";} else { echo "class='sortbutton'"; }?> type="submit" name="sort" value="date">
<img src="images/sort_date.svg" title="Sort by date" alt="Sort by date">
</button>
</form>
</div>
<br>
@@ -432,6 +435,8 @@ if(!isset($_GET['species']) && !isset($_GET['filename'])){
} else {
$values[] = ' (' . $valuescount . ')';
}
} elseif ($_GET['sort'] == "date") {
$values[] = ' (' . $results['Date'] . ')';
}
}
+6 -1
View File
@@ -5,7 +5,7 @@ $_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
ini_set('user_agent', 'PHP_Flickr/1.0');
error_reporting(0);
error_reporting(E_ERROR);
ini_set('display_errors', 0);
require_once 'scripts/common.php';
$home = get_home();
@@ -54,6 +54,9 @@ if (get_included_files()[0] === __FILE__) {
<button <?php if(isset($_GET['sort']) && $_GET['sort'] == "confidence"){ echo "class='sortbutton active'";} else { echo "class='sortbutton'"; }?> type="submit" name="sort" value="confidence">
<img src="images/sort_conf.svg" title="Sort by confidence" alt="Sort by confidence">
</button>
<button <?php if(isset($_GET['sort']) && $_GET['sort'] == "date"){ echo "class='sortbutton active'";} else { echo "class='sortbutton'"; }?> type="submit" name="sort" value="date">
<img src="images/sort_date.svg" title="Sort by date" alt="Sort by date">
</button>
</form>
</div>
<br>
@@ -80,6 +83,8 @@ if (get_included_files()[0] === __FILE__) {
} else {
$values[] = ' (' . $valuescount . ')';
}
} elseif ($_GET['sort'] == "date") {
$values[] = ' (' . $results['Date'] . ')';
}
}