コード例 #1
0
ファイル: view.php プロジェクト: pwfir/klzm1
 static function image($config, $item, $only_url = false, $pm = false, $links = false)
 {
     if (!($config['news_content_image_pos'] != 'disabled' || $pm || $links)) {
         return '';
     }
     $news_title = str_replace('"', """, $item['title']);
     $IMG_SOURCE = 'media' . DS . 'com_hikashop' . DS . 'upload' . DS . $item['image'];
     $IMG_LINK = static::itemLink($item, $config);
     //
     $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, true);
             if (is_array($img_file)) {
                 $uri = JURI::getInstance();
                 $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';
         }
     }
     //
     return NSP_GK5_com_hikashop_View::getImageHTML($only_url, $IMG_SOURCE, $links, $config, $IMG_LINK, $full_size_img);
 }