Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $thumbtempsrc = JPATH_ROOT.DIRECTORY_SEPARATOR.'media'.DIRECTORY_SEPARATOR.'k2'.DIRECTORY_SEPARATOR.'items'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.md5("Image".$item->id).'_L.jpg';
- $img_temp = false;
- if(file_exists($thumbtempsrc)){
- $img_temp = true;
- $imgpath = JURI::base().'/media/k2/items/cache/'.md5('Image'.$item->id).'_L.jpg';
- }
- if(!$img_temp){
- $img_temp = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $item->introtext,$matches)?true
- :preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $item->fulltext,$matches);
- $imgpath = ($img_temp ? $matches[1][0]:'');
- }
- $singlarticletemp->image = $imgpath ? $imgpath:'';
- if($singlarticletemp->image && strpos($singlarticletemp->image,'http') === false){
- $singlarticletemp->image = JURI::base().$singlarticletemp->image;
- }
Advertisement
Add Comment
Please, Sign In to add comment