1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-20 17:58:24 +03:00

fix cut topic text

This commit is contained in:
Mzhelskiy Maxim 2010-05-18 13:36:32 +00:00
parent 37dfa11c1f
commit 021fe4f1f7
2 changed files with 9 additions and 17 deletions

View file

@ -286,18 +286,14 @@ class ActionTopic extends Action {
$oTopic->setType('topic');
$oTopic->setTitle(getRequest('topic_title'));
$oTopic->setTextHash(md5(getRequest('topic_text')));
/**
* Парсим на предмет ХТМЛ тегов
*/
$sText=$this->Text_Parser(getRequest('topic_text'));
/**
* Получаемый и устанавливаем разрезанный текст по тегу <cut>
*/
list($sTextShort,$sTextNew,$sTextCut) = $this->Text_Cut($sText);
list($sTextShort,$sTextNew,$sTextCut) = $this->Text_Cut(getRequest('topic_text'));
$oTopic->setCutText($sTextCut);
$oTopic->setText($sTextNew);
$oTopic->setTextShort($sTextShort);
$oTopic->setText($this->Text_Parser($sTextNew));
$oTopic->setTextShort($this->Text_Parser($sTextShort));
$oTopic->setTextSource(getRequest('topic_text'));
$oTopic->setTags(getRequest('topic_tags'));
@ -417,18 +413,14 @@ class ActionTopic extends Action {
$oTopic->setBlogId($oBlog->getId());
$oTopic->setTitle(getRequest('topic_title'));
$oTopic->setTextHash(md5(getRequest('topic_text')));
/**
* Парсим на предмет ХТМЛ тегов
*/
$sText=$this->Text_Parser(getRequest('topic_text'));
/**
* Получаемый и устанавливаем разрезанный текст по тегу <cut>
*/
list($sTextShort,$sTextNew,$sTextCut) = $this->Text_Cut($sText);
list($sTextShort,$sTextNew,$sTextCut) = $this->Text_Cut(getRequest('topic_text'));
$oTopic->setCutText($sTextCut);
$oTopic->setText($sTextNew);
$oTopic->setTextShort($sTextShort);
$oTopic->setText($this->Text_Parser($sTextNew));
$oTopic->setTextShort($this->Text_Parser($sTextShort));
$oTopic->setTextSource(getRequest('topic_text'));
$oTopic->setTags(getRequest('topic_tags'));

View file

@ -207,7 +207,7 @@ class LsText extends Module {
$sTextNew = $sText;
$sTextCut = null;
$sTextTemp=str_replace("\r\n",'[<rn>]',getRequest('topic_text'));
$sTextTemp=str_replace("\r\n",'[<rn>]',$sText);
$sTextTemp=str_replace("\n",'[<n>]',$sTextTemp);
if (preg_match("/^(.*)<cut(.*)>(.*)$/Ui",$sTextTemp,$aMatch)) {
@ -215,8 +215,8 @@ class LsText extends Module {
$aMatch[1]=str_replace('[<n>]',"\r\n",$aMatch[1]);
$aMatch[3]=str_replace('[<rn>]',"\r\n",$aMatch[3]);
$aMatch[3]=str_replace('[<n>]',"\r\n",$aMatch[3]);
$sTextShort=$this->Parser($aMatch[1]);
$sTextNew=$this->Parser($aMatch[1].' '.$aMatch[3]);
$sTextShort=$aMatch[1];
$sTextNew=$aMatch[1].' '.$aMatch[3];
if (preg_match('/^\s*name\s*=\s*"(.+)"\s*\/?$/Ui',$aMatch[2],$aMatchCut)) {
$sTextCut=trim($aMatchCut[1]);
}