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

 

#2 2023-01-29 19:49:54

BigIsland270972
Member
Norway
2022-03-15
374

Re: Customizing Advanced Search

Following!


Piwigo 14.0 | https://fotoarkiv.no | https://foto.arki.vet | http://Bergen.gallery  | http://Ålesund.gallery | http://geiranger.gallery | http://fjord.photos | http://foto.oslo.no
Apache | PHP 8.1 | MariaDB

Offline

 

Board footer

Powered by FluxBB

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