aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-07 00:48:18 -0700
committerfriendica <info@friendica.com>2013-09-07 00:48:18 -0700
commit04a4e4962d03d9ca4cc8503bb05ee94b0acc1a5f (patch)
treeddf22628ab69b094febe81d23734ebadf3a6ce62
parentd194ee091af0ee15c7f63def7e8c07ee29e38f39 (diff)
parentba980e2c1f3d673ab07e6c3ac1c3657294f95708 (diff)
downloadvolse-hubzilla-04a4e4962d03d9ca4cc8503bb05ee94b0acc1a5f.tar.gz
volse-hubzilla-04a4e4962d03d9ca4cc8503bb05ee94b0acc1a5f.tar.bz2
volse-hubzilla-04a4e4962d03d9ca4cc8503bb05ee94b0acc1a5f.zip
Merge pull request #116 from unary/categorysearch
Thanks Michael! issue #115 - filter by category fix
-rw-r--r--mod/channel.php5
-rwxr-xr-xview/tpl/build_query.tpl2
2 files changed, 5 insertions, 2 deletions
diff --git a/mod/channel.php b/mod/channel.php
index aa158d330..5d3855269 100644
--- a/mod/channel.php
+++ b/mod/channel.php
@@ -90,6 +90,8 @@ function channel_content(&$a, $update = 0, $load = false) {
require_once('include/permissions.php');
+ $category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
+
$groups = array();
$o = '';
@@ -171,8 +173,9 @@ function channel_content(&$a, $update = 0, $load = false) {
}
else {
+
if(x($category)) {
- $sql_extra .= protect_sprintf(file_tag_file_query('item',$category,'category'));
+ $sql_extra .= protect_sprintf(term_query('item', $category, TERM_CATEGORY));
}
if($datequery) {
diff --git a/view/tpl/build_query.tpl b/view/tpl/build_query.tpl
index e5bf3acce..53a8c0f6b 100755
--- a/view/tpl/build_query.tpl
+++ b/view/tpl/build_query.tpl
@@ -41,7 +41,7 @@
if(bParam_search != "") bCmd = bCmd + "&search=" + bParam_search;
if(bParam_order != "") bCmd = bCmd + "&order=" + bParam_order;
if(bParam_file != "") bCmd = bCmd + "&file=" + bParam_file;
- if(bParam_cats != "") bCmd = bCmd + "&cats=" + bParam_cats;
+ if(bParam_cats != "") bCmd = bCmd + "&cat=" + bParam_cats;
if(bParam_dend != "") bCmd = bCmd + "&dend=" + bParam_dend;
if(bParam_dbegin != "") bCmd = bCmd + "&dbegin=" + bParam_dbegin;
if(bParam_mid != "") bCmd = bCmd + "&mid=" + bParam_mid;