1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-19 12:51:52 +02:00

Image size correction on bbcode [img] and automatically display full-width in admin when bbarea is used.

This commit is contained in:
Cameron
2014-05-31 23:18:01 -07:00
parent 2eb638f05e
commit 28c8c25ee4
3 changed files with 48 additions and 11 deletions

View File

@@ -82,11 +82,16 @@ class bb_img extends e_bb_base
parse_str($parm,$imgParms);
// foreach($tmp as $p => $v)
if(!vartrue($imgParms['width']) && strpos($parm,'width')!==false) // Calculate thumbnail width from style.
{
// $imgParms[$p]=$v;
}
preg_match("/width:([\d]*)/i", $parm, $m);
if($m[1] > 0)
{
$imgParms['width'] = $m[1];
}
}
if(!vartrue($imgParms['alt'])) // Generate an Alt value from filename if one not found.
{
preg_match("/([\w]*)(?:\.png|\.jpg|\.jpeg|\.gif)/i", $code_text, $match); // Generate required Alt attribute.