Exemplo n.º 1
0
Arquivo: view.php Projeto: pwfir/klzm1
 static function image($config, $item, $only_url = false, $pm = false, $links = false)
 {
     if (!($config['news_content_image_pos'] != 'disabled' || $pm || $links)) {
         return '';
     }
     $IMG_SOURCE = '';
     $item['title'] = str_replace('"', """, $item['title']);
     $uri = JURI::getInstance();
     $IMG_LINK = static::itemLink($item, $config);
     //
     if (trim($item['image']) != '') {
         $image_path = str_replace(array('user:'******'post:'), '', $item['image']);
         if (stripos($item['image'], 'user:'******'images/easyblog_images/' . $image_path;
         } else {
             $IMG_SOURCE = 'images/easyblog_articles/' . $image_path;
         }
     } else {
         // set image to first in article content
         $IMG_SOURCE = NSP_GK5_com_easyblog_View::getImageFromText($item['text']);
     }
     //
     $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';
         }
     }
     return NSP_GK5_com_easyblog_View::getImageHTML($only_url, $IMG_SOURCE, $links, $config, $IMG_LINK, $full_size_img);
 }
Exemplo n.º 2
0
Arquivo: view.php Projeto: 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 '';
     }
 }
Exemplo n.º 3
0
Arquivo: view.php Projeto: pwfir/klzm1
 static function image($config, $item, $only_url = false, $pm = false, $links = false)
 {
     if (!($item['type'] == 'photo' && ($config['news_content_image_pos'] != 'disabled' || $pm || $links))) {
         return '';
     }
     $IMG_SOURCE = '';
     $IMG_LINK = static::itemLink($item, $config);
     $uri = JURI::getInstance();
     //
     if (JFile::exists(JPATH_SITE . DS . $item['image'])) {
         $IMG_SOURCE = $item['image'];
     }
     //
     $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)) {
                 $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_jomsocial_View::getImageHTML($only_url, $IMG_SOURCE, $links, $config, $IMG_LINK, $full_size_img);
 }
Exemplo n.º 4
0
Arquivo: view.php Projeto: 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);
 }
Exemplo n.º 5
0
 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 = $item['url'];
         //
         $uri = JURI::getInstance();
         // get image from Joomla! Images and Links settings
         $IMG_SOURCE = $item['image'];
         //
         $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)) {
                     $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';
             }
         }
         if ($only_url) {
             return $IMG_SOURCE;
         } else {
             //
             if ($IMG_SOURCE != '') {
                 $class = '';
                 if (!$links) {
                     $class = ' t' . $config['news_content_image_pos'] . ' f' . $config['news_content_image_float'];
                 }
                 $size = '';
                 $margins = '';
                 //
                 if (!$links && $config['responsive_images'] == 1) {
                     $class .= ' gkResponsive';
                 }
                 //
                 if (!$links) {
                     if ($config['img_width'] != 0 && !$config['img_keep_aspect_ratio'] && $config['responsive_images'] == 0) {
                         $size .= 'width:' . $config['img_width'] . 'px;';
                     }
                     if ($config['img_height'] != 0 && !$config['img_keep_aspect_ratio'] && $config['responsive_images'] == 0) {
                         $size .= 'height:' . $config['img_height'] . 'px;';
                     }
                     if ($config['img_margin'] != '') {
                         $margins = ' style="margin:' . $config['img_margin'] . ';"';
                     }
                 } else {
                     if ($config['links_img_width'] != 0 && !$config['img_keep_aspect_ratio'] && $config['responsive_images'] == 0) {
                         $size .= 'width:' . $config['links_img_width'] . 'px;';
                     }
                     if ($config['links_img_height'] != 0 && !$config['img_keep_aspect_ratio'] && $config['responsive_images'] == 0) {
                         $size .= 'height:' . $config['links_img_height'] . 'px;';
                     }
                     if ($config['links_img_margin'] != '') {
                         $margins = ' style="margin:' . $config['links_img_margin'] . ';"';
                     }
                 }
                 //
                 if ($config['news_image_link'] == 1 || $links) {
                     if ($config['news_image_modal'] == 1) {
                         return $config['news_content_image_pos'] == 'center' && !$links ? '<div class="center' . $class . '"><a href="' . $full_size_img . '" class="modal nspImageWrapper' . $class . '"' . $margins . ' target="' . $config['open_links_window'] . '"><img class="nspImage" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '"  /></a></div>' : '<a href="' . $full_size_img . '" class="modal nspImageWrapper' . $class . '"' . $margins . ' target="' . $config['open_links_window'] . '"><img class="nspImage' . $class . '" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '"  /></a>';
                     } else {
                         return $config['news_content_image_pos'] == 'center' && !$links ? '<div class="center' . $class . '"><a href="' . $IMG_LINK . '" class="nspImageWrapper' . $class . '"' . $margins . ' target="' . $config['open_links_window'] . '"><img class="nspImage" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '"  /></a></div>' : '<a href="' . $IMG_LINK . '" class="nspImageWrapper' . $class . '"' . $margins . ' target="' . $config['open_links_window'] . '"><img class="nspImage' . $class . '" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '"  /></a>';
                     }
                 } else {
                     return $config['news_content_image_pos'] == 'center' && !$links ? '<div class="center' . $class . '"><span class="nspImageWrapper' . $class . '"' . $margins . '><img class="nspImage" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" ' . $size . ' /></span></div>' : '<span class="nspImageWrapper' . $class . '"' . $margins . '><img class="nspImage' . $class . '" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '" /></span>';
                 }
             } else {
                 return '';
             }
         }
     } else {
         return '';
     }
 }
Exemplo n.º 6
0
 static function image($config, $item, $only_url = false, $pm = false)
 {
     if ($config['news_content_image_pos'] != 'disabled' || $pm) {
         $IMG_SOURCE = '';
         $item['title'] = str_replace('"', "&quot;", $item['title']);
         $uri = JURI::getInstance();
         //
         if (!$config['k2_image_size']) {
             $config['k2_image_size'] = 'Generic';
         }
         //
         if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $item['id']) . '_' . $config['k2_image_size'] . '.jpg')) {
             $IMG_SOURCE = JURI::root() . 'media/k2/items/cache/' . md5("Image" . $item['id']) . '_' . $config['k2_image_size'] . '.jpg';
         } else {
             // set image to first in article content
             if (preg_match('/\\<img.*src=.*?\\>/', $item['text'])) {
                 $imgStartPos = JString::strpos($item['text'], 'src="');
                 if ($imgStartPos) {
                     $imgEndPos = JString::strpos($item['text'], '"', $imgStartPos + 5);
                 }
                 if ($imgStartPos > 0) {
                     $IMG_SOURCE = JString::substr($item['text'], $imgStartPos + 5, $imgEndPos - ($imgStartPos + 5));
                 }
             }
         }
         //
         $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(str_replace(JURI::root() . 'media', 'media', $IMG_SOURCE), $config, true);
                 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';
             }
         }
         if ($only_url) {
             return $IMG_SOURCE;
         } else {
             //
             if ($IMG_SOURCE != '') {
                 $class = ' t' . $config['news_content_image_pos'] . ' f' . $config['news_content_image_float'];
                 $size = '';
                 $margins = '';
                 //
                 if ($config['responsive_images'] == 1) {
                     $class .= ' gkResponsive';
                 }
                 //
                 if ($config['img_width'] != 0 && !$config['img_keep_aspect_ratio'] && $config['responsive_images'] == 0) {
                     $size .= 'width:' . $config['img_width'] . 'px;';
                 }
                 if ($config['img_height'] != 0 && !$config['img_keep_aspect_ratio'] && $config['responsive_images'] == 0) {
                     $size .= 'height:' . $config['img_height'] . 'px;';
                 }
                 if ($config['img_margin'] != '') {
                     $margins = ' style="margin:' . $config['img_margin'] . ';"';
                 }
                 //
                 if ($config['news_image_link'] == 1) {
                     if ($config['news_image_modal'] == 1) {
                         return $config['news_content_image_pos'] == 'center' ? '<div class="center' . $class . '"><a href="' . $full_size_img . '" class="modal nspImageWrapper' . $class . '"' . $margins . '><img class="nspImage" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '"  /></a></div>' : '<a href="' . $full_size_img . '" class="modal nspImageWrapper' . $class . '"' . $margins . '><img class="nspImage' . $class . '" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '"  /></a>';
                     } else {
                         $link = NSP_GK5_com_k2_View::itemLink($item);
                         return $config['news_content_image_pos'] == 'center' ? '<div class="center' . $class . '"><a href="' . $link . '" class="nspImageWrapper' . $class . '"' . $margins . '><img class="nspImage" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '"  /></a></div>' : '<a href="' . $link . '" class="nspImageWrapper' . $class . '"' . $margins . '><img class="nspImage' . $class . '" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '"  /></a>';
                     }
                 } else {
                     return $config['news_content_image_pos'] == 'center' ? '<div class="center' . $class . '"><span class="nspImageWrapper' . $class . '"' . $margins . '><img class="nspImage" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" ' . $size . ' /></span></div>' : '<span class="nspImageWrapper' . $class . '"' . $margins . '><img class="nspImage' . $class . '" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '" /></span>';
                 }
             } else {
                 return '';
             }
         }
     } else {
         return '';
     }
 }
Exemplo n.º 7
0
 static function image($config, $item, $only_url = false, $pm = false, $links = false)
 {
     if ($config['news_content_image_pos'] != 'disabled' || $pm || $links) {
         $IMG_SOURCE = '';
         $item['title'] = str_replace('"', "&quot;", $item['title']);
         $uri = JURI::getInstance();
         //
         if (!$config['easyblog_image_size']) {
             $config['easyblog_image_size'] = 'original';
         }
         //
         if (trim($item['image']) != '') {
             $image_object = json_decode($item['image']);
             $original_path = false;
             if ($config['easyblog_image_size'] == 'original') {
                 $original_path = $image_object->url;
             } elseif ($config['easyblog_image_size'] == 'thumbnail') {
                 $original_path = $image_object->thumbnail->url;
             } elseif ($config['easyblog_image_size'] == 'icon') {
                 $original_path = $image_object->icon->url;
             }
             if ($original_path) {
                 $IMG_SOURCE = substr($original_path, stripos($original_path, 'images/easyblog_images/'));
             } else {
                 $IMG_SOURCE = '';
             }
         } else {
             // set image to first in article content
             if (preg_match('/\\<img.*src=.*?\\>/', $item['text'])) {
                 $imgStartPos = JString::strpos($item['text'], 'src="');
                 if ($imgStartPos) {
                     $imgEndPos = JString::strpos($item['text'], '"', $imgStartPos + 5);
                 }
                 if ($imgStartPos > 0) {
                     $IMG_SOURCE = JString::substr($item['text'], $imgStartPos + 5, $imgEndPos - ($imgStartPos + 5));
                 }
             }
         }
         //
         $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';
             }
         }
         if ($only_url) {
             return $IMG_SOURCE;
         } else {
             //
             if ($IMG_SOURCE != '') {
                 $class = '';
                 if (!$links) {
                     $class = ' t' . $config['news_content_image_pos'] . ' f' . $config['news_content_image_float'];
                 }
                 $size = '';
                 $margins = '';
                 //
                 if (!$links && $config['responsive_images'] == 1) {
                     $class .= ' gkResponsive';
                 }
                 //
                 if (!$links) {
                     if ($config['img_width'] != 0 && !$config['img_keep_aspect_ratio'] && $config['responsive_images'] == 0) {
                         $size .= 'width:' . $config['img_width'] . 'px;';
                     }
                     if ($config['img_height'] != 0 && !$config['img_keep_aspect_ratio'] && $config['responsive_images'] == 0) {
                         $size .= 'height:' . $config['img_height'] . 'px;';
                     }
                     if ($config['img_margin'] != '') {
                         $margins = ' style="margin:' . $config['img_margin'] . ';"';
                     }
                 } else {
                     if ($config['links_img_width'] != 0 && !$config['img_keep_aspect_ratio'] && $config['responsive_images'] == 0) {
                         $size .= 'width:' . $config['links_img_width'] . 'px;';
                     }
                     if ($config['links_img_height'] != 0 && !$config['img_keep_aspect_ratio'] && $config['responsive_images'] == 0) {
                         $size .= 'height:' . $config['links_img_height'] . 'px;';
                     }
                     if ($config['links_img_margin'] != '') {
                         $margins = ' style="margin:' . $config['links_img_margin'] . ';"';
                     }
                 }
                 //
                 if ($config['news_image_link'] == 1) {
                     if ($config['news_image_modal'] == 1) {
                         return $config['news_content_image_pos'] == 'center' && !$links ? '<div class="center' . $class . '"><a href="' . $full_size_img . '" class="modal nspImageWrapper' . $class . '"' . $margins . ' target="' . $config['open_links_window'] . '"><img class="nspImage" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '"  /></a></div>' : '<a href="' . $full_size_img . '" class="modal nspImageWrapper' . $class . '"' . $margins . ' target="' . $config['open_links_window'] . '"><img class="nspImage' . $class . '" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '"  /></a>';
                     } else {
                         $link = static::itemLink($item);
                         return $config['news_content_image_pos'] == 'center' && !$links ? '<div class="center' . $class . '"><a href="' . $link . '" class="nspImageWrapper' . $class . '"' . $margins . ' target="' . $config['open_links_window'] . '"><img class="nspImage" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '"  /></a></div>' : '<a href="' . $link . '" class="nspImageWrapper' . $class . '"' . $margins . ' target="' . $config['open_links_window'] . '"><img class="nspImage' . $class . '" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '"  /></a>';
                     }
                 } else {
                     return $config['news_content_image_pos'] == 'center' && !$links ? '<div class="center' . $class . '"><span class="nspImageWrapper' . $class . '"' . $margins . '><img class="nspImage" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" ' . $size . ' /></span></div>' : '<span class="nspImageWrapper' . $class . '"' . $margins . '><img class="nspImage' . $class . '" src="' . $IMG_SOURCE . '" alt="' . htmlspecialchars($item['title']) . '" style="' . $size . '" /></span>';
                 }
             } else {
                 return '';
             }
         }
     } else {
         return '';
     }
 }