aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-01-30 17:24:08 +0000
committerMario <mario@mariovavti.com>2020-01-30 17:24:08 +0000
commit8e2446a2fc706a6750c925b4c2672314be6bb91f (patch)
tree111062b3dc472dfa6448624a839156578d15c051 /include
parent7d8c6cb9edb1eddb5b1a1868bf02f875330d5771 (diff)
downloadvolse-hubzilla-8e2446a2fc706a6750c925b4c2672314be6bb91f.tar.gz
volse-hubzilla-8e2446a2fc706a6750c925b4c2672314be6bb91f.tar.bz2
volse-hubzilla-8e2446a2fc706a6750c925b4c2672314be6bb91f.zip
provide img and zmg tags with image description
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 301ffbd24..f3ecbd9e9 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -1237,9 +1237,18 @@ function bbcode($Text, $options = []) {
if (strpos($Text,'[/img]') !== false) {
$Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img style="max-width: 100%;" src="$1" alt="' . t('Image/photo') . '" />', $Text);
}
+ // [img=pathtoimage]image description[/img]
+ if (strpos($Text,'[/img]') !== false) {
+ $Text = preg_replace("/\[img=http(.*?)\](.*?)\[\/img\]/ism", '<img style="max-width: 100%;" src="http$1" alt="$2" title="$2"/>', $Text);
+ }
+ // [zmg]pathtoimage[/zmg]
if (strpos($Text,'[/zmg]') !== false) {
$Text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '<img class="zrl" style="max-width: 100%;" src="$1" alt="' . t('Image/photo') . '" />', $Text);
}
+ // [zmg=pathtoimage]image description[/zmg]
+ if (strpos($Text,'[/zmg]') !== false) {
+ $Text = preg_replace("/\[zmg=http(.*?)\](.*?)\[\/zmg\]/ism", '<img class="zrl" style="max-width: 100%;" src="http$1" alt="$2" title="$2"/>', $Text);
+ }
// [img float={left, right}]pathtoimage[/img]
if (strpos($Text,'[/img]') !== false) {