Hello all,
I am following the how-to-docs of Dynamic Filters 2.
From this I got the idea to make that. This works fine, but I also have a text filter.
How do I combine these two?
This is the code I currently have:
In the how-to-docs there is this code:
The first part I understand, but how do I make the second part of it?
I am following the how-to-docs of Dynamic Filters 2.
From this I got the idea to make that. This works fine, but I also have a text filter.
How do I combine these two?
This is the code I currently have:
<?php
$title = JRequest::getString('title', '', 'post');
if ( $title ) {
echo " WHERE `dest` LIKE '%$title%'
OR `reg` LIKE '%$title%'
OR `type` LIKE '%$title%'
OR `aircraft` LIKE '%$title%'
OR `callsignin` LIKE '%$title%'
OR `callsignout` LIKE '%$title%'
OR `orig` LIKE '%$title%'
OR `dest` LIKE '%$title%'
OR `user` LIKE '%$title%'
OR `owner2` LIKE '%$title%'
OR `remarks` LIKE '%$title%'
";
}
?>
<?php
$year = JRequest::getInt('year', '0', 'post');
if ( $year ) {
echo " WHERE `year` = '$year' ";
}
?>
In the how-to-docs there is this code:
<?php
// create the empty array
$where = array();
// check the text filter
$filter_text = JRequest::getString('filter_text', '', 'post');
if ( $filter_text ) {
$where[] = "( `title` LIKE '%$filter_text%'
OR `introtext` LIKE '%$filter_text%'
OR `fulltext` LIKE '%$filter_text%' )";
}
// check the catid filter
$filter_catid =& JRequest::getVar('filter_catid', array(), 'post', 'array');
if ( count($filter_catid) ) {
$filter = implode(', ', $filter_catid);
$where[] = " `catid` IN ($filter) ";
}
if ( count($where) ) {
$where = implode(' AND ', $where);
echo " WHERE $where ";
}
?>
The first part I understand, but how do I make the second part of it?