Hi, I was having a problem with this script.
I was using a template for a Ditto call ([+paginaAfbeelding+] is a TV with an image-url)
[+phx:if=`[+paginaAfbeelding+]`:ne=``:then=`
<div class="samenvatting_afbeelding" style="width: [+paginaAfbeelding:imgmaxwidth=`175`+]px;">
<a href="[~[+id+]~]"><img src="[+paginaAfbeelding+]" border="0" width="[+paginaAfbeelding:imgmaxwidth=`175`+]" title="lees verder..."></a>
</div>
`+]
Problem was, even though I had a phx statement to check if the TV was empty, the getimagesize() function would get called no matter what.... and I would get a MODx error, stating that this function getimagesize() cannot be empty....
I changed the code in the first post to this (just showing one case...)
case "imgmaxwidth":
if($output != ’’){list($width, $height, $type, $attr) = getimagesize($output);
$output = ($width < intval($modifier_value[$i])) ? $width : intval($modifier_value[$i]);}
break;
Which solved my problem
You guys probably have better If statements (!$output) or something, but I’m on a basic level php... so change it if you want....
Glad I solved it myself, cause I was going crazy!
still having some problems with spaces in folder names with the %20.... but gonna try to fix that myself too...