add tag to personal

This commit is contained in:
friendica 2011-11-29 19:52:14 -08:00
parent 7b9ba3bb03
commit 7474c48022
2 changed files with 14 additions and 2 deletions

View file

@ -89,16 +89,27 @@ function message_content(&$a) {
goaway($a->get_baseurl() . '/message' ); goaway($a->get_baseurl() . '/message' );
} }
else { else {
$r = q("SELECT `parent-uri` FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1", $r = q("SELECT `parent-uri`,`convid` FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($a->argv[2]), intval($a->argv[2]),
intval(local_user()) intval(local_user())
); );
if(count($r)) { if(count($r)) {
$parent = $r[0]['parent-uri']; $parent = $r[0]['parent-uri'];
$convid = $r[0]['convid'];
$r = q("DELETE FROM `mail` WHERE `parent-uri` = '%s' AND `uid` = %d ", $r = q("DELETE FROM `mail` WHERE `parent-uri` = '%s' AND `uid` = %d ",
dbesc($parent), dbesc($parent),
intval(local_user()) intval(local_user())
); );
// remove diaspora conversation pointer
if($convid) {
q("delete from conv where id = %d limit 1",
intval($convid)
);
}
if($r) if($r)
info( t('Conversation removed.') . EOL ); info( t('Conversation removed.') . EOL );
} }

View file

@ -374,7 +374,8 @@ function network_content(&$a, $update = 0) {
$myurl = $a->get_baseurl() . '/profile/'. $a->user['nickname']; $myurl = $a->get_baseurl() . '/profile/'. $a->user['nickname'];
$myurl = substr($myurl,strpos($myurl,'://')+3); $myurl = substr($myurl,strpos($myurl,'://')+3);
$myurl = str_replace('www.','',$myurl); $myurl = str_replace('www.','',$myurl);
$sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where `author-link` regexp '%s') ", $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` regexp '%s' or `tag` regexp '%s' ) ",
dbesc($myurl),
dbesc($myurl) dbesc($myurl)
); );
} }