Basically this piece of code grab the first image of the post and display it at another page. If no images, it will show the default image.
How do I modify it to make it display max up to 4 images ?
<?php
$Imagesrc = C('Plugin.IndexPostImage.Image','/images/default.png');
preg_match(
'#\<img.+?src="([^"]*).+?\>#s',
$Sender->EventArguments['Post']->Body,
$images
);
if ($images[1]) {
$Imagesrc = $images[1];
}
$thumbs ='<a class="IndexImg" href="'.
$Sender->EventArguments['Post']->Url .'">'.
Img($Imagesrc, array('title'=>$sline,'class'=>"IndexImg")).'</a>';
echo "$thumbs";