]> git.mxchange.org Git - friendica.git/commitdiff
bookmarks not getting translated to D*
authorFriendika <info@friendika.com>
Tue, 1 Nov 2011 09:17:36 +0000 (02:17 -0700)
committerFriendika <info@friendika.com>
Tue, 1 Nov 2011 09:17:36 +0000 (02:17 -0700)
include/bb2diaspora.php
mod/item.php

index d5ce6a7d9616ad0e790136d388256d4ee584cbd7..0721d27f64393de6b0556bed932876a0634d872f 100644 (file)
@@ -87,6 +87,8 @@ function bb2diaspora($Text,$preserve_nl = false) {
 
        // [img]pathtoimage[/img]
 
+       $Text = preg_replace("/\[bookmark\]([$URLSearchString]*)\[\/bookmark\]/ism", '[$1]($1)', $Text);
+       $Text = preg_replace("/\[bookmark\=([$URLSearchString]*)\](.*?)\[\/bookmark\]/ism", '[$2]($1)', $Text);
 
        $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/ism", '[$1]($1)', $Text);
        $Text = preg_replace("/\#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '[#$2]($1)', $Text);
index 2c8704a31598dcb101b9f5c041708d0fb3f847af..3af0f799a12da6c8dbb1c8907f4e003296d7cc56 100644 (file)
@@ -333,14 +333,20 @@ function item_post(&$a) {
                }
        }
 
-       // embedded bookmark in post? convert to regular url and set bookmark flag
+       // embedded bookmark in post? set bookmark flag
 
        $bookmark = 0;
-       if(preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism",$body,$match)) {
+       if(preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism",$body,$match,PREG_SET_ORDER)) {
                $bookmark = 1;
+//             foreach($match as $mtch) {
+//                     $body = str_replace(
+//                             '[bookmark=' . $mtch[1] . ']' . $mtch[2] . '[/bookmark]',
+//                             '[url=' . $mtch[1] . ']' . $mtch[2] . '[/url]',
+//                             $body
+//                     );
+//             }
        }
 
-
        $body = bb_translate_video($body);
 
        /**