From 9fda0a3fd5a78945f818f80bd45dc9e6e3995c4c Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 27 May 2013 21:23:43 -0700 Subject: add support for zmg bbcode tag (img with class=zrl) which will eventually get turned into a zid link when rendered for display. TODO - turn photo items and photos uploaded into posts into zmg, then run all incoming bbcode posts through a filter to see if there's a photo from a known hubloc (with an http(s): src attr - not data:) and if so turn it into a zmg. Then fix the zidify functions to look for class="zrl" and we're done. --- include/bbcode.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/bbcode.php b/include/bbcode.php index 7a1e3a5e8..4f99a8038 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -91,7 +91,7 @@ function bb_replace_images($body, $images) { // We're depending on the property of 'foreach' (specified on the PHP website) that // it loops over the array starting from the first element and going sequentially // to the last element - $newbody = str_replace('[$#saved_image' . $cnt . '#$]', '' . t('Image/photo') . '', $newbody); + $newbody = str_replace('[$#saved_image' . $cnt . '#$]', '' . t('Image/photo') . '', $newbody); $cnt++; } @@ -405,10 +405,12 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { // [img=widthxheight]image source[/img] //$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '', $Text); $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '', $Text); + $Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*)\](.*?)\[\/zmg\]/ism", '', $Text); // Images // [img]pathtoimage[/img] $Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '' . t('Image/photo') . '', $Text); + $Text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '' . t('Image/photo') . '', $Text); -- cgit v1.2.3