Improved www.ttss.krakow.pl
Jacek Kowalski
2019-05-04 d87cf076349d354b829bfe896ef11247b1182dd9
Use number of matched query chars when ordering stop search results
1 files modified
3 ■■■■ changed files
stops/index.php 3 ●●●● patch | view | raw | blame | history
stops/index.php
@@ -50,11 +50,12 @@
    $stop_list = [];
    $query_lower = normalize_name_cmp($_GET['query']);
    foreach($ids as $id) {
        similar_text(
        $letters = similar_text(
            $query_lower,
            normalize_name_cmp($stops[$id]),
            $percent
        );
        $percent += $letters * 100;
        // -5 due to UTF-8
        if(substr($stops[$id], -5) == '(nż)' && !$find_ondemand) {
            $percent /= 2;