function xbbcode_basic_render_img in Extensible BBCode 5
Same name and namespace in other branches
- 8 xbbcode_basic/xbbcode_basic.module \xbbcode_basic_render_img()
- 8.2 xbbcode_basic/xbbcode_basic.module \xbbcode_basic_render_img()
- 6 xbbcode_basic/xbbcode_basic.module \xbbcode_basic_render_img()
- 7 xbbcode_basic/xbbcode_basic.module \xbbcode_basic_render_img()
1 call to xbbcode_basic_render_img()
- xbbcode_basic_render in xbbcode_basic/
xbbcode_basic.module
File
- xbbcode_basic/
xbbcode_basic.module, line 296
Code
function xbbcode_basic_render_img($tag) {
if ($tag->args) {
if ($tag->option) {
list($width, $height) = explode("x", $tag->option);
}
else {
list($width, $height) = array(
$tag->args['width'],
$tag->args['height'],
);
}
$scale = " style='width:{$width}px;height:{$height}px;'";
}
else {
$scale = '';
}
$alt = substr($tag->content, 0, 32);
$alt .= strlen($tag->content) > 32 ? '...' : '';
$out = "<img{$scale} src='{$tag->content}' alt='IMAGE(" . $alt . ")' />";
return $out;
}