Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions helper.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@

defined('_JEXEC') or die ('Restricted access');

use Joomla\CMS\Helper\ModuleHelper;
use Joomla\CMS\Factory;

if (version_compare(JVERSION, '4.0.0', '>=')) {
if (version_compare(JVERSION, '5.0.0', '<')) {
if (version_compare(JVERSION, '4.0.0', '>='))
{
require_once JPATH_LIBRARIES . '/classmap.php';
} else {
require_once(JPATH_SITE . '/components/com_content/helpers/route.php');
}
}

// loads module function file
jimport('joomla.event.dispatcher');
Expand All @@ -34,9 +37,9 @@ class modDisplayNewsHelper
var string $version = "DisplayNews by BK 3.0.3";
var string $target = "";
static array $shown_list = array();
var JApplicationSite $app;
var Joomla\CMS\Application\SiteApplication $app;
var string $currcontentid;
var JRegistry $params;
var Joomla\Registry\Registry $params;

function readmore_out($row, $aroute, $aparams): string
{
Expand Down Expand Up @@ -977,8 +980,6 @@ function dn_hovertext($text1, $text2): string
function truncate($text, $length = 100, $ending = '...', $exact = true, $considerHtml = false): array
{

require_once(JPATH_LIBRARIES . '/phputf8/utf8.php');

if (utf8_strlen($ending) > $length) {
$ending = utf8_substr($ending, 0, $length);
}
Expand Down Expand Up @@ -1255,8 +1256,8 @@ function init_params($params, $module_id): bool

$this->set_article_id = array_filter(array_merge((array)($this->params->get('set_article_id')),
(array)($this->params->get('set_article_archived_id')),
explode(",", $this->params->get('set_article_id_extra')),
explode(",", $this->params->get('set_article_archived_id_extra'))));
explode(",", $this->params->get('set_article_id_extra') ?? ''),
explode(",", $this->params->get('set_article_archived_id_extra') ?? '')));

// $set_author_id = $this->params->get( 'set_author_id');
// $set_author_name = $this->params->get( 'set_author_name');
Expand Down Expand Up @@ -1542,7 +1543,7 @@ function init_params($params, $module_id): bool

if ($this->view == "article") {
$temp = $this->app->input->getString('id');
$temp = explode(':', $temp);
$temp = explode(':', $temp ?? '');
$this->currcontentid = $temp[0];
}

Expand Down Expand Up @@ -2178,7 +2179,7 @@ function mod_title_out($row): string
function main(&$params, $module_id): string
{

$this->app = JFactory::getApplication();
$this->app = Factory::getApplication();

if ($this->init_params($params, $module_id) === false) {
return "";
Expand Down
6 changes: 3 additions & 3 deletions mod_dn.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension type="module" client="site" method="upgrade">
<name>DisplayNews</name>
<author>BK</author>
<creationDate>2022-Nov-27</creationDate>
<copyright>(C) 2006 - 2022 BK. All rights reserved.</copyright>
<creationDate>2023-Nov-03</creationDate>
<copyright>(C) 2006 - 2023 BK. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<authorEmail>bkomraz1@gmail.com</authorEmail>
<authorUrl>http://joomla.rjews.net</authorUrl>
<version>3.0.3</version>
<version>4.0.0</version>
<description>DISPLAY_NEWS_BY_BK_MODULE</description>
<updateservers>
<server type="extension"
Expand Down