aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/taxonomy.php20
-rw-r--r--include/widgets.php6
-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
-rw-r--r--version.inc2
-rw-r--r--view/js/main.js5
-rwxr-xr-xview/tpl/build_query.tpl2
10 files changed, 65 insertions, 18 deletions
diff --git a/include/taxonomy.php b/include/taxonomy.php
index fab31c73d..be80008df 100644
--- a/include/taxonomy.php
+++ b/include/taxonomy.php
@@ -216,6 +216,26 @@ function tagblock($link,$uid,$count = 0,$authors = '',$flags = 0,$restrict = 0,$
return $o;
}
+function wtagblock($uid,$count = 0,$authors = '',$flags = 0,$restrict = 0,$type = TERM_HASHTAG) {
+ $o = '';
+ $tab = 0;
+ $r = tagadelic($uid,$count,$authors,$flags,$restrict,$type);
+
+ if($r) {
+ $c = q("select channel_address from channel where channel_id = %d limit 1",
+ intval($uid)
+ );
+
+ $o = '<div class="tagblock widget"><h3>' . t('Tags') . '</h3><div class="tags" align="center">';
+ foreach($r as $rr) {
+ $o .= '<span class="tag' . $rr[2] . '">#</span><a href="channel/' . $c[0]['channel_address'] . '?f=&tag=' . urlencode($rr[0]).'" class="tag'.$rr[2].'">'.$rr[0].'</a> ' . "\r\n";
+ }
+ $o .= '</div></div>';
+ }
+ return $o;
+}
+
+
function catblock($uid,$count = 0,$authors = '',$flags = 0,$restrict = 0,$type = TERM_CATEGORY) {
$o = '';
$tab = 0;
diff --git a/include/widgets.php b/include/widgets.php
index 71284f6ad..bb9890add 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -236,9 +236,13 @@ function widget_savedsearch($arr) {
$hasq = ((strpos($srchurl,'?') !== false) ? true : false);
$srchurl = rtrim(preg_replace('/search\=[^\&].*?(\&|$)/is','',$srchurl),'&');
+ $srchurl = rtrim(preg_replace('/submit\=[^\&].*?(\&|$)/is','',$srchurl),'&');
$srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl);
+
+
$hasq = ((strpos($srchurl,'?') !== false) ? true : false);
+
$o = '';
$r = q("select `tid`,`term` from `term` WHERE `uid` = %d and `type` = %d ",
@@ -387,7 +391,7 @@ function widget_tagcloud_wall($arr) {
$limit = ((array_key_exists('limit', $arr)) ? intval($arr['limit']) : 50);
if(feature_enabled($a->profile['profile_uid'], 'tagadelic'))
- return tagblock('search', $a->profile['profile_uid'], $limit, $a->profile['channel_hash'], ITEM_WALL);
+ return wtagblock($a->profile['profile_uid'], $limit, $a->profile['channel_hash'], ITEM_WALL);
return '';
}
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' => ''
diff --git a/version.inc b/version.inc
index fbb89e197..d2690e375 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-12-14.889
+2014-12-15.890
diff --git a/view/js/main.js b/view/js/main.js
index 04e43f72e..4700f79ca 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -903,7 +903,7 @@ function updateConvItems(mode,data) {
function preview_post() {
$("#jot-preview").val("1");
$("#jot-preview-content").show();
- tinyMCE.triggerSave();
+// tinyMCE.triggerSave();
$.post(
"item",
$("#profile-jot-form").serialize(),
@@ -1020,6 +1020,8 @@ function fcFileBrowser (field_name, url, type, win) {
}
function setupFieldRichtext(){
+ return;
+/*
tinyMCE.init({
theme : "advanced",
mode : "specific_textareas",
@@ -1043,6 +1045,7 @@ function setupFieldRichtext(){
theme_advanced_path : false,
file_browser_callback : "fcFileBrowser",
});
+*/
}
diff --git a/view/tpl/build_query.tpl b/view/tpl/build_query.tpl
index 204b5114a..8110b70b1 100755
--- a/view/tpl/build_query.tpl
+++ b/view/tpl/build_query.tpl
@@ -22,6 +22,7 @@
var bParam_order = "{{$order}}";
var bParam_file = "{{$file}}";
var bParam_cats = "{{$cats}}";
+ var bParam_tags = "{{$tags}}";
var bParam_dend = "{{$dend}}";
var bParam_dbegin = "{{$dbegin}}";
var bParam_mid = "{{$mid}}";
@@ -46,6 +47,7 @@
if(bParam_order != "") bCmd = bCmd + "&order=" + bParam_order;
if(bParam_file != "") bCmd = bCmd + "&file=" + bParam_file;
if(bParam_cats != "") bCmd = bCmd + "&cat=" + bParam_cats;
+ if(bParam_tags != "") bCmd = bCmd + "&tag=" + bParam_tags;
if(bParam_dend != "") bCmd = bCmd + "&dend=" + bParam_dend;
if(bParam_dbegin != "") bCmd = bCmd + "&dbegin=" + bParam_dbegin;
if(bParam_mid != "") bCmd = bCmd + "&mid=" + bParam_mid;