Filtering Content Plugin not Work

galo2015

New Member
Sorry for my English.

I have two fabrik forms in a joomla article.

The first form is the search fields.
The second form is a view the list of a table on which it seeks.

I have a plugin redirect to the same item once shipped search data to add URL page with information to YES.

(index.php?Option=com_content&view=article&id=72)

Article php code that collects the data.
....
.....
{source}
<?php
$numero = count($_GET);
$tags = array_keys($_GET);
$valores = array_values($_GET);
for($i=0;$i<$numero;$i++){ $$tags[$i]=$valores[$i]; }
$orden='fabrikar view=list id=3 clearfilters=1 resetfilters=1 ' ;
if(isset($___sector_comercial))$orden .=' proyectos___sector_comercial[value][]='.$___sector_comercial;
if(isset($___provincia))$orden .=' proyectos___provincia[value][]='.$___provincia ;
if(isset($___localidad))$orden .=' proyectos___localidad[value][]='.$___localidad ;
echo $orden;/* for debug only */
$orden='{'.$orden.'}';
echo $orden; /* show the table but no filter */
?>
{/source}

All values ??are collected and reach $order but when running fabrikar {....} no filter, no work.All records display. From the table, to look if it works.

Any solution?

Thank you very much.
 
Try without the [value][], which would only be needed if you had multiple values for each element, and needed to string filters together with OR's.

Have you tried putting in a {fabrik ...} plugin by hand, with your filters preset with test values, to make sure you have the syntax correct?

-- hugh
 
Oh, and best way to get your query string params is:

Code:
$input = JFactory::getApplication()->input;
$sector_commercial = $input->get('___sector_commercial');

... etc. That way you are running through J!'s input sanitizing, which will prevent people injecting things like SQL into your inputs. That's really important whenever you take a form / query string input and feed it back in to what will become a database query!

-- hugh
 
Oh, and best way to get your query string params is:

Code:
$input = JFactory::getApplication()->input;
$sector_commercial = $input->get('___sector_commercial');

... etc. That way you are running through J!'s input sanitizing, which will prevent people injecting things like SQL into your inputs. That's really important whenever you take a form / query string input and feed it back in to what will become a database query!

-- hugh
 
Thank you for your feedback.

The problem is caused by strangers characters in the search string. For example $ var = 'camion' works but $ var = 'cami?n' does not work. urlencode solution?
 
SOLVED. Use getString.

$input = JFactory::getApplication()->input;
$sector_commercial = $input->getString('___sector_commercial');
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top