| 367 |
|
|
| 368 |
// get the total number of published items in the category |
// get the total number of published items in the category |
| 369 |
// filter functionality |
// filter functionality |
| 370 |
$and = ''; |
$_and = ''; |
| 371 |
if ($filter = mosGetParam($_POST, 'filter', '')) { |
if ($filter = mosGetParam($_POST, 'filter', '')) { |
| 372 |
$filter = strtolower( $filter ); |
$filter = strtolower( $filter ); |
| 373 |
$filter = $database->getEscaped($filter); |
$filter = $database->getEscaped($filter); |
| 374 |
if ( $params->get( 'filter' ) ) { |
if ( $params->get( 'filter' ) ) { |
| 375 |
switch ( $params->get( 'filter_type' ) ) { |
switch ( $params->get( 'filter_type' ) ) { |
| 376 |
case 'title': |
case 'title': |
| 377 |
$and = "\n AND LOWER( a.title ) LIKE '%". $filter ."%'"; |
$_and = "\n AND LOWER( a.title ) LIKE '%". $filter ."%'"; |
| 378 |
break; |
break; |
| 379 |
case 'author': |
case 'author': |
| 380 |
$and = "\n AND ( ( LOWER( u.name ) LIKE '%". $filter ."%' ) OR ( LOWER( a.created_by_alias ) LIKE '%". $filter ."%' ) )"; |
$_and = "\n AND ( ( LOWER( u.name ) LIKE '%". $filter ."%' ) OR ( LOWER( a.created_by_alias ) LIKE '%". $filter ."%' ) )"; |
| 381 |
break; |
break; |
| 382 |
case 'hits': |
case 'hits': |
| 383 |
$and = "\n AND a.hits LIKE '%". $filter ."%'"; |
$_and = "\n AND a.hits LIKE '%". $filter ."%'"; |
| 384 |
break; |
break; |
| 385 |
} |
} |
| 386 |
} |
} |
| 403 |
. "\n WHERE a.catid='". $category->id ."' ". $xwhere |
. "\n WHERE a.catid='". $category->id ."' ". $xwhere |
| 404 |
. ( $noauth ? "\n AND a.access<='". $gid ."'" : '' ) |
. ( $noauth ? "\n AND a.access<='". $gid ."'" : '' ) |
| 405 |
. "\n AND '". $category->access ."'<='". $gid ."'" |
. "\n AND '". $category->access ."'<='". $gid ."'" |
| 406 |
. $and |
. $_and |
| 407 |
. "\n ORDER BY ". $orderby ."" |
. "\n ORDER BY ". $orderby ."" |
| 408 |
; |
; |
| 409 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 423 |
. "\n WHERE a.catid='". $category->id ."' ". $xwhere |
. "\n WHERE a.catid='". $category->id ."' ". $xwhere |
| 424 |
. ( $noauth ? "\n AND a.access<='". $gid ."'" : '' ) |
. ( $noauth ? "\n AND a.access<='". $gid ."'" : '' ) |
| 425 |
. "\n AND '". $category->access ."'<='". $gid ."'" |
. "\n AND '". $category->access ."'<='". $gid ."'" |
| 426 |
. $and |
. $_and |
| 427 |
. "\n ORDER BY ". $orderby ."" |
. "\n ORDER BY ". $orderby ."" |
| 428 |
. "\n LIMIT ". $limitstart .", ". $limit |
. "\n LIMIT ". $limitstart .", ". $limit |
| 429 |
; |
; |