aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorVasudev Kamath <kamathvasudev@gmail.com>2012-05-05 20:48:16 +0530
committerVasudev Kamath <kamathvasudev@gmail.com>2012-05-05 20:48:16 +0530
commitb5e857c0e7ccf4ef3d33e5b6d0a4325b693a8e80 (patch)
tree74234775d723e33378059f2fa45fa80e3bc6ac43 /include/text.php
parent214ec91a3f2c5fec6cced93f669b3a9725f0e40a (diff)
parent8ae83201cf8f3c943972a8f246b7972aa640afb4 (diff)
downloadvolse-hubzilla-b5e857c0e7ccf4ef3d33e5b6d0a4325b693a8e80.tar.gz
volse-hubzilla-b5e857c0e7ccf4ef3d33e5b6d0a4325b693a8e80.tar.bz2
volse-hubzilla-b5e857c0e7ccf4ef3d33e5b6d0a4325b693a8e80.zip
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/include/text.php b/include/text.php
index 8c8db66a9..1b5b0afd4 100644
--- a/include/text.php
+++ b/include/text.php
@@ -558,7 +558,7 @@ function contact_block() {
if((! is_array($a->profile)) || ($a->profile['hide-friends']))
return $o;
- $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0",
+ $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0",
intval($a->profile['uid'])
);
if(count($r)) {
@@ -569,7 +569,7 @@ function contact_block() {
$micropro = Null;
} else {
- $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 ORDER BY RAND() LIMIT %d",
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0 ORDER BY RAND() LIMIT %d",
intval($a->profile['uid']),
intval($shown)
);
@@ -930,7 +930,8 @@ function prepare_body($item,$attach = false) {
foreach($matches as $mtch) {
if(strlen($x))
$x .= ',';
- $x .= xmlify(file_tag_decode($mtch[1]));
+ $x .= xmlify(file_tag_decode($mtch[1]))
+ . ((local_user() == $item['uid']) ? ' <a href="' . $a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&cat=' . xmlify(file_tag_decode($mtch[1])) . '" title="' . t('remove') . '" >' . t('[remove]') . '</a>' : '');
}
if(strlen($x))
$s .= '<div class="categorytags"><span>' . t('Categories:') . ' </span>' . $x . '</div>';
@@ -1466,12 +1467,16 @@ function file_tag_save_file($uid,$item,$file) {
return true;
}
-function file_tag_unsave_file($uid,$item,$file) {
+function file_tag_unsave_file($uid,$item,$file,$cat = false) {
$result = false;
if(! intval($uid))
return false;
- $pattern = '[' . file_tag_encode($file) . ']' ;
+ if($cat == true)
+ $pattern = '<' . file_tag_encode($file) . '>' ;
+ else
+ $pattern = '[' . file_tag_encode($file) . ']' ;
+
$r = q("select file from item where id = %d and uid = %d limit 1",
intval($item),
@@ -1486,13 +1491,14 @@ function file_tag_unsave_file($uid,$item,$file) {
intval($uid)
);
- $r = q("select file from item where uid = %d " . file_tag_file_query('item',$file),
+ $r = q("select file from item where uid = %d and deleted = 0 " . file_tag_file_query('item',$file,(($cat) ? 'category' : 'file')),
intval($uid)
);
if(! count($r)) {
$saved = get_pconfig($uid,'system','filetags');
set_pconfig($uid,'system','filetags',str_replace($pattern,'',$saved));
+
}
return true;
}