if (stripos ( $tpl->copy_template, "{fullimage-" ) !== false) {
$images = array();
preg_match_all('/(img|src)=("|\')[^"\'>]+/i', $row['full_story'], $media);
$data=preg_replace('/(img|src)("|\'|="|=\')(.*)/i',"$3",$media[0]);
foreach($data as $url) {
$info = pathinfo($url);
if (isset($info['extension'])) {
if ($info['filename'] == "spoiler-plus" OR $info['filename'] == "spoiler-minus" OR strpos($info['dirname'], 'engine/data/emoticons') !== false) continue;
$info['extension'] = strtolower($info['extension']);
if (($info['extension'] == 'jpg') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'gif') || ($info['extension'] == 'png')) array_push($images, $url);
}
}
if ( count($images) ) {
$i=0;
foreach($images as $url) {
$i++;
$tpl->copy_template = str_replace( '{fullimage-'.$i.'}', $url, $tpl->copy_template );
$tpl->copy_template = str_replace( '[fullimage-'.$i.']', "", $tpl->copy_template );
$tpl->copy_template = str_replace( '[/fullimage-'.$i.']', "", $tpl->copy_template );
}
}
$tpl->copy_template = preg_replace( "#\[fullimage-(.+?)\](.+?)\[/fullimage-(.+?)\]#is", "", $tpl->copy_template );
$tpl->copy_template = preg_replace( "#\\{fullimage-(.+?)\\}#i", "{THEME}/dleimages/no_image.jpg", $tpl->copy_template );
}