function get_link($num) { if ($this->mode == 'com_content') { // load necessary com_content View class if (!class_exists('NSP_GK5_com_content_View')) { require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_content/view'); } return NSP_GK5_com_content_View::itemLink($this->parent->content[$num], $this->parent->config); } else { if ($this->mode == 'com_k2') { // load necessary k2 View class if (!class_exists('NSP_GK5_com_k2_View')) { require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_k2/view'); } return NSP_GK5_com_k2_View::itemLink($this->parent->content[$num], $this->parent->config); } else { return false; } } }
function get_link($num) { if ($this->mode == 'com_content') { // load necessary com_content View class if (!class_exists('NSP_GK5_com_content_View')) { require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_content/view'); } return NSP_GK5_com_content_View::itemLink($this->parent->content[$num], $this->parent->config); } else { if ($this->mode == 'com_k2') { // load necessary k2 View class if (!class_exists('NSP_GK5_com_k2_View')) { require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_k2/view'); } return NSP_GK5_com_k2_View::itemLink($this->parent->content[$num], $this->parent->config); } else { if ($this->mode == 'com_easyblog') { return urldecode(JRoute::_('index.php?option=com_easyblog&view=entry&id=' . $this->parent->content[$num]['id'])); } else { return false; } } } }
static function lists($config, $item, $num) { $odd = $num % 2; if ($config['news_short_pages'] > 0) { $text = ''; $title = ''; if ($config['list_text_limit'] > 0) { $text = NSP_GK5_Utils::cutText(strip_tags(preg_replace("/\\{.+?\\}/", "", $item['text'])), $config, 'list_text_limit', '…'); $text = preg_replace("/\\{.+?\\}/", "", $text); if (JString::strlen($text) > 0) { $text = '<p>' . $text . '</p>'; } } if ($config['list_title_limit'] > 0) { $title = htmlspecialchars($item['title']); $title = NSP_GK5_Utils::cutText($title, $config, 'list_title_limit', '…'); $title = str_replace('"', """, $title); $link = NSP_GK5_com_k2_View::itemLink($item); if (JString::strlen($title) > 0) { $title = '<h4><a href="' . $link . '" title="' . htmlspecialchars($item['title']) . '">' . $title . '</a></h4>'; } } // creating rest news list return '<li class="' . ($odd == 1 ? 'odd' : 'even') . '">' . $title . $text . '</li>'; } else { return ''; } }
function get_link($num) { if ($this->mode == 'com_content') { // load necessary com_content View class if (!class_exists('NSP_GK5_com_content_View')) { require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_content/view'); } return NSP_GK5_com_content_View::itemLink($this->parent->content[$num], $this->parent->config); } else { if ($this->mode == 'com_k2') { // load necessary k2 View class if (!class_exists('NSP_GK5_com_k2_View')) { require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_k2/view'); } return NSP_GK5_com_k2_View::itemLink($this->parent->content[$num], $this->parent->config); } else { if ($this->mode == 'com_easyblog') { return urldecode(JRoute::_('index.php?option=com_easyblog&view=entry&id=' . $this->parent->content[$num]['id'])); } else { if ($this->mode == 'com_virtuemart') { $itemid = $this->parent->config['vm_itemid']; $link = 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->parent->content[$num]['id'] . '&virtuemart_category_id=' . $this->parent->content[$num]['cid'] . '&Itemid=' . $itemid; // return $link; } else { return false; } } } } }
static function lists($config, $item, $num) { $odd = $num % 2; if ($config['news_short_pages'] > 0) { $text = ''; $title = ''; $image = ''; $readmore = ''; $link = NSP_GK5_com_k2_View::itemLink($item); if ($config['list_text_limit'] > 0) { $text = NSP_GK5_Utils::cutText(strip_tags(preg_replace("/\\{.+?\\}/", "", $item['text'])), $config, 'list_text_limit', '…'); $text = preg_replace("/\\{.+?\\}/", "", $text); if (JString::strlen($text) > 0) { $text = '<p>' . $text . '</p>'; } } if ($config['list_title_limit'] > 0) { $title = htmlspecialchars($item['title']); $title = NSP_GK5_Utils::cutText($title, $config, 'list_title_limit', '…'); $title = str_replace('"', """, $title); if (JString::strlen($title) > 0) { $title = '<h4><a href="' . $link . '" title="' . htmlspecialchars($item['title']) . '">' . $title . '</a></h4>'; } } if ($config['links_image'] == 1) { $image = NSP_GK5_com_k2_View::image($config, $item, false, false, true); } if ($config['links_readmore'] == 1) { $readmore = '<a class="readon" href="' . $link . '">' . (trim($config['readmore_text']) != '' ? $config['readmore_text'] : JText::_('MOD_NEWS_PRO_GK5_NSP_READMORE')) . '</a>'; } // creating rest news list return '<li class="' . ($odd == 1 ? 'odd' : 'even') . '">' . $image . ($image != '' ? '<div>' . $title . $text . $readmore . '</div>' : $title . $text . $readmore) . '</li>'; } else { return ''; } }
static function image($config, $item, $only_url = false, $pm = false, $links = false) { if ($item['type'] == 'photo' && ($config['news_content_image_pos'] != 'disabled' || $pm || $links)) { $IMG_SOURCE = ''; $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'; } } 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 . '><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' && !$links ? '<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' && !$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 ''; } }