aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-02-11 00:20:14 -0800
committerfriendica <info@friendica.com>2013-02-11 00:20:14 -0800
commitba3cff6d9a505e22732c800430e34adb7e55f3a4 (patch)
treedbf1c1b59e9c131e09093f33f6b3e95155f28f63
parent191af201fb48d902a7aa22699ab882e60d439e2d (diff)
downloadvolse-hubzilla-ba3cff6d9a505e22732c800430e34adb7e55f3a4.tar.gz
volse-hubzilla-ba3cff6d9a505e22732c800430e34adb7e55f3a4.tar.bz2
volse-hubzilla-ba3cff6d9a505e22732c800430e34adb7e55f3a4.zip
progress on tag delivery
-rwxr-xr-xinclude/items.php10
-rw-r--r--mod/channel.php2
-rw-r--r--mod/display.php2
-rwxr-xr-xmod/events.php2
-rw-r--r--mod/item.php6
-rw-r--r--mod/network.php4
-rw-r--r--mod/page.php2
-rw-r--r--mod/search.php4
8 files changed, 17 insertions, 15 deletions
diff --git a/include/items.php b/include/items.php
index a192c79a2..e3ad1aae5 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1481,14 +1481,14 @@ function item_store($arr,$force_parent = false) {
$arr['private'] = $private;
// Store taxonomy
-
+
if(($terms) && (is_array($terms))) {
foreach($terms as $t) {
q("insert into term (uid,oid,otype,type,term,url)
values(%d,%d,%d,%d,'%s','%s') ",
intval($arr['uid']),
intval($current_post),
- intval($t['otype']),
+ intval(TERM_OBJ_POST),
intval($t['type']),
dbesc($t['term']),
dbesc($t['url'])
@@ -1599,7 +1599,7 @@ function tag_deliver($uid,$item_id) {
$u = q("select * from channel where channel_id = %d limit 1",
intval($uid)
);
- if(! count($u))
+ if(! $u)
return;
$i = q("select * from item where id = %d and uid = %d limit 1",
@@ -4295,7 +4295,7 @@ function posted_date_widget($url,$uid,$wall) {
}
-function fetch_post_tags($items) {
+function fetch_post_tags($items,$link = false) {
$tag_finder = array();
if($items) {
@@ -4326,6 +4326,8 @@ function fetch_post_tags($items) {
for($x = 0; $x < count($items); $x ++) {
if($tags) {
foreach($tags as $t) {
+ if(($link) && ($t['type'] == TERM_MENTION))
+ $t['url'] = chanlink_url($t['url']);
if(array_key_exists('item_id',$items[$x])) {
if($t['oid'] == $items[$x]['item_id']) {
if(! is_array($items[$x]['term']))
diff --git a/mod/channel.php b/mod/channel.php
index 7869e54db..0a49b41eb 100644
--- a/mod/channel.php
+++ b/mod/channel.php
@@ -211,7 +211,7 @@ function channel_content(&$a, $update = 0, $load = false) {
);
xchan_query($items);
- $items = fetch_post_tags($items);
+ $items = fetch_post_tags($items, true);
$items = conv_sort($items,'created');
} else {
diff --git a/mod/display.php b/mod/display.php
index f18587e1e..3c2172c7d 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -123,7 +123,7 @@ function display_content(&$a, $update = 0, $load = false) {
);
xchan_query($items);
- $items = fetch_post_tags($items);
+ $items = fetch_post_tags($items,true);
$items = conv_sort($items,'created');
}
} else {
diff --git a/mod/events.php b/mod/events.php
index f18f40cc7..8c509cfea 100755
--- a/mod/events.php
+++ b/mod/events.php
@@ -261,7 +261,7 @@ function events_content(&$a) {
if($r) {
xchan_query($r);
- $r = fetch_post_tags($r);
+ $r = fetch_post_tags($r,true);
$r = sort_by_date($r);
diff --git a/mod/item.php b/mod/item.php
index 3cea8b22c..8298d3dc0 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -927,8 +927,8 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) {
);
}*/
//$r is set, if someone could be selected
- if(count($r)) {
- $profile = chanlink_url($r[0]['xchan_url']);
+ if($r) {
+ $profile = $r[0]['xchan_url'];
$newname = $r[0]['xchan_name'];
//add person's id to $inform
if(strlen($inform))
@@ -941,7 +941,7 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) {
$replaced = true;
//create profile link
$profile = str_replace(',','%2c',$profile);
- $url = chanlink_url($profile);
+ $url = $profile;
$newtag = '@[url=' . $profile . ']' . $newname . '[/url]';
$body = str_replace('@' . $name, $newtag, $body);
//append tag to str_tags
diff --git a/mod/network.php b/mod/network.php
index 88c7520dd..dae9fa6be 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -608,7 +608,7 @@ function network_content(&$a, $update = 0, $load = false) {
xchan_query($items);
- $items = fetch_post_tags($items);
+ $items = fetch_post_tags($items,true);
}
elseif($update) {
@@ -670,7 +670,7 @@ function network_content(&$a, $update = 0, $load = false) {
$third = dba_timer();
- $items = fetch_post_tags($items);
+ $items = fetch_post_tags($items,true);
$fourth = dba_timer();
diff --git a/mod/page.php b/mod/page.php
index a10b354f2..62f9d9204 100644
--- a/mod/page.php
+++ b/mod/page.php
@@ -36,7 +36,7 @@ function page_content(&$a) {
}
xchan_query($r);
- $r = fetch_post_tags($r);
+ $r = fetch_post_tags($r,true);
$a->profile = array('profile_uid' => $u[0]['channel_id']);
$o .= prepare_page($r[0]);
return $o;
diff --git a/mod/search.php b/mod/search.php
index f76254116..1bea720a6 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -219,7 +219,7 @@ function search_content(&$a) {
);
xchan_query($items);
- $items = fetch_post_tags($items);
+ $items = fetch_post_tags($items,true);
$items = conv_sort($items,'created');
} else {
@@ -249,7 +249,7 @@ function search_content(&$a) {
);
-// $a = fetch_post_tags($a);
+// $a = fetch_post_tags($a,true);
if(! count($r)) {
info( t('No results.') . EOL);