aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/channel.php5
-rw-r--r--mod/display.php1
-rw-r--r--mod/home.php1
-rw-r--r--mod/network.php40
-rw-r--r--mod/search.php1
5 files changed, 33 insertions, 15 deletions
diff --git a/mod/channel.php b/mod/channel.php
index 54b25ad8b..f85f904aa 100644
--- a/mod/channel.php
+++ b/mod/channel.php
@@ -57,6 +57,7 @@ function channel_content(&$a, $update = 0, $load = false) {
}
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
+ $hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
$groups = array();
@@ -174,6 +175,9 @@ function channel_content(&$a, $update = 0, $load = false) {
if(x($category)) {
$sql_extra .= protect_sprintf(term_query('item', $category, TERM_CATEGORY));
}
+ if(x($hashtags)) {
+ $sql_extra .= protect_sprintf(term_query('item', $hashtags, TERM_HASHTAG));
+ }
if($datequery) {
$sql_extra2 .= protect_sprintf(sprintf(" AND item.created <= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery))));
@@ -281,6 +285,7 @@ function channel_content(&$a, $update = 0, $load = false) {
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$file' => '',
'$cats' => (($category) ? $category : ''),
+ '$tags' => (($hashtags) ? $hashtags : ''),
'$mid' => $mid,
'$dend' => $datequery,
'$dbegin' => $datequery2
diff --git a/mod/display.php b/mod/display.php
index ece406543..55f7c1306 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -133,6 +133,7 @@ function display_content(&$a, $update = 0, $load = false) {
'$order' => '',
'$file' => '',
'$cats' => '',
+ '$tags' => '',
'$dend' => '',
'$dbegin' => '',
'$mid' => $item_hash
diff --git a/mod/home.php b/mod/home.php
index b1b8e3fd0..b2538795f 100644
--- a/mod/home.php
+++ b/mod/home.php
@@ -141,6 +141,7 @@ function home_content(&$a, $update = 0, $load = false) {
'$order' => 'comment',
'$file' => '',
'$cats' => '',
+ '$tags' => '',
'$dend' => '',
'$mid' => '',
'$dbegin' => ''
diff --git a/mod/network.php b/mod/network.php
index 522622f03..d444dbd59 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -34,6 +34,21 @@ function network_content(&$a, $update = 0, $load = false) {
$channel = $a->get_channel();
+
+ $datequery = $datequery2 = '';
+
+ $group = 0;
+
+ $nouveau = false;
+
+ $datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : '');
+ $datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : '');
+ $nouveau = ((x($_GET,'new')) ? intval($_GET['new']) : 0);
+ $gid = ((x($_GET,'gid')) ? intval($_GET['gid']) : 0);
+ $category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
+ $hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
+
+
$search = (($_GET['search']) ? $_GET['search'] : '');
if($search) {
if(strpos($search,'@') === 0) {
@@ -47,23 +62,11 @@ function network_content(&$a, $update = 0, $load = false) {
}
}
elseif(strpos($search,'#') === 0) {
- $search = $_GET['search'] = substr($search,1);
+ $hashtags = substr($search,1);
+ $search = $_GET['search'] = '';
}
}
-
- $datequery = $datequery2 = '';
-
- $group = 0;
-
- $nouveau = false;
-
- $datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : '');
- $datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : '');
- $nouveau = ((x($_GET,'new')) ? intval($_GET['new']) : 0);
- $gid = ((x($_GET,'gid')) ? intval($_GET['gid']) : 0);
-
-
if($datequery)
$_GET['order'] = 'post';
@@ -199,6 +202,12 @@ function network_content(&$a, $update = 0, $load = false) {
}
}
+ if(x($category)) {
+ $sql_extra .= protect_sprintf(term_query('item', $category, TERM_CATEGORY));
+ }
+ if(x($hashtags)) {
+ $sql_extra .= protect_sprintf(term_query('item', $hashtags, TERM_HASHTAG));
+ }
if(! $update) {
// The special div is needed for liveUpdate to kick in for this page.
@@ -238,7 +247,8 @@ function network_content(&$a, $update = 0, $load = false) {
'$search' => (($search) ? $search : ''),
'$order' => $order,
'$file' => $file,
- '$cats' => '',
+ '$cats' => $category,
+ '$tags' => $hashtags,
'$dend' => $datequery,
'$mid' => '',
'$dbegin' => $datequery2
diff --git a/mod/search.php b/mod/search.php
index 612ceb4bc..6df9d631a 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -107,6 +107,7 @@ function search_content(&$a,$update = 0, $load = false) {
'$order' => '',
'$file' => '',
'$cats' => '',
+ '$tags' => '',
'$mid' => '',
'$dend' => '',
'$dbegin' => ''