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

wfedin

  • Завсегдатай
  • 1273
  • 102 / 0
*

tefun

  • Живу я здесь
  • 2540
  • 130 / 1
  • Легче всего обмануть себя
че ссылки то не пашут где демо глянуть?
то что постится на фОруме, не вырубается тапОрами
_______________________________________________
Мысли и женщины вместе не приходят М.Ж.
*

Niko1

  • Осваиваюсь на форуме
  • 18
  • 0 / 0
Цитировать
че ссылки то не пашут где демо глянуть?
http://extensions.joomla.org/extensions/news-display/related-items/4744
*

Ya_Polina

  • Новичок
  • 8
  • 0 / 0
Ребята, подскажите пожалуйста, как изменить формат выводимого текста? через настройки плагина не получается, просто ничего не изменяется. Спасибо.
*

Ya_Polina

  • Новичок
  • 8
  • 0 / 0
Нашла решение сама. Если вдруг кому интересно, нужно прописать всё необходимое в главном файле CSS в таблице content.
*

kulman

  • Новичок
  • 4
  • 0 / 0
Кто разобрался как он выбирает статьи по тегам(похожие)? Прописываю в статьях одинаковые ключи -- все равно выводит непонятно что.
В некоторых статьях вообще ни чего не выводит (хотя сама статья попадает в похожие на других)- почему?
*

Zaicev

  • Захожу иногда
  • 120
  • 2 / 0
если мультиязычный сайт то фигня получается ...
*

Niko1

  • Осваиваюсь на форуме
  • 18
  • 0 / 0
если мультиязычный сайт то фигня получается ...
Можно поправить код данного расширения. Я, например, использую Extranews, так там в самом плагине немного код дополнил и теперь для англ. контента -свое, а для укр. - свое показывает...
*

Zaicev

  • Захожу иногда
  • 120
  • 2 / 0
Можно поправить код данного расширения. Я, например, использую Extranews, так там в самом плагине немного код дополнил и теперь для англ. контента -свое, а для укр. - свое показывает...


Extranews - у меня выводит только связные материалы одной категории из другой оно чет не берет..((
Можете выложить свои доработки, а то уже мучаюсь пару дней.
Заранее спасибо!
« Последнее редактирование: 24.02.2012, 13:59:05 от Zaicev »
*

Niko1

  • Осваиваюсь на форуме
  • 18
  • 0 / 0
Можете выложить свои доработки, а то уже мучаюсь пару дней.
Заранее спасибо!
Как я уже говорил, поставил плагин Extranews. Что бы он отображал "рандомные" новости в зависимости от языка, который сейчас активен, нужно открыть файл plg_extranews.php и в нем примерно в строку 308 вставить код:
Код
$document = & JFactory::getDocument();
if($document->language == 'uk-ua') {$lang_my = 'uk-UA';} else {$lang_my = 'en-GB';}
То есть, мы вызываем глоб. класс(или как там он правильно?), с которого можно вытащить язык текущей страницы. Все языки хранятся в БД и идентифицируются спец. тегами(например, uk-UA или ru-RU или en-GB). Их можно посмотреть и из админки(Расширения->Менеджер языков). Далее нам в этом же файле нужно поправить запрос на выборку с БД. Примерно в строку 316 вставляем код:
Код
$where .= ' AND a.language = "'.$lang_my.'"';
В данном случае, у меня 2 языка - укр. и англ. Если вам надо будет добавить, например, рус., то немного дополняем условие. Например так:
Код
if($document->language == 'uk-ua') {$lang_my = 'uk-UA';} elseif($document->language == 'ru-ru'){$lang_my = 'ru-RU';} else {$lang_my = 'en-GB';}
*

Zaicev

  • Захожу иногда
  • 120
  • 2 / 0
Как я уже говорил, поставил плагин Extranews. Что бы он отображал "рандомные" новости в зависимости от языка, который сейчас активен, нужно открыть файл plg_extranews.php и в нем примерно в строку 308 вставить код:
Код
$document = & JFactory::getDocument();
if($document->language == 'uk-ua') {$lang_my = 'uk-UA';} else {$lang_my = 'en-GB';}
То есть, мы вызываем глоб. класс(или как там он правильно?), с которого можно вытащить язык текущей страницы. Все языки хранятся в БД и идентифицируются спец. тегами(например, uk-UA или ru-RU или en-GB). Их можно посмотреть и из админки(Расширения->Менеджер языков). Далее нам в этом же файле нужно поправить запрос на выборку с БД. Примерно в строку 316 вставляем код:
Код
$where .= ' AND a.language = "'.$lang_my.'"';
В данном случае, у меня 2 языка - укр. и англ. Если вам надо будет добавить, например, рус., то немного дополняем условие. Например так:
Код
if($document->language == 'uk-ua') {$lang_my = 'uk-UA';} elseif($document->language == 'ru-ru'){$lang_my = 'ru-RU';} else {$lang_my = 'en-GB';}

Спасибо!
а у вас нет проблем  с выводом связных, а не рандомных ? А то у меня чет выводит статьи из одной категории..
*

Niko1

  • Осваиваюсь на форуме
  • 18
  • 0 / 0
Цитировать
а у вас нет проблем  с выводом связных, а не рандомных ? А то у меня чет выводит статьи из одной категории..
Не, со связными не пробовал
*

nthanter

  • Захожу иногда
  • 55
  • 1 / 1
спасибо большое, очень полезный плагин, помог в нужный момент.
*

serg450453

  • Захожу иногда
  • 272
  • 1 / 0
Всем доброго, установил данный плагин к себе на тестовый сайт, что бы немного разобраться.

Вот сайт http://www.it-informer.ru/komps/53-notebook/51-sony-vaio-s-vpcse1z9r.html


Вопрос в следующем. После установки конструкция страницы выглядит следующим образом

Заголовок
Текст статьи
Данный модуль
кнопки поделится
реклама от гугл
комментарии


А я бы хотел, чтобы данный плагин был после рекламмы Google.

Так как у меня познания не сильно высокие, я пошел сюда components/com_content/views/article/tmpl/

И там попытался поднять рекламу и соц кнопки. но ничего не вышло, так как реклама с кнопками начали отображаться сразу под заголовком.

Подскажите, где можно опустить этот плагин по ниже?
*

serg450453

  • Захожу иногда
  • 272
  • 1 / 0
Вопрос еще актуален
*

serg450453

  • Захожу иногда
  • 272
  • 1 / 0
Вопрос актуален
*

serg450453

  • Захожу иногда
  • 272
  • 1 / 0
Вопрос актуален
*

serg450453

  • Захожу иногда
  • 272
  • 1 / 0
Вопрос актуален
*

klerik0489

  • Осваиваюсь на форуме
  • 16
  • 0 / 0
Всем привет! (Поставил eRelated News плагин для вывода похожих новостей!!) правда он  чет совсем не очень, выводит кучу левого материала который можно отсортировать, кто-нибуть знает как решить проблемку?  может  найдется тут грамотный  хацкер и  допишет маленький кусочек скрипта  :'(  чтобы он выводил материалы по тегам .
*

dima

  • Осваиваюсь на форуме
  • 29
  • 0 / 0
Люди помогите, как сделать чтоб плагин выводил "Упорядочить по алфавиту","Сортировать по Теги" не друг под другом , а в 2 колонки
Код
<?php
/*------------------------------------------------------------------------

# elite_related_news.php - Plugin eRelated News

# ------------------------------------------------------------------------

# author    E-Content Site

# copyright Copyright (C) 2010 econtentsite.com. All Rights Reserved.

# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL

# Websites: http://www.econtentsite.com

# Technical Support:  Forum - http://forum.econtentsite.com

-------------------------------------------------------------------------*/
// no direct access
defined ( '_JEXEC' ) or die ( 'Restricted access' );
jimport ( 'joomla.plugin.plugin' );

class plgContentElite_Related_News extends JPlugin {
function plgContentElite_Related_News(&$subject, $params) {
parent::__construct ( $subject, $params );
}

function onPrepareContent(&$article, &$params, $limitstart) {
global $mainframe, $option;

if ((JRequest::getString('view','')!='article') || ($option != 'com_content') || (!$article->id)) {
return false;
}
$plugin =& JPluginHelper::getPlugin('content', 'elite_related_news');
$plg_param = new JParameter( $plugin->params );

$nonsection = $plg_param->get('nodisplaysection','');
$noncategory= $plg_param->get('nodisplaycategory', '');
$arr_nonsection = explode(',', $nonsection);
$arr_noncategory = explode(',', $noncategory);

if (is_int(array_search($article->sectionid, $arr_nonsection)) || is_int(array_search($article->catid, $arr_noncategory))) {
return false;
}

$lang =& JFactory::getLanguage();
$lang->load('plg_content_elite_related_news', JPATH_ADMINISTRATOR);
require_once (JPATH_SITE . DS . 'plugins' . DS . 'content' . DS . 'elite_related_news' . DS . 'autocuttext.php');

$show['created'] = intval($plg_param->get ( 'showcreated', 0 ));
$obj = new stdClass();
$obj->key = intval($plg_param->get ( 'createdposition', 0 ));
$obj->value = 'created';
$position[] = $obj;

$show['modified'] = intval($plg_param->get ( 'showmodified', 0 ));
$obj = new stdClass();
$obj->key = intval($plg_param->get ( 'alphabetposition', 0 ));
$obj->value = 'modified';
$position[] = $obj;

$show['alphabet'] = intval($plg_param->get ( 'showalphabet', 0 ));
$obj = new stdClass();
$obj->key = intval($plg_param->get ( 'alphabetposition', 0 ));
$obj->value = 'alphabet';
$position[] = $obj;

$show['randomize'] = intval($plg_param->get ( 'showrandomize', 0 ));
$obj = new stdClass();
$obj->key = intval($plg_param->get ( 'randomizeposition', 0 ));
$obj->value = 'randomize';
$position[] = $obj;

$show['ordering'] = intval($plg_param->get ( 'showordering', 0 ));
$obj = new stdClass();
$obj->key = intval($plg_param->get ( 'orderingposition', 0 ));
$obj->value = 'ordering';
$position[] = $obj;

$show['ordertag'] = intval($plg_param->get ( 'showordertag', 0 ));
$obj = new stdClass();
$obj->key = intval($plg_param->get ( 'ordertagposition', 0 ));
$obj->value = 'ordertag';
$position[] = $obj;

for ($i = 0; $i < count($position)-1; $i++) {
for ($j = $i+1; $j < count($position); $j++) {
if ($position[$i]->key>$position[$j]->key) {
$tmp = $position[$i];
$position[$i] = $position[$j];
$position[$j] = $tmp;
}
}
}
$document = & JFactory::getDocument ();
$document->addStyleDeclaration ( "
.erelated_news {
border-bottom: 1px solid #D2DADB;
    border-top: 1px solid #D2DADB;
    margin: 18px 0 0 !important;
    padding: 9px 0 0 5px !important;
}
.erelated_footer {
background: none repeat scroll 0 0 transparent !important;    
    float: right;
    margin: 0;
    padding: 0;
    text-decoration: none !important;
    text-transform: none;
}
.erelated_footer a {
background-color: inherit;
    color: #CCCCCC !important;
    font: 9px Verdana,Arial,Sans-Serif !important;
}
.erelated_tags {
border-top: 1px solid #D2DADB;
    margin: 18px 0 0 !important;
    padding: 9px 0 0 5px !important;
    font-weight: bold;
}

");
$enabletags = intval($plg_param->get ( 'enabletags', 1 ));
if ($enabletags) {
$tags = $this->tagsGenerated($article, $plg_param, $limitstart);

$tagsdisplay = $this->tagDisplay($tags);

$article->text .= $tagsdisplay;
$article->metakey = implode(', ', $tags);
}

$autodescription = intval($plg_param->get ( 'autodescription', 1 ));
if ($autodescription) {
$metadesc = $this->autoDescription($article, $plg_param, $limitstart);
if ($metadesc) {
$article->metadesc = $metadesc;
}
}

foreach ($position as $item) {
if ($item->value=='created' && $show['created']) {
$buffer=$this->getOrderCreated($article, $plg_param, $limitstart);
$article->text.=$buffer;
}
if ($item->value=='modified' && $show['modified']) {
$buffer=$this->getOrderModified($article, $plg_param, $limitstart);
$article->text.=$buffer;
}
if ($item->value=='alphabet' && $show['alphabet']) {
$buffer=$this->getOrderAlphabet($article, $plg_param, $limitstart);
$article->text.=$buffer;
}
if ($item->value=='randomize' && $show['randomize']) {
$buffer=$this->getOrderRandomize($article, $plg_param, $limitstart);
$article->text.=$buffer;
}
if ($item->value=='ordering' && $show['ordering']) {
$buffer=$this->getOrderOrdering($article, $plg_param, $limitstart);
$article->text.=$buffer;
}
if ($item->value=='ordertag' && $show['ordertag']) {
if (!$enabletags) {
$tags = $this->tagsGenerated($article, $plg_param, $limitstart);
}
$buffer=$this->getOrderOrderTag($article, $plg_param, $limitstart, $tags);
$article->text.=$buffer;
}
}
}

function autoDescription(&$article, &$params, $limitstart){

if (trim($article->metadesc)!= ''){
return false;
}
$wordnumber = intval($params->get ( 'descriptionword', 1 ));
$text = new AutoCutText ( $article->text, $wordnumber );
$introtext = strip_tags ( $text->getIntro () );
return $introtext;
}

function tagDisplay($tags){

$buffer = '<div class="erelated_tags">'.JText::_('Tags').':';
for ($i = 0; $i < count($tags); $i++) {
$tag = trim($tags[$i]);
if ($tag) {
$buffer .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='.JRoute::_('index.php?option=com_search&searchword='.$tag.'&searchphrase=exact').' target="_blank">'.$tag.'</a> ';
}
}
$buffer .= '</div>';
return $buffer;
}

function tagsGenerated(&$article, &$params, $limitstart) {
global $mainframe, $option;
$autokeyword = intval($params->get ( 'autokeyword', 1 ));
$keyword = explode(',', $article->metakey);
$keyword = trim($keyword[0]) == '' ? array() : $keyword;
$defaultkeyword = $params->get ( 'defaultkeyword', '' );
$defaultkeyword = explode(',', $defaultkeyword);
$defaultkeyword = (trim($defaultkeyword[0]) == '')? array() : $defaultkeyword;
$blacklistkeyword = $params->get ( 'blacklistkeyword', '' );
$articletmp = strip_tags($article->text);
if (!$autokeyword) {
for ($i = 0; $i < count($defaultkeyword); $i++) {
$str_default = trim($defaultkeyword[$i]);
if ($str_default=='') {
continue;
}
if (@preg_match('/'. $str_default .'/i', $article->metakey)) {
continue;
}
if (@preg_match('/'. $str_default .'/i', $blacklistkeyword)) {
continue;
}
if (@preg_match('/'. $str_default .'/i', $articletmp)) {
$keyword [] = $str_default;
}
}
return $keyword;
}
$db = &JFactory::getDBO();
$query = "SELECT * FROM #__core_log_searches WHERE search_term<>''";
$db->setQuery($query);
$rows = $db->loadObjectList();

for ($i = 0; $i < count($rows); $i++) {
$search_term = trim($rows[$i]->search_term);
if ($search_term=='') {
continue;
}
if (@preg_match('/'. $search_term .'/i', $article->metakey, $match)) {
continue;
}
if (@preg_match('/'. $search_term .'/i', $blacklistkeyword)) {
continue;
}
if (@preg_match('/'.$search_term.'/i', $articletmp, $match)) {
$keyword[] = $search_term;
}

}
$str_keyword = implode(' , ', $keyword);
for ($i = 0; $i < count($defaultkeyword); $i++) {
$str_default = trim($defaultkeyword[$i]);
if ($str_default=='') {
continue;
}
if (@preg_match('/'. $str_default .'/i', $blacklistkeyword)) {
continue;
}
if (@preg_match('/'. $str_default .'/i', $str_keyword)) {
continue;
}
if (@preg_match('/'. $str_default .'/i', $articletmp)) {
$keyword [] = $str_default;
}
}

return $keyword;
}

function makeClean($data) {
$str = preg_replace('/<.*?a.*?>/i', '', $data);
$str = preg_replace('/<img.*?>/i', '', $data);
$str = preg_replace('/<.*?script.*?>/i', '', $data);
}

function getOrderCreated(&$article, &$params, $limitstart) {
$arr ['numberview'] = $params->get ( 'creatednumberview', 10 );
$arr ['showtitle'] = $params->get ( 'createdshowtitle', 1 );
$arr ['c_title'] = $params->get ( 'createdtitle', '' );
$arr ['showdate'] = $params->get ( 'showdate', 1 );
$arr ['separate'] = $params->get ( 'separate', '' );
$arr ['dateformat'] = $params->get ( 'dateformat', '' );

$arr ['showcategory'] = $params->get ( 'createdshowcategory', 0 );
$arr ['recent'] = $params->get ( 'createdrecent', 'lastest' );

$arr ['nosection'] = $params->get ( 'createdsection', '' );
$arr ['nocategory'] = $params->get ( 'createdcategory', '' );

$arr ['showtip'] = $params->get ( 'showtip', 1 );
$arr ['numberword'] = $params->get ( 'numberword', 50 );
$arr ['displaytip'] = $params->get ( 'displaytip', 0 );
$arr ['tipstyle'] = $params->get ( 'tipstyle', 0 );
$arr ['width'] = $params->get ( 'width', 250 );
$arr ['custom_tip'] = $params->get ( 'custom_tip', '' );
$arr ['custom_title'] = $params->get ( 'custom_title', '' );
$arr ['custom_text'] = $params->get ( 'custom_text', '' );
$arr ['effect'] = $params->get ( 'effect', 1 );
$arr ['showdelay'] = $params->get ( 'showdelay', 0 );
$arr ['hidedelay'] = $params->get ( 'hidedelay', 0 );

$arr ['order'] = 'created';

return $this->getData($article->id, $arr);

}

function getOrderModified(&$article, &$params, $limitstart){
$arr ['numberview'] = $params->get ( 'modifiednumberview', 10 );
$arr ['showtitle'] = $params->get ( 'modifiedshowtitle', 1 );
$arr ['c_title'] = $params->get ( 'modifiedtitle', '' );
$arr ['showdate'] = $params->get ( 'showdate', 1 );
$arr ['separate'] = $params->get ( 'separate', '' );
$arr ['dateformat'] = $params->get ( 'dateformat', '' );

$arr ['showcategory'] = $params->get ( 'modifiedshowcategory', 0 );
$arr ['recent'] = $params->get ( 'modifiedrecent', 'lastest' );

$arr ['nosection'] = $params->get ( 'modifiedsection', '' );
$arr ['nocategory'] = $params->get ( 'modifiedcategory', '' );

$arr ['showtip'] = $params->get ( 'showtip', 1 );
$arr ['numberword'] = $params->get ( 'numberword', 50 );
$arr ['displaytip'] = $params->get ( 'displaytip', 0 );
$arr ['tipstyle'] = $params->get ( 'tipstyle', 0 );
$arr ['width'] = $params->get ( 'width', 250 );
$arr ['custom_tip'] = $params->get ( 'custom_tip', '' );
$arr ['custom_title'] = $params->get ( 'custom_title', '' );
$arr ['custom_text'] = $params->get ( 'custom_text', '' );
$arr ['effect'] = $params->get ( 'effect', 1 );
$arr ['showdelay'] = $params->get ( 'showdelay', 0 );
$arr ['hidedelay'] = $params->get ( 'hidedelay', 0 );

$arr ['order'] = 'modified';

return $this->getData($article->id, $arr);
}

function getOrderAlphabet(&$article, &$params, $limitstart){
$arr ['numberview'] = $params->get ( 'alphabetnumberview', 10 );
$arr ['showtitle'] = $params->get ( 'alphabetshowtitle', 1 );
$arr ['c_title'] = $params->get ( 'alphabettitle', '' );
$arr ['showdate'] = $params->get ( 'showdate', 1 );
$arr ['separate'] = $params->get ( 'separate', '' );
$arr ['dateformat'] = $params->get ( 'dateformat', '' );

$arr ['showcategory'] = $params->get ( 'alphabetshowcategory', 0 );
$arr ['recent'] = $params->get ( 'alphabetrecent', 'lastest' );

$arr ['nosection'] = $params->get ( 'alphabetsection', '' );
$arr ['nocategory'] = $params->get ( 'alphabetcategory', '' );

$arr ['showtip'] = $params->get ( 'showtip', 1 );
$arr ['numberword'] = $params->get ( 'numberword', 50 );
$arr ['displaytip'] = $params->get ( 'displaytip', 0 );
$arr ['tipstyle'] = $params->get ( 'tipstyle', 0 );
$arr ['width'] = $params->get ( 'width', 250 );
$arr ['custom_tip'] = $params->get ( 'custom_tip', '' );
$arr ['custom_title'] = $params->get ( 'custom_title', '' );
$arr ['custom_text'] = $params->get ( 'custom_text', '' );
$arr ['effect'] = $params->get ( 'effect', 1 );
$arr ['showdelay'] = $params->get ( 'showdelay', 0 );
$arr ['hidedelay'] = $params->get ( 'hidedelay', 0 );

$arr ['order'] = 'title';

return $this->getData($article->id, $arr);
}

function getOrderOrdering(&$article, &$params, $limitstart){
$arr ['numberview'] = $params->get ( 'orderingnumberview', 10 );
$arr ['showtitle'] = $params->get ( 'orderingshowtitle', 1 );
$arr ['c_title'] = $params->get ( 'orderingtitle', '' );
$arr ['showdate'] = $params->get ( 'showdate', 1 );
$arr ['separate'] = $params->get ( 'separate', '' );
$arr ['dateformat'] = $params->get ( 'dateformat', '' );

$arr ['showcategory'] = $params->get ( 'orderingshowcategory', 0 );
$arr ['recent'] = $params->get ( 'orderingrecent', 'lastest' );

$arr ['nosection'] = $params->get ( 'orderingsection', '' );
$arr ['nocategory'] = $params->get ( 'orderingcategory', '' );

$arr ['showtip'] = $params->get ( 'showtip', 1 );
$arr ['numberword'] = $params->get ( 'numberword', 50 );
$arr ['displaytip'] = $params->get ( 'displaytip', 0 );
$arr ['tipstyle'] = $params->get ( 'tipstyle', 0 );
$arr ['width'] = $params->get ( 'width', 250 );
$arr ['custom_tip'] = $params->get ( 'custom_tip', '' );
$arr ['custom_title'] = $params->get ( 'custom_title', '' );
$arr ['custom_text'] = $params->get ( 'custom_text', '' );
$arr ['effect'] = $params->get ( 'effect', 1 );
$arr ['showdelay'] = $params->get ( 'showdelay', 0 );
$arr ['hidedelay'] = $params->get ( 'hidedelay', 0 );

$arr ['order'] = 'ordering';

return $this->getData($article->id, $arr);
}

function getOrderRandomize(&$article, &$params, $limitstart){
$arr ['numberview'] = $params->get ( 'randomizenumberview', 10 );
$arr ['showtitle'] = $params->get ( 'randomizeshowtitle', 1 );
$arr ['c_title'] = $params->get ( 'randomizetitle', '' );
$arr ['showdate'] = $params->get ( 'showdate', 1 );
$arr ['separate'] = $params->get ( 'separate', '' );
$arr ['dateformat'] = $params->get ( 'dateformat', '' );

$arr ['showcategory'] = $params->get ( 'randomizeshowcategory', 0 );
$arr ['recent'] = 'randomize';

$arr ['nosection'] = $params->get ( 'randomizesection', '' );
$arr ['nocategory'] = $params->get ( 'randomizecategory', '' );

$arr ['showtip'] = $params->get ( 'showtip', 1 );
$arr ['numberword'] = $params->get ( 'numberword', 50 );
$arr ['displaytip'] = $params->get ( 'displaytip', 0 );
$arr ['tipstyle'] = $params->get ( 'tipstyle', 0 );
$arr ['width'] = $params->get ( 'width', 250 );
$arr ['custom_tip'] = $params->get ( 'custom_tip', '' );
$arr ['custom_title'] = $params->get ( 'custom_title', '' );
$arr ['custom_text'] = $params->get ( 'custom_text', '' );
$arr ['effect'] = $params->get ( 'effect', 1 );
$arr ['showdelay'] = $params->get ( 'showdelay', 0 );
$arr ['hidedelay'] = $params->get ( 'hidedelay', 0 );

$arr ['order'] = 'randomize';

return $this->getData($article->id, $arr);
}

function getOrderOrderTag(&$article, &$params, $limitstart, $tags){
$arr ['numberview'] = $params->get ( 'ordertagnumberview', 10 );
$arr ['showtitle'] = $params->get ( 'ordertagshowtitle', 1 );
$arr ['c_title'] = $params->get ( 'ordertagtitle', '' );
$arr ['showdate'] = $params->get ( 'showdate', 1 );
$arr ['separate'] = $params->get ( 'separate', '' );
$arr ['dateformat'] = $params->get ( 'dateformat', '' );

$arr ['showcategory'] = $params->get ( 'ordertagshowcategory', 0 );
$arr ['recent'] = $params->get ( 'ordertagrecent', 'lastest' );

$arr ['nosection'] = $params->get ( 'ordertagsection', '' );
$arr ['nocategory'] = $params->get ( 'ordertagcategory', '' );

$arr ['showtip'] = $params->get ( 'showtip', 1 );
$arr ['numberword'] = $params->get ( 'numberword', 50 );
$arr ['displaytip'] = $params->get ( 'displaytip', 0 );
$arr ['tipstyle'] = $params->get ( 'tipstyle', 0 );
$arr ['width'] = $params->get ( 'width', 250 );
$arr ['custom_tip'] = $params->get ( 'custom_tip', '' );
$arr ['custom_title'] = $params->get ( 'custom_title', '' );
$arr ['custom_text'] = $params->get ( 'custom_text', '' );
$arr ['effect'] = $params->get ( 'effect', 1 );
$arr ['showdelay'] = $params->get ( 'showdelay', 0 );
$arr ['hidedelay'] = $params->get ( 'hidedelay', 0 );

$arr ['tags']= $tags;

$arr ['order'] = 'ordertag';

return $this->getData($article->id, $arr);
}

function getData($id, $arr) {
global $mainframe, $Itemid;

$numberview = $arr ['numberview'];
$showtitle = $arr ['showtitle'];
$c_title = $arr ['c_title'];
$order = $arr ['order'];
$showdate = $arr ['showdate'];
$separate = $arr ['separate'];
$dateformat = $arr ['dateformat'];

$category = $arr ['showcategory'];
$recent = $arr ['recent'];

$nosection = $arr ['nosection'];
$nocategory = $arr ['nocategory'];
$showtip = $arr ['showtip'];
$numberword = $arr ['numberword'];
$displaytip = $arr ['displaytip'];
$tipstyle = $arr ['tipstyle'];
$width = $arr ['width'];
$custom_tip = $arr ['custom_tip'];
$custom_title = $arr ['custom_title'];
$custom_text = $arr ['custom_text'];
$effect = $arr ['effect'];
$showdelay = $arr ['showdelay'];
$hidedelay = $arr ['hidedelay'];

$row = &JTable::getInstance ( 'content' );
$row->load ( $id );

$db = &JFactory::getDBO ();

$where = array ();
$where [] = "id != $row->id";
$jnow = & JFactory::getDate ();
$now = $jnow->toMySQL ();
$nullDate = $db->getNullDate ();

$where [] .= ' ( state = 1' . ' AND ( publish_up = ' . $db->Quote ( $nullDate ). ' OR publish_up <= ' . $db->Quote ( $now ). ' )' . ' AND ( publish_down = ' . $db->Quote ( $nullDate ). ' OR publish_down >= ' . $db->Quote ( $now ). ' )' . '   ) ';
if ($order != 'ordertag') {
$where [] = "catid = " . $row->catid;
}

switch ($recent) {
case 'newer' :
if ($order == 'ordertag') {
$where [] = "  created >= '" . $row->created . "'";
} elseif ($order != 'title' && $order != 'ordering'){
$where [] = "  $order >= '" . $row->$order . "'";
} elseif ($order == 'ordering' || $order == 'title') {
$where [] = "  $order <= '" . $row->$order . "'";
}
break;
case 'older' :
if ($order == 'ordertag'){
$where [] = "  created <= '" . $row->created . "'";
} elseif ($order != 'title' && $order != 'ordering'){
$where [] = "  $order <= '" . $row->$order . "'";
} elseif ($order == 'ordering' || $order == 'title') {
$where [] = "  $order >= '" . $row->$order . "'";
}
break;
case 'randomize':
case 'lastest' :
default :
break;
}
if ($nosection) {
$where [] = " NOT (sectionid in ($nosection)) ";
}
if ($nocategory) {
$where [] = " NOT (catid in ($nocategory)) ";
}

if ($order == 'ordertag') {
$ordercmd = 'created';
} else {
$ordercmd = $order;
}

if ($order == 'title' || $order == 'ordering') {
$ordercmd .= ' ASC';
} else {
$ordercmd .= ' DESC';
}

if ($order == 'ordertag') {
$tags = $arr ['tags'];
for ($i = 0; $i < count($tags); $i++) {
$tags[$i] = " `introtext` LIKE '%".$tags[$i]."%' OR `fulltext` LIKE '%".$tags[$i]."%' ";
}
$where [] = '('.implode(' OR ', $tags).')';
}

$where_str = implode ( ' AND ', $where );
if ($order=='randomize') {
$query = "SELECT * FROM #__content WHERE " . $where_str;
} else {
$query = "SELECT * FROM #__content WHERE " . $where_str . " ORDER BY " . $ordercmd;
}

$db->setQuery ( $query );
$rows = $db->loadObjectList ();
if (! count ( $rows )) {
return false;
}

$classname = uniqid ( 'erelated_' );

JHTML::_ ( 'behavior.tooltip' );
$document = & JFactory::getDocument ();

$effect_script = $effect ? "initialize:function(){this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);},onShow: function(toolTip) {this.fx.start(1);},onHide: function(toolTip) { this.fx.start(0);}," : '';

if (! $tipstyle) {
$document->addStyleDeclaration ( "

.$classname-tip {
color: #000;
width: " . $width . "px;
z-index: 13000;
}

.$classname-title {
font-weight: bold;
font-size: 11px;
margin: 0;
color: #000000;
padding: 8px 8px 4px;
background: #FFFFFF;
border-bottom: 1px solid #D2DADB;
border-top: 1px solid #D2DADB;
border-left: 1px solid #D2DADB;
border-right: 1px solid #D2DADB;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
}

.$classname-text {
font-size: 11px;
padding: 4px 8px 8px;
background: #FFFFFF;
border-bottom: 1px solid #D2DADB;
border-right: 1px solid #D2DADB;
border-left: 1px solid #D2DADB;
-moz-border-radius-bottomleft: 5px;
-moz-border-radius-bottomright: 5px;
}
" );
?>
<script type="text/javascript">
window.addEvent('load', function(){
var <?php echo $classname;?> = new Tips($$('.<?php echo $classname; ?>'), {<?php echo $effect_script;?>
showDelay: <?php echo $showdelay;?>,
hideDelay: <?php echo $hidedelay;?>,
className: '<?php echo $classname;?>'
});
});
</script>
<?php
} else {
$document->addStyleDeclaration ( "
.$classname-tip {
width: " . $width . "px;
$custom_tip
}
.$classname-title {
$custom_title
}

.$classname-text {
$custom_text
}
" );

?>
<script type="text/javascript">
window.addEvent('load', function(){
var <?php echo $classname;?> = new Tips($$('.<?php echo $classname; ?>'),{<?php echo $effect_script;?>
showDelay: <?php echo $showdelay;?>,
hideDelay: <?php echo $hidedelay;?>,
className: '<?php echo $classname;?>'
});
});
</script>
<?php
}

switch ($recent) {
case 'newer' :
$start = count ( $rows ) - $numberview;
$start = ($start < 0)? 0 : $start;
$data = array_slice ( $rows, $start, $numberview );
$title = JText::_ ( 'MORE_RECENT_ARTICLES' );
break;
case 'older' :
$data = array_slice ( $rows, 0, $numberview );
$title = JText::_ ( 'OLDER_ARTICLES' );
break;
case 'randomize':
$rows = $this->shuffle_assoc($rows);
$data = array_slice ( $rows, 0, $numberview );
$title = JText::_ ( 'OTHER_ARTICLES' );
break;
case 'lastest' :
default :
$data = array_slice ( $rows, 0, $numberview );
$title = JText::_( 'LATEST_ARTICLES' );
break;
}

switch ($order) {
case 'created' :
$datetitle = JText::_ ( 'DATETILECREATE' );
break;
case 'modified' :
$datetitle = JText::_ ( 'DATETILEMODIFIED' );
break;
default :
$datetitle = JText::_ ( 'DATETILECREATE' );
break;
}
$category_row = &JTable::getInstance('category');
$category_row->load($row->catid);

$title = ($c_title == '')? $title : $c_title;

$title = (intval($category))? $title.' - '.$category_row->title : $title;

$title = intval ( $showtitle )? $title : '';
$buffer = "<div class=\"erelated_news\"><span><b>" . $title . "</b></span><ul style=\"text-align:left;\">";

for($i = 0; $i < count ( $data ); $i ++) {
$introtext = $data [$i]->introtext;

switch ($displaytip) {
case 0:
$introtext = strip_tags ( $introtext );
$introtext = $this->filterintro ( $introtext, $numberword );
break;
case 1:
preg_match('/<img.*?src="(.*?)".*>/i', $introtext, $match);
$imagetip = '';
if (count($match)) {
$imglink = $this->makelink(JURI::root(),$match[1]);
$imagetip = htmlspecialchars('<img title="'.$data [$i]->title.'" alt="'.$data [$i]->title.'" src="'.$imglink.'" border="0" style="float: left; padding: 5px; width: '.round($width/3).'px;" />');
}
$introtext = strip_tags ( $introtext );
$introtext = $imagetip.$this->filterintro ( $introtext, $numberword );
break;
case 2:
default:
$text = new AutoCutText ( $introtext, $numberword );
$introtext = htmlspecialchars ( $text->getIntro () );
break;
}
$dateshow = $order=='modified' ? $data [$i]->modified : $data [$i]->created;
switch ($showdate) {
case 1 :
$before = ' ';
$after = ' ';
break;
case 2 :
$before = '<small>('. $datetitle . ' ' . date ( $dateformat, strtotime ( $dateshow ) ). ') ' . $separate . '</small> ';
$after = ' ';
break;
case 3 :
$before = ' ';
$after = ' <small>'. $separate . ' (' . $datetitle . ' ' . date ( $dateformat, strtotime ( $dateshow ) ). ')</small>';
break;
default :
$before = ' ';
$after = ' ';
break;
}

if ($showtip) {
$buffer .= '
<li>
' . $before . '<a class="' . $classname . '" title="' . htmlspecialchars ( $data [$i]->title ). '::' . $introtext . '..." href="' . JRoute::_ ( "index.php?option=com_content&view=article&id=" . $data [$i]->id . ':' . $data [$i]->alias . '&catid=' . $data [$i]->catid . '&Itemid=' . $Itemid ). '">' . $data [$i]->title . '</a> ' . $after . '
</li>';
} else {
$buffer .= '
<li>
' . $before . '<a href="' . JRoute::_ ( "index.php?option=com_content&view=article&id=" . $data [$i]->id . ':' . $data [$i]->alias . '&catid=' . $data [$i]->catid . '&Itemid=' . $Itemid ). '">' . $data [$i]->title . '</a> ' . $after . '
</li>';
}
}

$buffer .= '<div class="erelated_footer"><a target="_blank" title="Секс форум" href="http://institutsexa.ru/forum/index.html">Секс форум</a></div>';
$buffer .= "</ul></div>";

return $buffer;
}

function shuffle_assoc($list) {
  if (!is_array($list)) return $list;

  $keys = array_keys($list);
  shuffle($keys);
  $random = array();
  foreach ($keys as $key)
    $random[$key] = $list[$key];

  return $random;
}

function filterintro($introtext, $numberword) {
$arr_text = preg_split ( '/ /', trim ( $introtext ) );
$newarray = array_slice ( $arr_text, 0, $numberword );
$text = implode ( ' ', $newarray );
return $text;
}

function makelink($host='', $link){

if (preg_match('/^http:\/\/.*/i', $link) || preg_match('/^mailto:.*/i', $link)) {
return $link;
} elseif (preg_match('/^\/.*/i', $link)) {
$referer = parse_url($host);
$domain = $referer['host'];
return 'http://'.$domain.$link;
} else{
$slash = strrpos($host, '/') + 1;
$host = substr($host,0, $slash);
return $host.$link;
}
}
}
« Последнее редактирование: 14.09.2012, 08:43:01 от dima »
*

dima

  • Осваиваюсь на форуме
  • 29
  • 0 / 0
плачу 200руб
« Ответ #50 : 14.09.2012, 08:54:27 »
Что никто не знает , плачу 200руб. кто подскажет. Вот тут можно глянуть , как у меня сейчас http://institutsexa.ru/seks-kompleksy/230-lishnij-ves-v-sekse.html
« Последнее редактирование: 14.09.2012, 08:58:35 от dima »
*

robotwerder

  • Захожу иногда
  • 248
  • 6 / 1
плагин отличный ..
Но вот беда, выводит лишь предыдущие и следующие материалы, а меня интересуют похожие((

Косяк скорее всего в том, что он (предполагаю подсасывает материалы из базки по description и title? ну мож keywords)?
а я помню что в свое время накатывал небезизвестный патч для индивидуальногог title

Вот подозреваю что косяк в этом вопросе(

Может ли кто нить помочь с решением вопроса ?!
*

THE KILLERS

  • Давно я тут
  • 916
  • 28 / 0
Почему-то у меня этот плагин не показывает материалы из других категорий, а только из одной категории. Подскажите пожалуйста.
*

spirtus

  • Новичок
  • 1
  • 0 / 0

Всем привет. Подскажите, где заменить  английский на русский  слов "Tags, related articles, created"  при выводе модуля. Вроде все файлы плагина  перерыл, но так и не нашел.
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Плагин LVSpoiler - спойлеры с динамической загрузкой изображений

Автор Arkadiy

Ответов: 449
Просмотров: 93581
Последний ответ 20.04.2024, 21:10:33
от Beer
News Calendar Joomla 3.0 - html5 - Rus

Автор leo78

Ответов: 26
Просмотров: 13089
Последний ответ 21.11.2023, 18:32:21
от Bommbba
Плагин StopKids для маркировки сайта знаком 18+ для Joomla 1.5-3.x

Автор ecolora

Ответов: 40
Просмотров: 19883
Последний ответ 19.03.2023, 18:55:08
от ecolora
Компонент Commedia и плагин mp3browser для медиа-сайтов

Автор ecolora

Ответов: 557
Просмотров: 119115
Последний ответ 13.03.2023, 00:25:14
от ecolora
Плагин seoLinks

Автор alexandr-spb

Ответов: 0
Просмотров: 1198
Последний ответ 26.01.2023, 23:08:41
от alexandr-spb