X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconversation.php;h=6c33be84fb33971d1f9a167e7607e244487268c0;hb=ec57b61f012562e3a2464869d62ade97fdc2e8d9;hp=d8c5e4461da9cdeb174d61cf03deda4740f826bf;hpb=c4ba035ee314295c5a6a62ed49554f09a50c86f4;p=friendica.git diff --git a/include/conversation.php b/include/conversation.php index d8c5e4461d..6c33be84fb 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -315,11 +315,11 @@ function localize_item(&$item){ } // add zrl's to public images -// $photo_pattern = "/\[url=(.*?)\/photos\/(.*?)\/image\/(.*?)\]\[img(.*?)\]h(.*?)\[\/img\]\[\/url\]/is"; -// if(preg_match($photo_pattern,$item['body'])) { -// $photo_replace = '[url=' . zrl('$1' . '/photos/' . '$2' . '/image/' . '$3' ,true) . '][img' . '$4' . ']h' . '$5' . '[/img][/url]'; -// $item['body'] = bb_tag_preg_replace($photo_pattern, $photo_replace, 'url', $item['body']); -// } + $photo_pattern = "/\[url=(.*?)\/photos\/(.*?)\/image\/(.*?)\]\[img(.*?)\]h(.*?)\[\/img\]\[\/url\]/is"; + if(preg_match($photo_pattern,$item['body'])) { + $photo_replace = '[url=' . zrl('$1' . '/photos/' . '$2' . '/image/' . '$3' ,true) . '][img' . '$4' . ']h' . '$5' . '[/img][/url]'; + $item['body'] = bb_tag_preg_replace($photo_pattern, $photo_replace, 'url', $item['body']); + } // add sparkle links to appropriate permalinks @@ -811,16 +811,16 @@ function best_link_url($item,&$sparkle,$ssl_state = false) { if((local_user()) && (local_user() == $item['uid'])) { if(isset($a->contacts) && x($a->contacts,$clean_url)) { if($a->contacts[$clean_url]['network'] === NETWORK_DFRN) { - $best_url = $a->get_baseurl($ssl_state) . '/redir/' . $a->contacts[$clean_url]['id']; + $best_url = 'redir/'.$a->contacts[$clean_url]['id']; $sparkle = true; } else $best_url = $a->contacts[$clean_url]['url']; } } elseif (local_user()) { - $r = q("SELECT `id`, `network` FROM `contact` WHERE `network` = '%s' AND `uid` = %d AND `nurl` = '%s'", + $r = q("SELECT `id` FROM `contact` WHERE `network` = '%s' AND `uid` = %d AND `nurl` = '%s' LIMIT 1", dbesc(NETWORK_DFRN), intval(local_user()), dbesc(normalise_link($clean_url))); if ($r) { - $best_url = $a->get_baseurl($ssl_state).'/redir/'.$r[0]['id']; + $best_url = 'redir/'.$r[0]['id']; $sparkle = true; } } @@ -876,7 +876,7 @@ function item_photo_menu($item){ if(local_user() && local_user() == $item['uid'] && link_compare($item['url'],$item['author-link'])) { $cid = $item['contact-id']; } else { - $r = q("SELECT `id`, `network` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' ORDER BY `uid` DESC LIMIT 1", + $r = q("SELECT `id`, `network` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' LIMIT 1", intval(local_user()), dbesc(normalise_link($item['author-link']))); if ($r) { $cid = $r[0]["id"];