Здравствуйте, Гость. Выберите Вход или Регистрация
18.12.2005 07:27:01

Войти
Прежде чем создавать новую тему, задавая вопрос, убедительная просьба ко всем участникам форума без исключения - используйте систему Поиск Так вы сможете сэкономить своё время и нервы. А также, новые созданные темы будут удаляться в том случае, если подобная тема уже создана.
Поиск:     Расш.поиск
3049 сообщений в 655 тем - 2871 участников Новый участник: - serg Most online today: 9 - most online ever: 20 (29.07.2005 09:24:57)
  Форум Datso.Net
  Mambo 4.5
  Мамботы 4.5
  Discuss-mambot от SimpleBoard 1.0.4b2 проблемы с кирилицей
0 участников и 1 гость просмотров этой темы « предыдущая следующая »
Страницы: [1]
Автор Тема: Discuss-mambot от SimpleBoard 1.0.4b2 проблемы с кирилицей  (прочитано 370 раз)
Vitaliy
Новенький


Репутация: 0
Offline

Пол:
Сообщений: 3



Discuss-mambot от SimpleBoard 1.0.4b2 проблемы с кирилицей
« : 26.06.2005 20:22:26 »

Функция "обсудить в форуме" работает как-то странно: в формирующейся по ссылке новой теме название темы глючит - начало по-русски, а заканчивается закорючками.

Пример: "Тема:   Достаточно общаИыЗЛ"


и так дальше в таком же духе. Причем некоторые темы все-таки обрабатываются нормально, но это за ОЧЕНЬ редким исключением :(
решить самостоятельно пока так и не смог, на других бордах тоже не нашел решений :(
хелм одним словом.

Специально для тех умельцев которые захотят помоч, но у них нет времени искать в инете и скачивать этот бот, кидаю его код сюда.

Файл simpleboardmosbot.inc

код:
// $Id: simpleboardmosbot.inc,v 1.0 06-04-2004 00:22:57 Jick Exp $
/**
* @Add forum link to content mosbot
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.0 $
* @Original_author Jick - [email protected]
* @AdaptedBy TSMF - http://tsmf.jigsnet.com
**/

defined'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

function 
MOSBOT_add_sbforumlink( &$row ) {
  global 
$database$mainframe$my;

   
$mos_sb_discuss_entrytext $row->text;
   
$mos_sb_discuss_matches = array();
   if (
preg_match_all("/{mos_sb_discuss:.+?}/"$mos_sb_discuss_entrytext$mos_sb_discuss_matchesPREG_PATTERN_ORDER) > 0) {
      foreach (
$mos_sb_discuss_matches[0] as $mos_sb_discuss_match) {
         
$showbottext "";
         
$mos_sb_discuss_match str_replace("{mos_sb_discuss:"""$mos_sb_discuss_match);
         
$mos_sb_discuss_match str_replace("}"""$mos_sb_discuss_match);
         
$showbottext make_sbforumlink$mos_sb_discuss_match$row);
   
         
$mos_sb_discuss_entrytext preg_replace("/{mos_sb_discuss:".$mos_sb_discuss_match."}/"$showbottext$mos_sb_discuss_entrytext1);

      }
      
$row->text $mos_sb_discuss_entrytext;
   }
}

function 
make_sbforumlink($catid, &$row){
   global 
$database$mainframe$my$mosConfig_absolute_path;

// Include the simpleboard config file
if (file_exists$mosConfig_absolute_path.'/administrator/components/com_simpleboard/simpleboard_config.php' )) {
   include( 
$mosConfig_absolute_path.'/administrator/components/com_simpleboard/simpleboard_config.php' );
   } 
   else {
   return 
'Error, missing simpleboard config file!';
   }

$mosConfig_lang=$mainframe->getCfg'lang' );   
if (
file_exists($mosConfig_absolute_path.'/administrator/components/com_simpleboard/language/'.$mosConfig_lang.'.php')) {
  include_once(
$mosConfig_absolute_path.'/administrator/components/com_simpleboard/language/'.$mosConfig_lang.'.php');
} else {
  include_once(
$mosConfig_absolute_path.'/administrator/components/com_simpleboard/language/english.php');
}

if (! 
$sbConfig['discussBot'] ) {return '';}

$database->setQuery("select id from #__menu where link='index.php?option=com_simpleboard'");
$Itemid=$database->loadResult();

// Check if the subject as content title exists in the messages table
   
$database->setQuery("SELECT id"
   
"\nFROM #__sb_messages"
   
"\nWHERE catid = ".$catid." AND subject = '".$row->title."'");
   
$resultid $database->loadResult();


// If there is no result from the first query let the link open a new reply possibility
if ($resultid == ""){
   
$showlink sefRelToAbs("index.php?option=com_simpleboard&Itemid=" $Itemid
   
"&func=post&do=newFromBot&resubject=".strtr(base64_encode($row->title), "+/""()")."&catid=".$catid
   
"&rowid=".$row->id
   
);
   
$countPosts=0;
}   

// If there is no result from the first query do an insert and get the new id
   
else{
   
$database->setQuery("SELECT count(id) from #__sb_messages where thread=$resultid");
   
$countPosts=$database->loadResult();
   
// Create the sef link and return it   
      
$showlink sefRelToAbs("index.php?option=com_simpleboard&Itemid=" $Itemid
      
"&func=view&id=" $resultid
      
"&catid=" $catid
      
);

   }

//return ' Title='.$title.' - Resultid='.$resultid.' '._MOSBOT_DISCUSS_A.''._MOSBOT_DISCUSS_B.' ';   
return '
.$showlink.'">'._MOSBOT_DISCUSS_A.''.$countPosts.''._MOSBOT_DISCUSS_B.'
'
;   
      
}

?>



simpleboardmosbot.php

код:
// $Id: simpleboardmosbot.php,v 1.0 06-04-2004 00:22:57 Jick Exp $
/**
* @Add forum link to content mosbot
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.0 $
* @author Jick - [email protected]
**/

defined'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

// $row and $mask are made available by the calling function

/**
* Add forum link to content mosbot
*
Usage:
* {mos_sb_discuss}catid=cat_id{/mos_sb_discuss}
*/

require_once( "$mosConfig_absolute_path/mambots/simpleboardmosbot.inc" );

MOSBOT_add_sbforumlink$row );

?>
IP записан

Моя хата:
Страницы: [1]  
« предыдущая следующая »
Перейти к:  

Форум Datso.Net | Используется SMF 1.1 RC1.
© 2001-2005, Lewis Media. Все права защищены

FD design by Andrey Datso