Announcement

#1 2021-09-09 06:12:14

Lenyman
Member
2021-08-04
9

Customizing Advanced Search

Hi everyone!!!

The "Search tags" section in Advanced Search allows you to select existing tags from a drop-down list.
In practice we ONLY need to search by tags.
--> My problem is that I have more than 10K tags <--
What I want to achieve is to be able to:
- type the desired tag (without the drop-down list)
- select the desired album
- and perform the search.

I use the Bootstrap Darkroom theme and the code for the tags section in the search.tpl file is as follows:

Code:

98            <div class="card-body">
                <div class="form-group mb-3">
                    <select class="form-control" id="tags" placeholder="{'Type in a search term'|@translate}" name="tags[]" >
{foreach from=$TAGS item=tag}
                        <option value="{$tag.id}">{$tag.name} ({$tag.counter|translate_dec:'%d photo':'%d photos'})</option>
{/foreach}
                    </select>
                </div>
            </div>

I modified it to show a text input field instead of a dropdown like so:

Code:

98            <div class="card-body">
                <div class="form-group mb-3">
      <input type="text" id="tags" placeholder="Indica el numero de corredor" name="tags[]" class="form-control" />
                </div>
            </div>

But it doesn't work because the text I input disappears when I click anywhere, even on the Submit button.... and an error screen appears with the message
Piwigo encountered an unrecoverable error
[Hacking attempt] an item is not valid in input parameter "tags"
#1    check_input_parameter /var/www/html/www/search.php(69)



This is the code of line 69 of search.php

Code:

check_input_parameter('tags', $_POST, true, PATTERN_ID);

Any help or advice will be welcome!! :D


---------------
Piwigo 11.5.0
Sistema operativo: Linux
PHP: 7.4.3 (Ver información) [2021-08-06 00:26:42]
MySQL: 5.5.5-10.3.30-MariaDB-0ubuntu0.20.04.1 [2021-08-06 00:26:42]
Librería gráfica: ImageMagick 6.9.10-23

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact