{IMAGE_SIZE} Define Image Size in RT
Posted: Sun 10. Jul 2005, 03:49
Hi
I needed to define the size in my IMAGE replacement tags.
I did the following:
in the include/inc_front/front.func.inc.php
that's all!
Use {IMAGE_SIZE:image/name:width:height}
Leave blank width or height will scale the image.
If you don't want to touch the core code:
Make a new file image_size.php in phpwcms_template/inc_script/frontend_render
Here the code would be:
------------------------------------------------------------------------------
The perfect one would be:
{IMAGE_FULL:image/name:border:width:height:alt}
there might be problems with border"" so you have to write the 0!
I needed to define the size in my IMAGE replacement tags.
I did the following:
in the include/inc_front/front.func.inc.php
Code: Select all
find:
$replace[7] = '<img src="picture/$1" border="0" alt="" />';
add after:
// insert non db image sizable
$search[71] = '/\{IMAGE_SIZE:(.*?):(.*?):(.*?)\}/';
$replace[71] = '<img src="picture/$1" border="0" width="$2" height="$3" alt="" />';
Use {IMAGE_SIZE:image/name:width:height}
Leave blank width or height will scale the image.
If you don't want to touch the core code:
Make a new file image_size.php in phpwcms_template/inc_script/frontend_render
Here the code would be:
Code: Select all
<?php
// insert non db image sizable
$replace = '<img src="picture/$1" border="0" width="$2" height="$3" alt="" />';
$content["all"] = preg_replace('/\{IMAGE_SIZE:(.*?):(.*?):(.*?)\}/', $replace, $content["all"]);
?>
The perfect one would be:
{IMAGE_FULL:image/name:border:width:height:alt}
Code: Select all
// insert non db image full control
$search[71] = '/\{IMAGE_FULL:(.*?):(.*?):(.*?):(.*?):(.*?)\}/';
$replace[71] = '<img src="picture/$1" border="$2" width="$3" height="$4" alt="$5" />';