me muestra asi
este es el archivo helper.php
Código PHP:
Ver original
require_once JPATH_SITE . '/components/com_content/helpers/route.php'; /** * Helper for mod_related_items * * @package Joomla.Site * @subpackage mod_related_items * @since 1.5 */ abstract class ModRelatedItemsHelper { /** * Get a list of related articles * * @param JRegistry &$params module parameters * * @return array */ public static function getList(&$params) { $db = JFactory::getDbo(); $app = JFactory::getApplication(); $user = JFactory::getUser(); $maximum = (int) $params->get('maximum', 5); $option = $app->input->get('option'); $view = $app->input->get('view'); $temp = $app->input->getString('id'); $id = $temp[0]; $nullDate = $db->getNullDate(); $now = $date->toSql(); $query = $db->getQuery(true); if ($option == 'com_content' && $view == 'article' && $id) { // Select the meta keywords from the item $query->select('metakey') ->from('#__content') ->where('id = ' . (int) $id); $db->setQuery($query); { // Explode the meta keys on a comma // Assemble any non-blank word(s) foreach ($keys as $key) { if ($key) { $likes[] = $db->escape($key); } } { // Select other items based on the metakey field 'like' the keys found $query->clear() ->select('a.id') ->select('a.title') ->select('DATE_FORMAT(a.created, "%Y-%m-%d") as created') ->select('a.catid') ->select('cc.access AS cat_access') ->select('cc.published AS cat_state'); // Sqlsrv changes $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias', '!=', '0'); $case_when .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when .= ' ELSE '; $case_when .= $a_id . ' END as slug'; $query->select($case_when); $case_when = ' CASE WHEN '; $case_when .= $query->charLength('cc.alias', '!=', '0'); $case_when .= ' THEN '; $c_id = $query->castAsChar('cc.id'); $case_when .= ' ELSE '; $case_when .= $c_id . ' END as catslug'; $query->select($case_when) ->from('#__content AS a') ->where('a.id != ' . (int) $id) ->where('a.state = 1') ->where('a.access IN (' . $groups . ')'); // Remove single space after commas in keywords) $query->where('(' . $concat_string . ' LIKE "%' . implode('%" OR ' . $concat_string . ' LIKE "%', $likes) . '%")') ->where('(a.publish_up = ' . $db->quote($nullDate) . ' OR a.publish_up <= ' . $db->quote($now) . ')') ->where('(a.publish_down = ' . $db->quote($nullDate) . ' OR a.publish_down >= ' . $db->quote($now) . ')'); // Filter by language if (JLanguageMultilang::isEnabled()) { $query->where('a.language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); } $db->setQuery($query, 0, $maximum); $temp = $db->loadObjectList(); { foreach ($temp as $row) { if ($row->cat_state == 1) { $row->route = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug)); $related[] = $row; } } } } } } return $related; } }
y este es el otro archivo
Código PHP:
Ver original
// Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $cacheparams = new stdClass; $cacheparams->cachemode = 'safeuri'; $cacheparams->class = 'ModRelatedItemsHelper'; $cacheparams->method = 'getList'; $cacheparams->methodparams = $params; $list = JModuleHelper::moduleCache($module, $params, $cacheparams); { return; } $showDate = $params->get('showDate', 0); require JModuleHelper::getLayoutPath('mod_related_items', $params->get('layout', 'default'));