| Server IP : 46.105.57.169 / Your IP : 216.73.217.35 Web Server : Apache System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/123click/assets/ |
Upload File : |
PK ! ̈́��w w mod_related_items.phpnu &1i� <?php
/**
* @package Joomla.Site
* @subpackage mod_related_items
*
* @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Helper\ModuleHelper;
use Joomla\Module\RelatedItems\Site\Helper\RelatedItemsHelper;
$cacheparams = new \stdClass;
$cacheparams->cachemode = 'safeuri';
$cacheparams->class = RelatedItemsHelper::class;
$cacheparams->method = 'getList';
$cacheparams->methodparams = $params;
$cacheparams->modeparams = array('id' => 'int', 'Itemid' => 'int');
$list = ModuleHelper::moduleCache($module, $params, $cacheparams);
if (!count($list))
{
return;
}
$showDate = $params->get('showDate', 0);
require ModuleHelper::getLayoutPath('mod_related_items', $params->get('layout', 'default'));
PK ! �&ϕ� � mod_related_items.xmlnu &1i� <?xml version="1.0" encoding="utf-8"?>
<extension type="module" client="site" method="upgrade">
<name>mod_related_items</name>
<author>Joomla! Project</author>
<creationDate>July 2004</creationDate>
<copyright>(C) 2005 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>3.0.0</version>
<description>MOD_RELATED_XML_DESCRIPTION</description>
<namespace path="src">Joomla\Module\RelatedItems</namespace>
<files>
<filename module="mod_related_items">mod_related_items.php</filename>
<folder>src</folder>
<folder>tmpl</folder>
</files>
<languages>
<language tag="en-GB">language/en-GB/mod_related_items.ini</language>
<language tag="en-GB">language/en-GB/mod_related_items.sys.ini</language>
</languages>
<help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_RELATED" />
<config>
<fields name="params">
<fieldset name="basic">
<field
name="showDate"
type="radio"
layout="joomla.form.field.radio.switcher"
label="MOD_RELATED_FIELD_SHOWDATE_LABEL"
default="0"
filter="integer"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="maximum"
type="number"
label="MOD_RELATED_FIELD_MAX_LABEL"
default="5"
filter="integer"
/>
</fieldset>
<fieldset name="advanced">
<field
name="layout"
type="modulelayout"
label="JFIELD_ALT_LAYOUT_LABEL"
class="form-select"
validate="moduleLayout"
/>
<field
name="moduleclass_sfx"
type="textarea"
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
rows="3"
validate="CssIdentifier"
/>
<field
name="owncache"
type="list"
label="COM_MODULES_FIELD_CACHING_LABEL"
default="1"
filter="integer"
validate="options"
>
<option value="1">JGLOBAL_USE_GLOBAL</option>
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
</field>
<field
name="cache_time"
type="number"
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
default="900"
filter="integer"
/>
</fieldset>
</fields>
</config>
</extension>
PK ! ��u�z z tmpl/default.phpnu &1i� <?php
/**
* @package Joomla.Site
* @subpackage mod_related_items
*
* @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;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
?>
<ul class="mod-relateditems relateditems mod-list">
<?php foreach ($list as $item) : ?>
<li>
<a href="<?php echo $item->route; ?>">
<?php if ($showDate) echo HTMLHelper::_('date', $item->created, Text::_('DATE_FORMAT_LC4')) . ' - '; ?>
<?php echo $item->title; ?></a>
</li>
<?php endforeach; ?>
</ul>
PK ! ��x83 3 ! src/Helper/RelatedItemsHelper.phpnu &1i� <?php
/**
* @package Joomla.Site
* @subpackage mod_related_items
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Module\RelatedItems\Site\Helper;
\defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Administrator\Extension\ContentComponent;
use Joomla\Component\Content\Site\Helper\RouteHelper;
use Joomla\Database\ParameterType;
/**
* Helper for mod_related_items
*
* @since 1.5
*/
abstract class RelatedItemsHelper
{
/**
* Get a list of related articles
*
* @param \Joomla\Registry\Registry &$params module parameters
*
* @return array
*/
public static function getList(&$params)
{
$db = Factory::getDbo();
$app = Factory::getApplication();
$input = $app->input;
$groups = Factory::getUser()->getAuthorisedViewLevels();
$maximum = (int) $params->get('maximum', 5);
$factory = $app->bootComponent('com_content')->getMVCFactory();
// Get an instance of the generic articles model
/** @var \Joomla\Component\Content\Site\Model\ArticlesModel $articles */
$articles = $factory->createModel('Articles', 'Site', ['ignore_request' => true]);
// Set application parameters in model
$articles->setState('params', $app->getParams());
$option = $input->get('option');
$view = $input->get('view');
if (!($option === 'com_content' && $view === 'article'))
{
return [];
}
$temp = $input->getString('id');
$temp = explode(':', $temp);
$id = (int) $temp[0];
$now = Factory::getDate()->toSql();
$related = [];
$query = $db->getQuery(true);
if ($id)
{
// Select the meta keywords from the item
$query->select($db->quoteName('metakey'))
->from($db->quoteName('#__content'))
->where($db->quoteName('id') . ' = :id')
->bind(':id', $id, ParameterType::INTEGER);
$db->setQuery($query);
try
{
$metakey = trim($db->loadResult());
}
catch (\RuntimeException $e)
{
$app->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
return array();
}
// Explode the meta keys on a comma
$keys = explode(',', $metakey);
$likes = [];
// Assemble any non-blank word(s)
foreach ($keys as $key)
{
$key = trim($key);
if ($key)
{
$likes[] = $db->escape($key);
}
}
if (\count($likes))
{
// Select other items based on the metakey field 'like' the keys found
$query->clear()
->select($db->quoteName('a.id'))
->from($db->quoteName('#__content', 'a'))
->where($db->quoteName('a.id') . ' != :id')
->where($db->quoteName('a.state') . ' = ' . ContentComponent::CONDITION_PUBLISHED)
->whereIn($db->quoteName('a.access'), $groups)
->bind(':id', $id, ParameterType::INTEGER);
$binds = [];
$wheres = [];
foreach ($likes as $keyword)
{
$binds[] = '%' . $keyword . '%';
}
$bindNames = $query->bindArray($binds, ParameterType::STRING);
foreach ($bindNames as $keyword)
{
$wheres[] = $db->quoteName('a.metakey') . ' LIKE ' . $keyword;
}
$query->extendWhere('AND', $wheres, 'OR')
->extendWhere('AND', [ $db->quoteName('a.publish_up') . ' IS NULL', $db->quoteName('a.publish_up') . ' <= :nowDate1'], 'OR')
->extendWhere(
'AND',
[
$db->quoteName('a.publish_down') . ' IS NULL',
$db->quoteName('a.publish_down') . ' >= :nowDate2'
],
'OR'
)
->bind([':nowDate1', ':nowDate2'], $now);
// Filter by language
if (Multilanguage::isEnabled())
{
$query->whereIn($db->quoteName('a.language'), [Factory::getLanguage()->getTag(), '*'], ParameterType::STRING);
}
$query->setLimit($maximum);
$db->setQuery($query);
try
{
$articleIds = $db->loadColumn();
}
catch (\RuntimeException $e)
{
$app->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
return [];
}
if (\count($articleIds))
{
$articles->setState('filter.article_id', $articleIds);
$articles->setState('filter.published', 1);
$related = $articles->getItems();
}
unset($articleIds);
}
}
if (\count($related))
{
// Prepare data for display using display options
foreach ($related as &$item)
{
$item->slug = $item->id . ':' . $item->alias;
$item->route = Route::_(RouteHelper::getArticleRoute($item->slug, $item->catid, $item->language));
}
}
return $related;
}
}
PK ! ̈́��w w mod_related_items.phpnu &1i� PK ! �&ϕ� � � mod_related_items.xmlnu &1i� PK ! ��u�z z � tmpl/default.phpnu &1i� PK ! ��x83 3 ! � src/Helper/RelatedItemsHelper.phpnu &1i� PK [ ."