]> git.mxchange.org Git - friendica.git/blobdiff - mod/network.php
include diaspora mentions in personal (requires adding a Diaspora profile url because...
[friendica.git] / mod / network.php
index 8ba736fbec90133426d3663bafcfbe0bb8b75f2a..2a3db597e838a5d118adecd337860bbb2b4ae38c 100644 (file)
@@ -68,17 +68,16 @@ function saved_searches($search) {
        
        $o = '';
 
-       $r = q("select `term` from `search` WHERE `uid` = %d",
+       $r = q("select `id`,`term` from `search` WHERE `uid` = %d",
                intval(local_user())
        );
 
        $saved = array();
 
-
-       
        if(count($r)) {
                foreach($r as $rr) {
                        $saved[] = array(
+                               'id'            => $rr['id'],
                                'term'                  => $rr['term'],
                                'encodedterm'   => urlencode($rr['term']),
                                'delete'                => t('Remove term'),
@@ -373,10 +372,12 @@ function network_content(&$a, $update = 0) {
        if($conv) {
                $myurl = $a->get_baseurl() . '/profile/'. $a->user['nickname'];
                $myurl = substr($myurl,strpos($myurl,'://')+3);
-               $myurl = str_replace('www.','',$myurl);
-               $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)
+               $myurl = str_replace(array('www.','.'),array('','\\.'),$myurl);
+               $diasp_url = str_replace('/profile/','/u/',$myurl);
+               $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` regexp '%s' or `tag` regexp '%s' or tag regexp '%s' )) ",
+                       dbesc($myurl . '$'),
+                       dbesc($myurl . '\\]'),
+                       dbesc($diasp_url . '\\]')
                );
        }