aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-05-27 21:23:43 -0700
committerfriendica <info@friendica.com>2013-05-27 21:23:43 -0700
commit9fda0a3fd5a78945f818f80bd45dc9e6e3995c4c (patch)
treecc84d116d6d3b1b5909dc21b4d00e0fce27d8b3f
parentcfac8d986c50715ee48f0d23592ffae3307b6a81 (diff)
downloadvolse-hubzilla-9fda0a3fd5a78945f818f80bd45dc9e6e3995c4c.tar.gz
volse-hubzilla-9fda0a3fd5a78945f818f80bd45dc9e6e3995c4c.tar.bz2
volse-hubzilla-9fda0a3fd5a78945f818f80bd45dc9e6e3995c4c.zip
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.
-rw-r--r--include/bbcode.php4
1 files changed, 3 insertions, 1 deletions
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 . '#$]', '<img src="' . $image .'" alt="' . t('Image/photo') . '" />', $newbody);
+ $newbody = str_replace('[$#saved_image' . $cnt . '#$]', '<img class="zrl" src="' . $image .'" alt="' . 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", '<img src="$3" style="height: $2px; width: $1px;" >', $Text);
$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '<img src="$3" style="width: $1px;" >', $Text);
+ $Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*)\](.*?)\[\/zmg\]/ism", '<img class="zrl" src="$3" style="width: $1px;" >', $Text);
// Images
// [img]pathtoimage[/img]
$Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img src="$1" alt="' . t('Image/photo') . '" />', $Text);
+ $Text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '<img class="zrl" src="$1" alt="' . t('Image/photo') . '" />', $Text);