Server IP : 195.201.23.43 / Your IP : 3.145.164.105 Web Server : Apache System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 User : kdecoratie ( 1041) PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/kdecoratie/public_html/components/com_content/views/featured/ |
Upload File : |
<?php /** * @package Joomla.Site * @subpackage com_content * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Frontpage View class * * @since 1.5 */ class ContentViewFeatured extends JViewLegacy { /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise an Error object. */ public function display($tpl = null) { // Parameters $app = JFactory::getApplication(); $doc = JFactory::getDocument(); $params = $app->getParams(); $feedEmail = $app->get('feed_email', 'none'); $siteEmail = $app->get('mailfrom'); $doc->link = JRoute::_('index.php?option=com_content&view=featured'); // Get some data from the model $app->input->set('limit', $app->get('feed_limit')); $categories = JCategories::getInstance('Content'); $rows = $this->get('Items'); foreach ($rows as $row) { // Strip html from feed item title $title = $this->escape($row->title); $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8'); // Compute the article slug $row->slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id; // URL link to article $link = ContentHelperRoute::getArticleRoute($row->slug, $row->catid, $row->language); $description = ''; $obj = json_decode($row->images); $introImage = isset($obj->{'image_intro'}) ? $obj->{'image_intro'} : ''; if (isset($introImage) && ($introImage != '')) { $image = preg_match('/http/', $introImage) ? $introImage : JURI::root() . $introImage; $description = '<p><img src="' . $image . '" /></p>'; } $description .= ($params->get('feed_summary', 0) ? $row->introtext . $row->fulltext : $row->introtext); $author = $row->created_by_alias ?: $row->author; // Load individual item creator class $item = new JFeedItem; $item->title = $title; $item->link = \JRoute::_($link); $item->date = $row->publish_up; $item->category = array(); // All featured articles are categorized as "Featured" $item->category[] = JText::_('JFEATURED'); for ($item_category = $categories->get($row->catid); $item_category !== null; $item_category = $item_category->getParent()) { // Only add non-root categories if ($item_category->id > 1) { $item->category[] = $item_category->title; } } $item->author = $author; if ($feedEmail === 'site') { $item->authorEmail = $siteEmail; } elseif ($feedEmail === 'author') { $item->authorEmail = $row->author_email; } // Add readmore link to description if introtext is shown, show_readmore is true and fulltext exists if (!$params->get('feed_summary', 0) && $params->get('feed_show_readmore', 0) && $row->fulltext) { $link = \JRoute::_($link, true, $app->get('force_ssl') == 2 ? \JRoute::TLS_FORCE : \JRoute::TLS_IGNORE, true); $description .= '<p class="feed-readmore"><a target="_blank" href="' . $link . '">' . JText::_('COM_CONTENT_FEED_READMORE') . '</a></p>'; } // Load item description and add div $item->description = '<div class="feed-description">' . $description . '</div>'; // Loads item info into rss array $doc->addItem($item); } } }Private