diff options
author | Simon L'nu <simon.lnu@gmail.com> | 2012-05-04 17:03:23 -0400 |
---|---|---|
committer | Simon L'nu <simon.lnu@gmail.com> | 2012-05-04 17:03:23 -0400 |
commit | 5830c32dceb2429656ee4957690dd78c24641f02 (patch) | |
tree | f71428787e701421068ce53e446bed47b7078fcf /include/text.php | |
parent | 00190b7faab2baf21523a7243268057142f6de88 (diff) | |
parent | 37d4181fde392b5d31d77531255b345d9a0e718b (diff) | |
download | volse-hubzilla-5830c32dceb2429656ee4957690dd78c24641f02.tar.gz volse-hubzilla-5830c32dceb2429656ee4957690dd78c24641f02.tar.bz2 volse-hubzilla-5830c32dceb2429656ee4957690dd78c24641f02.zip |
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master:
category removal
Esperanto 100%
"show more" friends in common
* master:
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/include/text.php b/include/text.php index af32b2476..4ae5d1333 100644 --- a/include/text.php +++ b/include/text.php @@ -930,7 +930,7 @@ 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])) . ' <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 +1466,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 +1490,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 " . 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; } |