<img src="[[phpthumbof? &input=`[[processTV? &myId=`[[+id]]` &myTV=`Afbeelding`]]` &options=`&w=150&h=150&zc=1`]]" class="kader" />
This question has been answered by sitsol. See the first response.
Quick question, why is the code below not working? I don't get the image showed.
<img src="[[phpthumbof? &input=`[[processTV? &myId=`[[+id]]` &myTV=`Afbeelding`]]` &options=`&w=150&h=150&zc=1`]]" class="kader">
public function setInput($input) {
/* get absolute url of image */
if (strpos($input,'/') != 0 && strpos($input,'http') != 0) {
$input = $this->modx->context->getOption('base_url').$input;
} else {
$input = urldecode($input);
}
$hasQuery = strpos($input,'?');
if ($hasQuery !== false) {
$this->options['queryString'] = substr($input,$hasQuery+1);
$input = substr($input,0,$hasQuery);
}
if (!file_exists($input) && !empty($this->config['checkRemotelyIfNotFound'])) {
$input = $this->modx->context->getOption('url_scheme',MODX_URL_SCHEME).$this->modx->context->getOption('http_host',MODX_HTTP_HOST).urlencode($input);
}
$this->input = $input;
return $this->input;
} public function setInput($input) {
/* get absolute url of image */
if (strpos($input,'/') != 0 && strpos($input,'http') != 0) {
$input = $this->modx->context->getOption('base_url').$input;
} else {
$input = urldecode($input);
}
// Modified by SitSol - if context not default, we must reset the url to default url
// ex. /en/assets/userfiles => /assets/userfiles
$working_context = $this->modx->resource->get('context_key');
if (strcmp($working_context, "web") != 0){
$input = substr($input, 3);
}
//---- end modified SitSol
$hasQuery = strpos($input,'?');
if ($hasQuery !== false) {
$this->options['queryString'] = substr($input,$hasQuery+1);
$input = substr($input,0,$hasQuery);
}
if (!file_exists($input) && !empty($this->config['checkRemotelyIfNotFound'])) {
$input = $this->modx->context->getOption('url_scheme',MODX_URL_SCHEME).$this->modx->context->getOption('http_host',MODX_HTTP_HOST).urlencode($input);
}
$this->input = $input;
return $this->input;
}
IMHO you shouldn't loose your time in debuging phpthumbof.
Have a look to pThumb package instead !
more info why here : https://github.com/oo12/phpThumbOf/wiki/Thumb-War