Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 10 Ответов
  • 2633 Просмотров
*

bombapiter

  • Захожу иногда
  • 71
  • 0 / 0
Эта тема уже была, но ответа в ней не нашел.

J2.5 localhost

Создал два материала с произвольным текстом, в "Мета-тег Keywords" материалов одинаковые теги. Эти два матириала привязал к пункту мену 1 и 2

Поставил модуль  "Материалы - Связанные материалы", отображать на всех страницах.

Кеширование отключено.

Не показывается этот модуль!

Что не так?
*

midav

  • Давно я тут
  • 926
  • 115 / 1
Вроде бы все так . А другие модули в этой позиции показываются ?
Ответы на вопросы по CSS . Откройте для себя Firebug
*

bombapiter

  • Захожу иногда
  • 71
  • 0 / 0
*

djooon91

  • Новичок
  • 9
  • 0 / 0
у меня та же проблема. >:(
*

Sergey2

  • Давно я тут
  • 651
  • 15 / 1
аналогично :(
че делать? Как лечить?
*

DKsN

  • Захожу иногда
  • 258
  • 15 / 0
  • [BODY]
Думаю, многие были бы признательны, если бы кто-то по русски объяснил, как этот баг исправить.

Таже проблема, но английский не знаю до такой степени, что бы понять описание по ссылке выше.
*

Sergey2

  • Давно я тут
  • 651
  • 15 / 1
Вот этот код в версии 22477 на строке 82

$query->where('(CONCAT(",", REPLACE(a.metakey, ", ",
","), ",") LIKE "%'.implode('%" OR
CONCAT(",", REPLACE(a.metakey, ", ", ","),
",") LIKE "%', $likes).'%")'); //remove single space after
commas in keywords)

заменить на этот

$concat_string = $query->concatenate(array(',', 'REPLACE(a.metakey, ",
", ",")', ','));
$query->where('('.$concat_string.' LIKE "%'.implode('%" OR
'.$concat_string.' LIKE "%', $likes).'%")'); //remove single space
after commas in keywords)
*

DKsN

  • Захожу иногда
  • 258
  • 15 / 0
  • [BODY]
Я извиняюсь, мы говорим о файле /modules/mod_related_items/helper.php ?

У меня в нём код такой:
Код
<?php
/**
 * @package Joomla.Site
 * @subpackage mod_related_items
 * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

require_once JPATH_SITE.'/components/com_content/helpers/route.php';

abstract class modRelatedItemsHelper
{
public static function getList($params)
{
$db = JFactory::getDbo();
$app = JFactory::getApplication();
$user = JFactory::getUser();
$userId = (int) $user->get('id');
$count = intval($params->get('count', 5));
$groups = implode(',', $user->getAuthorisedViewLevels());
$date = JFactory::getDate();

$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');

$temp = JRequest::getString('id');
$temp = explode(':', $temp);
$id = $temp[0];

$showDate = $params->get('showDate', 0);
$nullDate = $db->getNullDate();
$now = $date->toSql();
$related = array();
$query = $db->getQuery(true);

if ($option == 'com_content' && $view == 'article' && $id)
{
// select the meta keywords from the item

$query->select('metakey');
$query->from('#__content');
$query->where('id = ' . (int) $id);
$db->setQuery($query);

if ($metakey = trim($db->loadResult()))
{
// explode the meta keys on a comma
$keys = explode(',', $metakey);
$likes = array ();

// 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();
$query->select('a.id');
$query->select('a.title');
$query->select('DATE_FORMAT(a.created, "%Y-%m-%d") as created');
$query->select('a.catid');
$query->select('cc.access AS cat_access');
$query->select('cc.published AS cat_state');

           //sqlsrv changes
       $case_when = ' CASE WHEN ';
       $case_when .= $query->charLength('a.alias');
       $case_when .= ' THEN ';
       $a_id = $query->castAsChar('a.id');
       $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':');
       $case_when .= ' ELSE ';
       $case_when .= $a_id.' END as slug';
$query->select($case_when);

           $case_when = ' CASE WHEN ';
           $case_when .= $query->charLength('cc.alias');
           $case_when .= ' THEN ';
           $c_id = $query->castAsChar('cc.id');
           $case_when .= $query->concatenate(array($c_id, 'cc.alias'), ':');
           $case_when .= ' ELSE ';
           $case_when .= $c_id.' END as catslug';
           $query->select($case_when);
$query->from('#__content AS a');
$query->leftJoin('#__content_frontpage AS f ON f.content_id = a.id');
$query->leftJoin('#__categories AS cc ON cc.id = a.catid');
$query->where('a.id != ' . (int) $id);
$query->where('a.state = 1');
$query->where('a.access IN (' . $groups . ')');
           $concat_string = $query->concatenate(array('","', ' REPLACE(a.metakey, ", ", ",")', ' ","'));
$query->where('('.$concat_string.' LIKE "%'.implode('%" OR '.$concat_string.' LIKE "%', $likes).'%")'); //remove single space after commas in keywords)
$query->where('(a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).')');
$query->where('(a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).')');

// Filter by language
if ($app->getLanguageFilter()) {
$query->where('a.language in (' . $db->Quote(JFactory::getLanguage()->getTag()). ',' . $db->Quote('*'). ')');
}

$db->setQuery($query);
$qstring = $db->getQuery();
$temp = $db->loadObjectList();

if (count($temp))
{
foreach ($temp as $row)
{
if ($row->cat_state == 1)
{
$row->route = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug));
$related[] = $row;
}
}
}
unset ($temp);
}
}
}

return $related;
}
}

И могли бы вы дать код в корректном виде, что бы его можно было скопировать и вставить (кнопка #)

UPD:
Перепробывал все варианты замены кода, предложенные по ссылке, ничего не помогло.
« Последнее редактирование: 19.03.2013, 18:51:13 от DKsN »
*

Sergey2

  • Давно я тут
  • 651
  • 15 / 1
Ой, сорри, я там не до перевел :) Надо наоборот. Тот код что внизу boto у себя (две строки) и меняешь вот на это
Код
$query->where('(CONCAT(",", REPLACE(a.metakey, ", ",","), ",") LIKE "%'.implode('%" OR CONCAT(",", REPLACE(a.metakey, ", ", ","), ",") LIKE "%', $likes).'%")'); //remove single space after commas in keywords)
*

DKsN

  • Захожу иногда
  • 258
  • 15 / 0
  • [BODY]
Заработало. Спасибо :)
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Не работает GTranslate модуль

Автор rapsila

Ответов: 19
Просмотров: 3503
Последний ответ 06.09.2022, 22:52:02
от rapsila
Как сделать модуль на полный экран? Подробнее в в теме?

Автор 62411

Ответов: 3
Просмотров: 1732
Последний ответ 23.02.2022, 20:35:06
от marksetter
Не отображается модуль html код

Автор 62411

Ответов: 20
Просмотров: 2024
Последний ответ 23.02.2022, 05:34:09
от 62411
Материалы пользователя (контакта)

Автор katerina37

Ответов: 5
Просмотров: 1136
Последний ответ 18.02.2022, 11:53:02
от katerina37
Материалы в админке

Автор Ren17

Ответов: 6
Просмотров: 1325
Последний ответ 12.11.2020, 14:18:04
от Ren17