uawdijnntqw1x1x1
IP : 216.73.216.84
Hostname : webm003.cluster107.gra.hosting.ovh.net
Kernel : Linux webm003.cluster107.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
OS : Linux
PATH:
/
home
/
opticamezl
/
.
/
www
/
newok
/
tmp
/
..
/
mod_tags_similar.zip
/
/
PK���\OפcOO src/Helper/TagsSimilarHelper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_tags_similar * * @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Module\TagsSimilar\Site\Helper; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Helper\ContentHelper; use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\Language\Text; use Joomla\Component\Tags\Site\Helper\RouteHelper; use Joomla\Database\ParameterType; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_tags_similar * * @since 3.1 */ abstract class TagsSimilarHelper { /** * Get a list of tags * * @param Registry &$params Module parameters * * @return array */ public static function getList(&$params) { $app = Factory::getApplication(); $option = $app->getInput()->get('option'); $view = $app->getInput()->get('view'); // For now assume com_tags and com_users do not have tags. // This module does not apply to list views in general at this point. if ($option === 'com_tags' || $view === 'category' || $option === 'com_users') { return []; } $db = Factory::getDbo(); $user = Factory::getUser(); $groups = $user->getAuthorisedViewLevels(); $matchtype = $params->get('matchtype', 'all'); $ordering = $params->get('ordering', 'count'); $tagsHelper = new TagsHelper(); $prefix = $option . '.' . $view; $id = $app->getInput()->getInt('id'); $now = Factory::getDate()->toSql(); $nullDate = $db->getNullDate(); // This returns a comma separated string of IDs. $tagsToMatch = $tagsHelper->getTagIds($id, $prefix); if (!$tagsToMatch) { return []; } $tagsToMatch = explode(',', $tagsToMatch); $tagCount = \count($tagsToMatch); $query = $db->getQuery(true); $query ->select( [ $db->quoteName('m.core_content_id'), $db->quoteName('m.content_item_id'), $db->quoteName('m.type_alias'), 'COUNT( ' . $db->quoteName('tag_id') . ') AS ' . $db->quoteName('count'), $db->quoteName('ct.router'), $db->quoteName('cc.core_title'), $db->quoteName('cc.core_alias'), $db->quoteName('cc.core_catid'), $db->quoteName('cc.core_language'), $db->quoteName('cc.core_params'), ] ) ->from($db->quoteName('#__contentitem_tag_map', 'm')) ->join( 'INNER', $db->quoteName('#__tags', 't'), $db->quoteName('m.tag_id') . ' = ' . $db->quoteName('t.id') ) ->join( 'INNER', $db->quoteName('#__ucm_content', 'cc'), $db->quoteName('m.core_content_id') . ' = ' . $db->quoteName('cc.core_content_id') ) ->join( 'INNER', $db->quoteName('#__content_types', 'ct'), $db->quoteName('m.type_alias') . ' = ' . $db->quoteName('ct.type_alias') ) ->whereIn($db->quoteName('m.tag_id'), $tagsToMatch) ->whereIn($db->quoteName('t.access'), $groups) ->where($db->quoteName('cc.core_state') . ' = 1') ->extendWhere( 'AND', [ $db->quoteName('cc.core_access') . ' IN (' . implode(',', $query->bindArray($groups)) . ')', $db->quoteName('cc.core_access') . ' = 0', ], 'OR' ) ->extendWhere( 'AND', [ $db->quoteName('m.content_item_id') . ' <> :currentId', $db->quoteName('m.type_alias') . ' <> :prefix', ], 'OR' ) ->bind(':currentId', $id, ParameterType::INTEGER) ->bind(':prefix', $prefix) ->extendWhere( 'AND', [ $db->quoteName('cc.core_publish_up') . ' IS NULL', $db->quoteName('cc.core_publish_up') . ' = :nullDateUp', $db->quoteName('cc.core_publish_up') . ' <= :nowDateUp', ], 'OR' ) ->bind(':nullDateUp', $nullDate) ->bind(':nowDateUp', $now) ->extendWhere( 'AND', [ $db->quoteName('cc.core_publish_down') . ' IS NULL', $db->quoteName('cc.core_publish_down') . ' = :nullDateDown', $db->quoteName('cc.core_publish_down') . ' >= :nowDateDown', ], 'OR' ) ->bind(':nullDateDown', $nullDate) ->bind(':nowDateDown', $now); // Optionally filter on language $language = ComponentHelper::getParams('com_tags')->get('tag_list_language_filter', 'all'); if ($language !== 'all') { if ($language === 'current_language') { $language = ContentHelper::getCurrentLanguage(); } $query->whereIn($db->quoteName('cc.core_language'), [$language, '*'], ParameterType::STRING); } $query->group( [ $db->quoteName('m.core_content_id'), $db->quoteName('m.content_item_id'), $db->quoteName('m.type_alias'), $db->quoteName('ct.router'), $db->quoteName('cc.core_title'), $db->quoteName('cc.core_alias'), $db->quoteName('cc.core_catid'), $db->quoteName('cc.core_language'), $db->quoteName('cc.core_params'), ] ); if ($matchtype === 'all' && $tagCount > 0) { $query->having('COUNT( ' . $db->quoteName('tag_id') . ') = :tagCount') ->bind(':tagCount', $tagCount, ParameterType::INTEGER); } elseif ($matchtype === 'half' && $tagCount > 0) { $tagCountHalf = ceil($tagCount / 2); $query->having('COUNT( ' . $db->quoteName('tag_id') . ') >= :tagCount') ->bind(':tagCount', $tagCountHalf, ParameterType::INTEGER); } if ($ordering === 'count' || $ordering === 'countrandom') { $query->order($db->quoteName('count') . ' DESC'); } if ($ordering === 'random' || $ordering === 'countrandom') { $query->order($query->rand()); } $maximum = (int) $params->get('maximum', 5); if ($maximum > 0) { $query->setLimit($maximum); } $db->setQuery($query); try { $results = $db->loadObjectList(); } catch (\RuntimeException $e) { $results = []; $app->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); } foreach ($results as $result) { $result->link = RouteHelper::getItemRoute( $result->content_item_id, $result->core_alias, $result->core_catid, $result->core_language, $result->type_alias, $result->router ); $result->core_params = new Registry($result->core_params); } return $results; } } PK���\8�\mod_tags_similar.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_tags_similar * * @copyright (C) 2013 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; $cacheparams = new \stdClass(); $cacheparams->cachemode = 'safeuri'; $cacheparams->class = 'Joomla\Module\TagsSimilar\Site\Helper\TagsSimilarHelper'; $cacheparams->method = 'getList'; $cacheparams->methodparams = $params; $cacheparams->modeparams = ['id' => 'array', 'Itemid' => 'int']; $list = ModuleHelper::moduleCache($module, $params, $cacheparams); require ModuleHelper::getLayoutPath('mod_tags_similar', $params->get('layout', 'default')); PK���\���Hmod_tags_similar.xmlnu�[���<?xml version="1.0" encoding="UTF-8"?> <extension type="module" client="site" method="upgrade"> <name>mod_tags_similar</name> <author>Joomla! Project</author> <creationDate>2013-01</creationDate> <copyright>(C) 2013 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.1.0</version> <description>MOD_TAGS_SIMILAR_XML_DESCRIPTION</description> <namespace path="src">Joomla\Module\TagsSimilar</namespace> <files> <filename module="mod_tags_similar">mod_tags_similar.php</filename> <folder>src</folder> <folder>tmpl</folder> </files> <languages> <language tag="en-GB">language/en-GB/mod_tags_similar.ini</language> <language tag="en-GB">language/en-GB/mod_tags_similar.sys.ini</language> </languages> <help key="Site_Modules:_Tags_-_Similar" /> <config> <fields name="params"> <fieldset name="basic"> <field name="maximum" type="number" label="MOD_TAGS_SIMILAR_MAX_LABEL" default="5" filter="integer" min="0" validate="number" /> <field name="matchtype" type="list" label="MOD_TAGS_SIMILAR_FIELD_MATCHTYPE_LABEL" description="MOD_TAGS_SIMILAR_FIELD_MATCHTYPE_DESC" default="any" validate="options" > <option value="all">MOD_TAGS_SIMILAR_FIELD_ALL</option> <option value="any">MOD_TAGS_SIMILAR_FIELD_ONE_TAG</option> <option value="half">MOD_TAGS_SIMILAR_FIELD_HALF</option> </field> <field name="ordering" type="list" label="MOD_TAGS_SIMILAR_FIELD_ORDERING_LABEL" default="count" validate="options" > <option value="count">MOD_TAGS_SIMILAR_FIELD_ORDERING_COUNT</option> <option value="random">MOD_TAGS_SIMILAR_FIELD_ORDERING_RANDOM</option> <option value="countrandom">MOD_TAGS_SIMILAR_FIELD_ORDERING_COUNT_AND_RANDOM</option> </field> </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���\�V�tmpl/index.htmlnu&1i�<!DOCTYPE html><title></title> PK���\Ca�P**tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_tags_similar * * @copyright (C) 2013 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\Router\Route; if (!$list) { return; } ?> <ul class="mod-tagssimilar tagssimilar mod-list"> <?php foreach ($list as $i => $item) : ?> <li> <?php if (($item->type_alias === 'com_users.category') || ($item->type_alias === 'com_banners.category')) : ?> <?php if (!empty($item->core_title)) : ?> <?php echo htmlspecialchars($item->core_title, ENT_COMPAT, 'UTF-8'); ?> <?php endif; ?> <?php else : ?> <a href="<?php echo Route::_($item->link); ?>"> <?php if (!empty($item->core_title)) : ?> <?php echo htmlspecialchars($item->core_title, ENT_COMPAT, 'UTF-8'); ?> <?php endif; ?> </a> <?php endif; ?> </li> <?php endforeach; ?> </ul> PK���\�V� index.htmlnu&1i�<!DOCTYPE html><title></title> PK���\OפcOO src/Helper/TagsSimilarHelper.phpnu�[���PK���\8�\�mod_tags_similar.phpnu�[���PK���\���H�!mod_tags_similar.xmlnu�[���PK���\�V�I-tmpl/index.htmlnu&1i�PK���\Ca�P**�-tmpl/default.phpnu�[���PK���\�V� 2index.htmlnu&1i�PK�j2
/home/opticamezl/./www/newok/tmp/../mod_tags_similar.zip