From a16382529135a76c5afaf4d4189856734a8e7f58 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 21 May 2012 22:54:39 -0700 Subject: redir links for permission controlled attachments --- include/text.php | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index e3c683338..e93c24ef4 100644 --- a/include/text.php +++ b/include/text.php @@ -901,24 +901,30 @@ function prepare_body($item,$attach = false) { foreach($arr as $r) { $matches = false; $icon = ''; - $cnt = preg_match('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"\[\/attach\]|',$r,$matches); + $cnt = preg_match_all('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"\[\/attach\]|',$r,$matches, PREG_SET_ORDER); if($cnt) { - $icontype = strtolower(substr($matches[3],0,strpos($matches[3],'/'))); - switch($icontype) { - case 'video': - case 'audio': - case 'image': - case 'text': - $icon = '
'; - break; - default: - $icon = '
'; - break; + foreach($matches as $mtch) { + $icontype = strtolower(substr($mtch[3],0,strpos($mtch[3],'/'))); + switch($icontype) { + case 'video': + case 'audio': + case 'image': + case 'text': + $icon = '
'; + break; + default: + $icon = '
'; + break; + } + $title = ((strlen(trim($mtch[4]))) ? escape_tags(trim($mtch[4])) : escape_tags($mtch[1])); + $title .= ' ' . $mtch[2] . ' ' . t('bytes'); + if((local_user() == $item['uid']) && $item['contact-id'] != $a->contact['id']) + $the_url = $a->get_baseurl() . '/redir/' . $item['contact-id'] . '?f=1&url=' . $mtch[1]; + else + $the_url = $mtch[1]; + + $s .= '' . $icon . ''; } - $title = ((strlen(trim($matches[4]))) ? escape_tags(trim($matches[4])) : escape_tags($matches[1])); - $title .= ' ' . $matches[2] . ' ' . t('bytes'); - - $s .= '' . $icon . ''; } } $s .= '
'; -- cgit v1.2.3 From 789063da399675575f61e150f11dbe534d7db3c5 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Wed, 23 May 2012 15:58:22 -0400 Subject: add a placeholder attribute on search-text; dispy fixes Signed-off-by: Simon L'nu --- include/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index e93c24ef4..d6a9ef5d3 100644 --- a/include/text.php +++ b/include/text.php @@ -646,7 +646,7 @@ function search($s,$id='search-box',$url='/search',$save = false) { $a = get_app(); $o = '
'; $o .= '
'; - $o .= ''; + $o .= ''; $o .= ''; if($save) $o .= ''; -- cgit v1.2.3 From 15c023a21809c486b057d83a30313597f35ececa Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 30 May 2012 17:22:51 -0700 Subject: y didn't i think of this b4? --- include/text.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index d6a9ef5d3..376ac473d 100644 --- a/include/text.php +++ b/include/text.php @@ -742,6 +742,8 @@ function smilies($s, $sample = false) { ':homebrew', ':coffee', ':facepalm', + ':like', + ':dislike', '~friendika', '~friendica' @@ -778,6 +780,8 @@ function smilies($s, $sample = false) { ':homebrew', ':coffee', ':facepalm', + ':like', + ':dislike', '~friendika ~friendika', '~friendica ~friendica' ); -- cgit v1.2.3 From 4978ee12d10a9a18f9fc26795e09515ef6db7949 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 2 Jun 2012 18:05:23 -0700 Subject: webfinger profile linker --- include/text.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index 376ac473d..d4a4d5580 100644 --- a/include/text.php +++ b/include/text.php @@ -891,6 +891,7 @@ function prepare_body($item,$attach = false) { } else $s = prepare_text($item['body']); + $prep_arr = array('item' => $item, 'html' => $s); call_hooks('prepare_body', $prep_arr); $s = $prep_arr['html']; -- cgit v1.2.3