get('slides'))); foreach ($items as $i => $item) { if (!$item->imgname) { unset($items[$i]); continue; } // check if the slide is published if (isset($item->state) && $item->state == '0') { unset($items[$i]); continue; } // check the slide start date if (isset($item->startdate) && $item->startdate) { // if (date("d M Y") < $item->startdate) { if (time() < strtotime($item->startdate)) { unset($items[$i]); continue; } } // check the slide end date if (isset($item->enddate) && $item->enddate) { // if (date("d M Y") > $item->enddate) { if (time() > strtotime($item->enddate)) { unset($items[$i]); continue; } } if (isset($item->slidearticleid) && $item->slidearticleid) { $item = self::getArticle($item, $params); } else { $item->article = null; } // create new images for mobile if ($params->get('usemobileimage', '0')) { $resolutions = explode(',', $params->get('mobileimageresolution', '640')); foreach ($resolutions as $resolution) { self::resizeImage($item->imgname, (int)$resolution, '', (int)$resolution, ''); } } if (stristr($item->imgname, "http")) { $item->imgthumb = $item->imgname; } else { // renomme le fichier $thumbext = explode(".", $item->imgname); $thumbext = end($thumbext); // crée la miniature if ($params->get('thumbnails', '1') == '1' && $params->get('autocreatethumbs','1')) { $item->imgthumb = \Joomla\CMS\Uri\Uri::base(true) . '/' . self::resizeImage($item->imgname, $params->get('thumbnailwidth', '182'), $params->get('thumbnailheight', '187')); } else { $thumbfile = str_replace(\Joomla\CMS\Filesystem\File::getName($item->imgname), "th/" . \Joomla\CMS\Filesystem\File::getName($item->imgname), $item->imgname); $thumbfile = str_replace("." . $thumbext, "_th." . $thumbext, $thumbfile); $item->imgthumb = \Joomla\CMS\Uri\Uri::base(true) . '/' . $thumbfile; } $item->imgname = \Joomla\CMS\Uri\Uri::base(true) . '/' . $item->imgname; } // set the videolink if ($item->imgvideo) $item->imgvideo = self::setVideolink($item->imgvideo); // manage the title and description if (stristr($item->imgcaption, "||")) { $splitcaption = explode("||", $item->imgcaption); $item->imgcaption = '
'; } // route the url if (strcasecmp(substr($item->imglink, 0, 4), 'http') && (strpos($item->imglink, 'index.php?') !== false)) { $item->imglink = \Joomla\CMS\Router\Route::_($item->imglink, true, false); } else { $item->imglink = \Joomla\CMS\Router\Route::_($item->imglink); } if (!isset($item->imgtitle)) $item->imgtitle = ''; } return $items; } static function getArticle(&$item, $params) { $com_path = JPATH_SITE . '/components/com_content/'; require_once $com_path . 'router.php'; require_once $com_path . 'helpers/route.php'; \Joomla\CMS\MVC\Model\BaseDatabaseModel::addIncludePath($com_path . '/models', 'ContentModel'); self::$_params = $params; // Access filter $access = !\Joomla\CMS\Component\ComponentHelper::getParams('com_content')->get('show_noauth'); $authorised = \Joomla\CMS\Access\Access::getAuthorisedViewLevels(\Joomla\CMS\Factory::getUser()->get('id')); // Get an instance of the generic articles model $articles = \Joomla\CMS\MVC\Model\BaseDatabaseModel::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // Set application parameters in model $app = \Joomla\CMS\Factory::getApplication(); $appParams = $app->getParams(); $articles->setState('params', $appParams); $articles->setState('filter.published', 1); $articles->setState('filter.article_id', $item->slidearticleid); $items2 = $articles->getItems(); $item->article = $items2[0]; $item->article->text = \Joomla\CMS\HTML\HTMLHelper::_('content.prepare', $item->article->introtext); $item->article->text = self::truncate($item->article->text, $params->get('articlelength', '150')); // $item->article->text = \Joomla\CMS\HTML\HTMLHelper::_('string.truncate',$item->article->introtext,'150'); // set the item link to the article depending on the user rights if ($access || in_array($item->article->access, $authorised)) { // We know that user has the privilege to view the article $item->slug = $item->article->id . ':' . $item->article->alias; $item->catslug = $item->article->catid ? $item->article->catid . ':' . $item->article->category_alias : $item->article->catid; $item->article->link = \Joomla\CMS\Router\Route::_(\Joomla\Component\Content\Site\Helper\RouteHelper::getArticleRoute($item->slug, $item->catslug)); } else { $app = \Joomla\CMS\Factory::getApplication(); $menu = $app->getMenu(); $menuitems = $menu->getItems('link', 'index.php?option=com_users&view=login'); if (isset($menuitems[0])) { $Itemid = $menuitems[0]->id; } elseif (JRequest::getInt('Itemid') > 0) { $Itemid = JRequest::getInt('Itemid'); } $item->article->link = \Joomla\CMS\Router\Route::_('index.php?option=com_users&view=login&Itemid=' . $Itemid); } return $item; } /** * Get a list of the items. * * @param \Joomla\Registry\Registry $params The module options. * * @return array */ static function getItemsFromfolder(&$params) { self::$_params = $params; $authorisedExt = array('png', 'jpg', 'JPG', 'JPEG', 'jpeg', 'bmp', 'tiff', 'gif'); $items = json_decode(str_replace("|qq|", "\"", $params->get('slidesfromfolder'))); foreach ($items as & $item) { // $item->imgname = str_replace(\Joomla\CMS\Uri\Uri::base(), '', $item->imgname); $item->imgthumb = ''; $item->imgname = trim($item->imgname, '/'); $item->imgname = trim($item->imgname, '\\'); // create new images for mobile if ($params->get('usemobileimage', '0')) { self::resizeImage($item->imgname, $params->get('mobileimageresolution', '640'), '', $params->get('mobileimageresolution', '640'), ''); } if ($params->get('thumbnails', '1') == '1') $item->imgthumb = \Joomla\CMS\Uri\Uri::base(true) . '/' . self::resizeImage($item->imgname, $params->get('thumbnailwidth', '100'), $params->get('thumbnailheight', '75')); $thumbext = explode(".", $item->imgname); $thumbext = end($thumbext); // set the variables $item->imgvideo = null; $item->slideselect = null; $item->slideselect = null; $item->imgcaption = null; $item->article = null; $item->slidearticleid = null; $item->imgalignment = null; $item->imgtarget = 'default'; $item->imgtime = null; $item->imglink = null; $item->imgtitle = null; if (!in_array(strToLower(\Joomla\CMS\Filesystem\File::getExt($item->imgname)), $authorisedExt)) continue; // load the image data from txt $item = self::getImageDataFromfolder($item, $params); $item->imgname = \Joomla\CMS\Uri\Uri::base(true) . '/' . $item->imgname; // route the url if (strcasecmp(substr($item->imglink, 0, 4), 'http') && (strpos($item->imglink, 'index.php?') !== false)) { $item->imglink = \Joomla\CMS\Router\Route::_($item->imglink, true, false); } else { $item->imglink = \Joomla\CMS\Router\Route::_($item->imglink); } } return $items; } static function getItemsAutoloadfolder(&$params) { self::$_params = $params; $authorisedExt = array('png', 'jpg', 'JPG', 'JPEG', 'jpeg', 'bmp', 'tiff', 'gif'); $folder = trim($params->get('autoloadfoldername'), '/'); if (file_exists($folder . '/labels.txt')) { $items = self::loadImagesFromFolder($folder); } else { $items = \Joomla\CMS\Filesystem\Folder::files($folder, '.jpg|.png|.jpeg|.gif|.JPG|.JPEG|.jpeg', false, true); foreach ($items as $i => $name) { $item = new stdClass(); // $item->imgname = str_replace(\Joomla\CMS\Uri\Uri::base(),'', $item->imgname); $item->imgthumb = ''; $item->imgname = trim(str_replace('\\','/',$name), '/'); $item->imgname = trim($item->imgname, '\\'); // create new images for mobile if ($params->get('usemobileimage', '0')) { self::resizeImage($item->imgname, $params->get('mobileimageresolution', '640'), '', $params->get('mobileimageresolution', '640'), ''); } if ($params->get('thumbnails', '1') == '1') $item->imgthumb = \Joomla\CMS\Uri\Uri::base(true) . '/' . self::resizeImage($item->imgname, $params->get('thumbnailwidth', '100'), $params->get('thumbnailheight', '75')); $thumbext = explode(".", $item->imgname); $thumbext = end($thumbext); // set the variables $item->imgvideo = null; $item->slideselect = null; $item->slideselect = null; $item->imgcaption = null; $item->article = null; $item->slidearticleid = null; $item->imgalignment = null; $item->imgtarget = 'default'; $item->imgtime = null; $item->imglink = null; $item->imgtitle = null; if (!in_array(strToLower(\Joomla\CMS\Filesystem\File::getExt($item->imgname)), $authorisedExt)) continue; // load the image data from txt $item = self::getImageDataFromfolder($item, $params); $item->imgname = \Joomla\CMS\Uri\Uri::base(true) . '/' . $item->imgname; $items[$i] = $item; // route the url if (strcasecmp(substr($item->imglink, 0, 4), 'http') && (strpos($item->imglink, 'index.php?') !== false)) { $item->imglink = \Joomla\CMS\Router\Route::_($item->imglink, true, false); } else { $item->imglink = \Joomla\CMS\Router\Route::_($item->imglink); } } } return $items; } /* * Load the image from the specified folder */ public static function loadImagesFromFolder($directory) { // encode the folder path, needed if contains an accent try { $translatedDirectory = iconv("UTF-8", "ISO-8859-1//TRANSLIT", urldecode($directory)); if ($translatedDirectory) $directory = $translatedDirectory; } catch (Exception $e) { echo 'CK Message : ', $e->getMessage(), "\n"; } // load the files from the folder $files = \Joomla\CMS\Filesystem\Folder::files(trim(trim($directory), '/'), '.', false, true); if (! $files) return 'CK message : No files found in the directory : ' . $directory; self::$imagesOrderByLabels = array(); // load the labels from the folder self::getImageLabelsFromFolder($directory); $order = self::$_params->get('displayorder'); // set the images order if ($order == 'shuffle') { shuffle($files); } else // if(isset($params->order) && $params->order == 'labels') { natsort($files); $files = array_map(array(__CLASS__, 'formatPath'), $files); $baseDir = self::formatPath($directory); $labelsOrder = array_reverse(self::$imagesOrderByLabels); foreach ($labelsOrder as $name) { $imgFile = $baseDir . '/' . $name; array_unshift($files, $imgFile); } // now make it unique $files = array_unique($files); } // else { // natsort($files); // } $authorisedExt = array('png','jpg','jpeg','bmp','tiff','gif'); $items = array(); $i = 0; foreach ($files as $file) { $fileExt = \Joomla\CMS\Filesystem\File::getExt($file); if (!in_array(strToLower($fileExt),$authorisedExt)) continue; $item = new stdClass(); // set the variables $item->imgvideo = null; $item->slideselect = null; $item->slideselect = null; $item->imgcaption = null; $item->article = null; $item->slidearticleid = null; $item->imgalignment = null; $item->imgtarget = 'default'; $item->imgtime = null; $item->imglink = null; $item->imgtitle = null; // limit the number of images // if (isset($params->number) && $params->number > 0 && $i > (int)$params->number) $show = false; // get the data for the image $filedata = self::getImageDataFromfolder2($file, $directory); $file = str_replace("\\", "/", iconv('ISO-8859-1', 'UTF-8', $file)); if (isset($filedata->link) && $filedata->link) { $item->imglink = $filedata->link; } else { $videoFile = str_replace($fileExt, 'mp4', $file); $hasVideo = file_exists($videoFile); $item->imglink = $hasVideo ? $videoFile : $file; } $item->imgname = \Joomla\CMS\Uri\Uri::base(true) . '/' . $file; $item->imgthumb = $item->imgname; $item->imgtitle = $filedata->title; $item->imgcaption = $filedata->desc; $item->imgvideo = $filedata->video; // $linktitle = $filedata->title || $filedata->desc ? ($filedata->desc ? $filedata->title . '::' . $filedata->desc : $filedata->title) : $title; $items[$i] = $item; $i++; } return $items; } /* * Remove special character */ private static function cleanName($path) { return preg_replace('/[^a-z0-9]/i', '_', $path); } public static function formatPath($p) { return trim(str_replace("\\", "/", $p), "/"); } private static function getImageLabelsFromFolder($directory) { $dirindex = self::cleanName($directory); if (! empty(self::$folderLabels[$dirindex])) return; $items = array(); $item = new stdClass(); // get the language $lang = \Joomla\CMS\Factory::getLanguage(); $langtag = $lang->getTag(); // returns fr-FR or en-GB // load the image data from txt if (file_exists(JPATH_ROOT . '/' . $directory . '/labels.' . $langtag . '.txt')) { $data = file_get_contents(JPATH_ROOT . '/' . $directory . '/labels.' . $langtag . '.txt'); } else if (file_exists(JPATH_ROOT . '/' . $directory . '/labels.txt')) { $data = file_get_contents(JPATH_ROOT . '/' . $directory . '/labels.txt'); } else { return null; } $doUTF8encode = true; // remove UTF-8 BOM and normalize line endings if (!strcmp("\xEF\xBB\xBF", substr($data,0,3))) { // file starts with UTF-8 BOM $data = substr($data, 3); // remove UTF-8 BOM $doUTF8encode = false; } $data = str_replace("\r", "\n", $data); // normalize line endings // if no data found, exit if(! $data) return null; // explode the file into rows // $imgdatatmp = explode("\n", $data); $imgdatatmp = preg_split("/\r\n|\n|\r/", $data, -1, PREG_SPLIT_NO_EMPTY); $parmsnumb = count($imgdatatmp); for ($i = 0; $i < $parmsnumb; $i++) { $imgdatatmp[$i] = trim($imgdatatmp[$i]); $line = explode('|', $imgdatatmp[$i]); // store the order or files from the TXT file self::$imagesOrderByLabels[] = $line[0]; $item = new stdClass(); $item->index = self::cleanName($line[0]); $item->title = (isset($line[1])) ? ( $doUTF8encode ? (iconv('ISO-8859-1', 'UTF-8', $line[1])) : ($line[1]) ) : ''; $item->desc = (isset($line[2])) ? ( $doUTF8encode ? (iconv('ISO-8859-1', 'UTF-8', $line[2])) : ($line[2]) ) : ''; $item->link = (isset($line[3])) ? ( $doUTF8encode ? (iconv('ISO-8859-1', 'UTF-8', $line[3])) : ($line[3]) ) : ''; $item->video = (isset($line[4])) ? ( $doUTF8encode ? (iconv('ISO-8859-1', 'UTF-8', $line[4])) : ($line[4]) ) : ''; $items[$item->index] = $item; } self::$folderLabels[$dirindex] = $items; } /* * Load the data for the image (title and description) */ private static function getImageDataFromfolder2($file, $directory) { $filename = explode('/', $file); $filename = end($filename); $dirindex = self::cleanName($directory); $fileindex = self::cleanName($filename); if (! empty(self::$folderLabels[$dirindex]) && ! empty(self::$folderLabels[$dirindex][$fileindex])) { $item = self::$folderLabels[$dirindex][$fileindex]; } else { $item = new stdClass(); $item->title = null; $item->desc = null; $item->video = null; // old method, get image data from txt file with image name // TODO : remove // $item = self::getImageDataFromImageTxt($file) } return $item; } /** * Get a list of the items. * * @param \Joomla\Registry\Registry $params The module options. * * @return array */ static function getItemsAutoloadflickr(&$params) { self::$_params = $params; $url = 'https://api.flickr.com/services/rest/?format=json&method=flickr.photosets.getPhotos&extras=description,original_format,url_sq,url_t,url_s,url_m,url_o&nojsoncallback=1'; $url .= '&api_key=' . $params->get('flickr_apikey'); $url .= '&photoset_id=' . $params->get('flickr_photoset'); if (ini_get('allow_url_fopen') && function_exists('file_get_contents')) { $result = file_get_contents($url); } // look for curl if ($result == '' && extension_loaded('curl')) { $ch = curl_init(); $timeout = 30; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $result = curl_exec($ch); curl_close($ch); } $images = json_decode($result)->photoset->photo; $items = Array(); $i = 0; $flickrSuffixes = array('o', 'k', 'h', 'b', 'z', 'sq', 't', 'sm', 'm'); foreach ($images as & $image) { $items[$i] = new stdClass(); $item = $items[$i]; $suffix = 'o'; foreach ($flickrSuffixes as $flickrSuffixe) { if (isset($image->{'url_' . $flickrSuffixe})) { $suffix = $flickrSuffixe; break; } } $item->imgname = $image->{'url_' . $suffix}; $item->imgthumb = $item->imgname; // create new images for mobile // if ($params->get('usemobileimage', '0')) { // self::resizeImage($item->imgname, $params->get('mobileimageresolution', '640'), '', $params->get('mobileimageresolution', '640'), ''); // } // if ($params->get('thumbnails', '1') == '1') // $item->imgthumb = \Joomla\CMS\Uri\Uri::base(true) . '/' . self::resizeImage($item->imgname, $params->get('thumbnailwidth', '100'), $params->get('thumbnailheight', '75')); // $thumbext = explode(".", $item->imgname); // $thumbext = end($thumbext); // set the variables $item->imgvideo = null; $item->slideselect = null; $item->slideselect = null; $item->imgcaption = null; $item->article = null; $item->slidearticleid = null; $item->imgalignment = null; $item->imgtarget = 'default'; $item->imgtime = null; $item->imglink = null; $item->imgtitle = null; // show the title and description of the image if ($params->get('flickr_showcaption', '1')) { $item->imgtitle = $image->title; $item->imgcaption = $image->description->_content; } // set the link to the image if ($params->get('flickr_autolink', '0')) { $item->imglink = $image->{'url_' . $suffix}; } $i++; } return $items; } static function getItemsAutoloadarticlecategory(&$params) { $com_path = JPATH_SITE . '/components/com_content/'; require_once $com_path . 'router.php'; require_once $com_path . 'helpers/route.php'; \Joomla\CMS\MVC\Model\BaseDatabaseModel::addIncludePath($com_path . '/models', 'ContentModel'); // Get an instance of the generic articles model $articles = \Joomla\CMS\MVC\Model\BaseDatabaseModel::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // Set application parameters in model $app = \Joomla\CMS\Factory::getApplication(); $appParams = $app->getParams(); $articles->setState('params', $appParams); // Set the filters based on the module params $articles->setState('list.start', 0); // $articles->setState('list.limit', (int) $params->get('count', 0)); // must check if the image exists $articles->setState('list.limit', 0); $articles->setState('filter.published', 1); // Access filter $access = !\Joomla\CMS\Component\ComponentHelper::getParams('com_content')->get('show_noauth'); $authorised = \Joomla\CMS\Access\Access::getAuthorisedViewLevels(\Joomla\CMS\Factory::getUser()->get('id')); $articles->setState('filter.access', $access); // Prep for Normal or Dynamic Modes $mode = $params->get('mode', 'normal'); switch ($mode) { case 'dynamic': $option = JRequest::getCmd('option'); $view = JRequest::getCmd('view'); if ($option === 'com_content') { switch($view) { case 'category': $catids = array(JRequest::getInt('id')); break; case 'categories': $catids = array(JRequest::getInt('id')); break; case 'article': if ($params->get('show_on_article_page', 1)) { $article_id = JRequest::getInt('id'); $catid = JRequest::getInt('catid'); if (!$catid) { // Get an instance of the generic article model $article = \Joomla\CMS\MVC\Model\BaseDatabaseModel::getInstance('Article', 'ContentModel', array('ignore_request' => true)); $article->setState('params', $appParams); $article->setState('filter.published', 1); $article->setState('article.id', (int) $article_id); $item = $article->getItem(); $catids = array($item->catid); } else { $catids = array($catid); } } else { // Return right away if show_on_article_page option is off return; } break; case 'featured': default: // Return right away if not on the category or article views return; } } else { // Return right away if not on a com_content page return; } break; case 'normal': default: $catids = $params->get('catid'); $articles->setState('filter.category_id.include', (bool) $params->get('category_filtering_type', 1)); break; } // Category filter if ($catids) { if ($params->get('show_child_category_articles', 0) && (int) $params->get('levels', 0) > 0) { // Get an instance of the generic categories model $categories = \Joomla\CMS\MVC\Model\BaseDatabaseModel::getInstance('Categories', 'ContentModel', array('ignore_request' => true)); $categories->setState('params', $appParams); $levels = $params->get('levels', 1) ? $params->get('levels', 1) : 9999; $categories->setState('filter.get_children', $levels); $categories->setState('filter.published', 1); $categories->setState('filter.access', $access); $additional_catids = array(); foreach($catids as $catid) { $categories->setState('filter.parentId', $catid); $recursive = true; $items = $categories->getItems($recursive); if ($items) { foreach($items as $category) { $condition = (($category->level - $categories->getParent()->level) <= $levels); if ($condition) { $additional_catids[] = $category->id; } } } } $catids = array_unique(array_merge($catids, $additional_catids)); } $articles->setState('filter.category_id', $catids); } // Ordering $articles->setState('list.ordering', $params->get('article_ordering', 'a.ordering')); $articles->setState('list.direction', $params->get('article_ordering_direction', 'ASC')); // New Parameters $articles->setState('filter.featured', $params->get('show_front', 'show')); // $articles->setState('filter.author_id', $params->get('created_by', "")); // $articles->setState('filter.author_id.include', $params->get('author_filtering_type', 1)); // $articles->setState('filter.author_alias', $params->get('created_by_alias', "")); // $articles->setState('filter.author_alias.include', $params->get('author_alias_filtering_type', 1)); $excluded_articles = $params->get('excluded_articles', ''); if ($excluded_articles) { $excluded_articles = explode("\r\n", $excluded_articles); $articles->setState('filter.article_id', $excluded_articles); $articles->setState('filter.article_id.include', false); // Exclude } $date_filtering = $params->get('date_filtering', 'off'); if ($date_filtering !== 'off') { $articles->setState('filter.date_filtering', $date_filtering); $articles->setState('filter.date_field', $params->get('date_field', 'a.created')); $articles->setState('filter.start_date_range', $params->get('start_date_range', '1000-01-01 00:00:00')); $articles->setState('filter.end_date_range', $params->get('end_date_range', '9999-12-31 23:59:59')); $articles->setState('filter.relative_date', $params->get('relative_date', 30)); } // Filter by language $articles->setState('filter.language', $app->getLanguageFilter()); $items = $articles->getItems(); // Display options $show_date = $params->get('show_date', 0); $show_date_field = $params->get('show_date_field', 'created'); $show_date_format = $params->get('show_date_format', 'Y-m-d H:i:s'); $show_category = $params->get('show_category', 0); $show_hits = $params->get('show_hits', 0); $show_author = $params->get('show_author', 0); $show_introtext = $params->get('show_introtext', 0); $introtext_limit = $params->get('introtext_limit', 100); // Find current Article ID if on an article page $option = JRequest::getCmd('option'); $view = JRequest::getCmd('view'); if ($option === 'com_content' && $view === 'article') { $active_article_id = JRequest::getInt('id'); } else { $active_article_id = 0; } // Prepare data for display using display options $slideItems = Array(); foreach ($items as &$item) { $item->slug = $item->id.':'.$item->alias; $item->catslug = $item->catid ? $item->catid .':'.$item->category_alias : $item->catid; if ($access || in_array($item->access, $authorised)) { // We know that user has the privilege to view the article $item->link = \Joomla\CMS\Router\Route::_(\Joomla\Component\Content\Site\Helper\RouteHelper::getArticleRoute($item->slug, $item->catslug)); } else { // Angie Fixed Routing $app = \Joomla\CMS\Factory::getApplication(); $menu = $app->getMenu(); $menuitems = $menu->getItems('link', 'index.php?option=com_users&view=login'); if(isset($menuitems[0])) { $Itemid = $menuitems[0]->id; } elseif (JRequest::getInt('Itemid') > 0) { //use Itemid from requesting page only if there is no existing menu $Itemid = JRequest::getInt('Itemid'); } $item->link = \Joomla\CMS\Router\Route::_('index.php?option=com_users&view=login&Itemid='.$Itemid); } // Used for styling the active article $item->active = $item->id == $active_article_id ? 'active' : ''; $item->displayDate = ''; if ($show_date) { $item->displayDate = \Joomla\CMS\HTML\HTMLHelper::_('date', $item->$show_date_field, $show_date_format); } if ($item->catid) { $item->displayCategoryLink = \Joomla\CMS\Router\Route::_(\Joomla\Component\Content\Site\Helper\RouteHelper::getCategoryRoute($item->catid)); $item->displayCategoryTitle = $show_category ? ''.$item->category_title.'' : ''; } else { $item->displayCategoryTitle = $show_category ? $item->category_title : ''; } $item->displayHits = $show_hits ? $item->hits : ''; $item->displayAuthorName = $show_author ? $item->author : ''; // if ($show_introtext) { // $item->introtext = \Joomla\CMS\HTML\HTMLHelper::_('content.prepare', $item->introtext, '', 'mod_articles_category.content'); // $item->introtext = self::_cleanIntrotext($item->introtext); // } $item->displayIntrotext = $show_introtext ? self::truncate($item->introtext, $introtext_limit) : ''; $item->displayReadmore = $item->alternative_readmore; // add the article to the slide $registry = new \Joomla\Registry\Registry; $registry->loadString($item->images); $item->images = $registry->toArray(); $article_image =false; $slideItem_article_text = ''; switch ($params->get('articleimgsource', 'introimage')) { case 'firstimage': $search_images = preg_match('/