SHOW:
|
|
- or go back to the newest paste.
| 1 | - | $thumbtempsrc = JPATH_ROOT.DIRECTORY_SEPARATOR.'media'.DIRECTORY_SEPARATOR.'k2'.DIRECTORY_SEPARATOR.'items'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.md5("Image".$articletemp->id).'_L.jpg';
|
| 1 | + | $thumbtempsrc = JPATH_ROOT.DIRECTORY_SEPARATOR.'media'.DIRECTORY_SEPARATOR.'k2'.DIRECTORY_SEPARATOR.'items'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.md5("Image".$item->id).'_L.jpg';
|
| 2 | - | |
| 2 | + | $img_temp = false; |
| 3 | - | if(file_exists($thumbtempsrc)){
|
| 3 | + | if(file_exists($thumbtempsrc)){
|
| 4 | - | $img_temp = true; |
| 4 | + | $img_temp = true; |
| 5 | - | $imgpath = JURI::base().'/media/k2/items/cache/'.md5('Image'.$articletemp->id).'_L.jpg';
|
| 5 | + | $imgpath = JURI::base().'/media/k2/items/cache/'.md5('Image'.$item->id).'_L.jpg';
|
| 6 | - | } |
| 6 | + | } |
| 7 | ||
| 8 | if(!$img_temp){
| |
| 9 | $img_temp = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $item->introtext,$matches)?true
| |
| 10 | :preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $item->fulltext,$matches);
| |
| 11 | $imgpath = ($img_temp ? $matches[1][0]:''); | |
| 12 | } | |
| 13 | ||
| 14 | $singlarticletemp->image = $imgpath ? $imgpath:''; | |
| 15 | ||
| 16 | if($singlarticletemp->image && strpos($singlarticletemp->image,'http') === false){
| |
| 17 | $singlarticletemp->image = JURI::base().$singlarticletemp->image; | |
| 18 | } |