1 to 6 of 6
function get_img_urls($arr,$sel,$num,$field)
{
switch($field)
{
case 'Content':
preg_match_all('/img([^>]*)src="([^"]*)"/i', $arr->get_content(), $m);
if(count($m[2])>0)
{
$img_idxs = $this->select_indices($m[2],$sel,$num);
foreach($img_idxs as $img_idx)
$urls[count($urls)] = htmlspecialchars_decode($m[2][$img_idx]);
}
break;
case 'Description':
preg_match_all('/img([^>]*)src="([^"]*)"/i', $arr->get_description(), $m);
if(count($m[2])>0)
{
$img_idxs = $this->select_indices($m[2],$sel,$num);
foreach($img_idxs as $img_idx)
$urls[count($urls)] = htmlspecialchars_decode($m[2][$img_idx]);
}
break;
case 'Enclosures':
$img_idxs = $this->select_indices($arr,$sel,$num);
foreach($img_idxs as $idx)
{
if(!strcmp($arr[$idx]->get_type(),'image/jpeg'))
$urls[count($urls)] = htmlspecialchars_decode($arr[$idx]->get_link());
else
$urls[count($urls)] = htmlspecialchars_decode($arr[$idx]->get_thumbnail());
}
break;
}
return $urls;
}
1 to 6 of 6