Example #1
0
File: view.php Project: pwfir/klzm1
 static function image($config, $item, $only_url = false, $pm = false, $links = false)
 {
     if ($config['news_content_image_pos'] != 'disabled' || $pm || $links) {
         $item['title'] = str_replace('"', """, $item['title']);
         $IMG_SOURCE = '';
         $IMG_LINK = static::itemLink($item);
         $uri = JURI::getInstance();
         // get image from Joomla! Images and Links settings
         $IMG_SOURCE = static::originalImage($config, $item);
         //
         $full_size_img = $IMG_SOURCE;
         //
         if ($config['create_thumbs'] == 1 && $IMG_SOURCE != '') {
             // try to override standard image
             if (strpos($IMG_SOURCE, 'http://') == FALSE) {
                 $img_file = NSP_GK5_Thumbs::createThumbnail($IMG_SOURCE, $config, false, false, '', $links);
                 if (is_array($img_file)) {
                     $IMG_SOURCE = $uri->root() . 'modules/mod_news_pro_gk5/cache/' . $img_file[1];
                 } elseif ($config['create_thumbs'] == 1) {
                     jimport('joomla.filesystem.file');
                     if (is_file(JPATH_ROOT . DS . 'modules' . DS . 'mod_news_pro_gk5' . DS . 'cache' . DS . 'default' . DS . 'default' . $config['module_id'] . '.png')) {
                         $IMG_SOURCE = $uri->root() . 'modules/mod_news_pro_gk5/cache/default/default' . $config['module_id'] . '.png';
                     }
                 } else {
                     $IMG_SOURCE = '';
                 }
             }
         } elseif ($config['create_thumbs'] == 1) {
             jimport('joomla.filesystem.file');
             if (is_file(JPATH_ROOT . DS . 'modules' . DS . 'mod_news_pro_gk5' . DS . 'cache' . DS . 'default' . DS . 'default' . $config['module_id'] . '.png')) {
                 $IMG_SOURCE = $uri->root() . 'modules/mod_news_pro_gk5/cache/default/default' . $config['module_id'] . '.png';
             }
         }
         // Retrieve alt text
         $alt_text = NSP_GK5_com_content_View::getAltText($config, $item);
         return NSP_GK5_com_content_View::getImageHTML($only_url, $IMG_SOURCE, $links, $config, $IMG_LINK, $full_size_img, $alt_text);
     } else {
         return '';
     }
 }