Пример: "Тема: Достаточно общаИыЗЛ"
и так дальше в таком же духе. Причем некоторые темы все-таки обрабатываются нормально, но это за ОЧЕНЬ редким исключением :(
решить самостоятельно пока так и не смог, на других бордах тоже не нашел решений :(
хелм одним словом.
Специально для тех умельцев которые захотят помоч, но у них нет времени искать в инете и скачивать этот бот, кидаю его код сюда.
Файл 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_matches, PREG_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_entrytext, 1);
}
$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 '
}
?>
/**
* @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_matches, PREG_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_entrytext, 1);
}
$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 );
?>
/**
* @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 );
?>