diff options
author | Friendika <info@friendika.com> | 2011-09-18 00:16:18 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-09-18 00:16:18 -0700 |
commit | 5f4ab62fe330a714777fecae88465e83331abed1 (patch) | |
tree | d659885c952aafa74f61618595e33c48fd456b1d /include | |
parent | ce77c7287e8f6bf721c823290ff939b9ab5764e9 (diff) | |
download | volse-hubzilla-5f4ab62fe330a714777fecae88465e83331abed1.tar.gz volse-hubzilla-5f4ab62fe330a714777fecae88465e83331abed1.tar.bz2 volse-hubzilla-5f4ab62fe330a714777fecae88465e83331abed1.zip |
fix bbcode image size
Diffstat (limited to 'include')
-rw-r--r-- | include/bbcode.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index 3886af37d..3d6b907a6 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -113,6 +113,9 @@ function bbcode($Text,$preserve_nl = false) { // Check for [quote] text $Text = preg_replace("/\[quote\](.*?)\[\/quote\]/ism","$QuoteLayout", $Text); + // [img=widthxheight]image source[/img] + $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '<img src="$3" style="height:{$2}px; width:{$1}px;" >', $Text); + // Images // [img]pathtoimage[/img] $Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img src="$1" alt="' . t('Image/photo') . '" />', $Text); @@ -125,8 +128,6 @@ function bbcode($Text,$preserve_nl = false) { $Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/ism", '<iframe src="$1" width="425" height="350"><a href="$1">$1</a></iframe>', $Text); - // [img=widthxheight]image source[/img] - $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '<img src="$3" style="height:{$2}px; width:{$1}px;" >', $Text); if (get_pconfig(local_user(), 'oembed', 'use_for_youtube' )==1){ // use oembed for youtube links |