=====Enhanced Image Action=====
>>==See also:==
Documentation: EnhancedImageActionInfo.>>This is the development page for the enhanced image action.::c::
The code here below is just a quick modification to the offical image action code. Only works from release 1.1.6.0!
%%(php)
$value)
{
if ($param == 'src' and $vars['url'] == '') {$vars['url']=$value;}
if ($param == 'title') {$title=$this->htmlspecialchars_ent($vars['title']);}
if ($param == 'class') {$class=$this->htmlspecialchars_ent($vars['class']);}
if ($param == 'alt') {$alt=$this->htmlspecialchars_ent($vars['alt']);}
if ($param == 'width') {$width=$this->htmlspecialchars_ent($vars['width']);}
if ($param == 'height') {$height=$this->htmlspecialchars_ent($vars['height']);}
if ($param == 'link') {$link=$this->cleanUrl(trim($vars['link']));}
}
}
//sanatizing url and proofing if it is an image
$url = $this->cleanUrl(trim($vars['url']));
$image = getimagesize($url);
//if it is an image, prepare the output
if ((is_array($image)) && ($alt))
{
if (!is_length($width) || !is_length($height)) {
$width = $image[0];
$height = $image[1];
}
$output.="";
//link?
if ($link && !$title) {$output = $this->Link($link, "", $output, 1, 0, 0);}
elseif ($link && $title) {$output = $this->Link($link, "", $output, 1, 0, $title);}
//make the output save and print it
$output = $this->ReturnSafeHTML($output);
print($output);
}
elseif (!$alt) {echo 'The necessary parameter alt was not provided';}
else {echo 'The image could not be found or it was no image. Please check the url';}
?>
%%
Note that we have to change the function Link in the wikka.php, too:
changing:
%%(php) return $url ? "$text$external_link_tail" : $text;%%
to:
%%(php)return $url ? "$text$external_link_tail" : $text;%%
----
CategoryDevelopmentActions