[TYPO3-UG Denmark] Use pictures from the media-field in an extension

Jeppe Donslund jeppe at donslund.net
Thu Nov 19 21:29:02 CET 2009


Hi.

 

I try to get the pictures from a media-field on a page. But the pictures
won't show.

 

I get the pictures in an array.

The I run through the array except for det 1 picture.

 

for($i=1;$i<count($billeder);$i++){

 
$content .= '<hr>';

 
$imgConf['file'] = 'uploads/tx_jdhsgallery/'.$billeder[$i];

 
$content .= $size[0].', '.$size[1].'<br>';

 
$size = getimagesize('uploads/tx_jdhsgallery/'.$billeder[$i]);

 
$imgConf['file.']['width'] = $size[0];

 
//$imgConf['file.']['maxH'] = 200;

 
/*if(file_exists($imgConf['file'])){

 
$content .= 'Findes';

 
}*/

 
$imgConf['params'] = 'id="pic'.$i.'" onClick="changePic('.$i.', 0,
\'pic'.$i.'\')"';

 
$imageFile = $this->cObj->cObjGetSingle('IMAGE', $imgConf);

 

 
$content .= '<div class="gallery_pic"
onMouseOver="document.body.style.cursor=\'hand\'"
onMouseOut="document.body.style.cursor=\'default\'">'.$imageFile.'</div><br>
';

 
$imageFile = '';

 
}

 

As long a $imgConf['file.']['width'] = $size[0] is like this there aren o
problems, but if Iwould like to have width = 150px or anything else that is
not the original size. The scr, width and height variables in the img-tag
empty.

 

I can't figure out why.

 

 

Best regards

Jeppe Donslund



More information about the TYPO3-UG-Denmark mailing list