Перейти к контенту
  • 0

Вложенность цитат, глюки.


evildoer

Вопрос

Сюда смотри:

[QUOTE]Text #1[/QUOTE]
Text #2[/QUOTE]Quote #1[QUOTE]Text #3
[QUOTE]Text #4[/QUOTE]

При вставле в версии 1.3 (я пробовал пока что только в версии от Игорька) - получается нечто нехорошее - проверте, убедитесь возможно и скажите плиз как бы это лучше исправить, я что-то невнятное помудил - вродь получилось, но слишком лольно, хотело бы так сказать от "производителя" "отгадку" получить :D

 

Блин ;)

Ссылка на комментарий
Поделиться на других сайтах

Рекомендуемые сообщения

  • 0

от Vicer от баловник ... опубликовал глюк и пошел он бродить по сети

Находим:
/ ********************************************************************************
********************/
// regex_parse_quotes: Builds this quote tag HTML
// [QUOTE] .. [/QUOTE] - allows for embedded quotes
/**************************************************/

function regex_parse_quotes($the_txt="") {

if ($the_txt == "") return;

$txt = $the_txt;

// Too many embedded code/quote/html/sql tags can crash Opera and Moz

/*if (preg_match( "/\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\]/is", $txt) ) {
 $this->quote_error++;
 return $txt;
}*/

$this->quote_html = $this->wrap_style( array( 'STYLE' => 'QUOTE' ) );

$txt = preg_replace( "#\[quote\]#ie"                        , "\$this->regex_simple_quote_tag()"    , $txt );
$txt = preg_replace( "#\[quote=([^\]]+?),([^\]]+?)\]#ie"    , "\$this->regex_quote_tag('\\1', '\\2')"  , $txt );
$txt = preg_replace( "#\[quote=([^\]]+?)\]#ie"              , "\$this->regex_quote_tag('\\1', '')"  , $txt );
$txt = preg_replace( "#\[/quote\]#ie"                       , "\$this->regex_close_quote()"          , $txt );

$txt = preg_replace( "/\n/", "<br>", $txt );

if ( ($this->quote_open == $this->quote_closed) and ($this->quote_error == 0) )
{
 $txt = preg_replace( "#(<!--QuoteEBegin-->.+?<!--QuoteEnd-->)#es", "\$this->regex_preserve_spacing('\\1')", trim($txt) );

 return $txt;
}
else
{
 return $the_txt;
}

}
Заменяем:
/ ********************************************************************************
********************/
// regex_parse_quotes: Builds this quote tag HTML
// [QUOTE] .. [/QUOTE] - allows for embedded quotes
/**************************************************/

function regex_parse_quotes($the_txt="") {

if ($the_txt == "") return;

$txt = $the_txt;

// Too many embedded code/quote/html/sql tags can crash Opera and Moz

/*if (preg_match( "/\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\]/is", $txt) ) {
 $this->quote_error++;
 return $txt;
}*/

$this->quote_html = $this->wrap_style( array( 'STYLE' => 'QUOTE' ) );

$txt = preg_replace( "#\[quote\](.+?)\[\/quote\]#ies"                        , "\$this->regex_simple_quote_tag('\\1')"    , $txt );
$txt = preg_replace( "#\[quote=([^\]]+?),([^\]]+?)\](.+?)\[\/quote\]#ies"    , "\$this->regex_quote_tag('\\1', '\\2', '\\3')"  , $txt );
$txt = preg_replace( "#\[quote=([^\]]+?)\](.+?)\[\/quote\]#ies"              , "\$this->regex_quote_tag('\\1', '', '\\2')"  , $txt );

$txt = preg_replace( "/\n/", "<br>", $txt );


if ($this->quote_error == 0)
{
 $txt = preg_replace( "#(<!--QuoteEBegin-->.+?<!--QuoteEnd-->)#es", "\$this->regex_preserve_spacing('\\1')", trim($txt) );

 return $txt;
}
else
{
 return $the_txt;
}

}


Находим:
/**************************************************/
// regex_simple_quote_tag: Builds this quote tag HTML
// [QUOTE] .. [/QUOTE]
/**************************************************/

function regex_simple_quote_tag() {
global $ibforums;

$this->quote_open++;

return "<!--QuoteBegin-->{$this->quote_html['START']}<!--QuoteEBegin-->";

}
Заменяем:
/**************************************************/
// regex_simple_quote_tag: Builds this quote tag HTML
// [QUOTE] .. [/QUOTE]
/**************************************************/

function regex_simple_quote_tag($txt="") {
global $ibforums;

return "<!--QuoteBegin-->{$this->quote_html['START']}<!--QuoteEBegin-->".$txt."<!--QuoteEnd-->{$this->quote_html['END']}<!--QuoteEEnd-->";

}


Удаляем:
/**************************************************/
// regex_close_quote: closes a quote tag
//
/**************************************************/

function regex_close_quote() {

if ($this->quote_open == 0)
{
 $this->quote_error++;
  return;
}

$this->quote_closed++;

return "<!--QuoteEnd-->{$this->quote_html['END']}<!--QuoteEEnd-->";
}

Находим:
/**************************************************/
// regex_quote_tag: Builds this quote tag HTML
// [QUOTE=Matthew,14 February 2002]
/**************************************************/

function regex_quote_tag($name="", $date="")
{
global $ibforums;

if ( $date != "" )
{
 $default = "\[quote=$name,$date\]";
}
else
{
 $default = "\[quote=$name\]";
}

if ( strstr( $name, '<!--c1-->' ) or strstr( $date, '<!--c1-->' ) )
{
 // Code tag detected...

 $this->quote_error++;
  return $default;
}

$name = str_replace( "+", "+", $name );
$name = str_replace( "-", "-", $name );
$name = str_replace( '[', "[", $name );
$name = str_replace( ']', "]", $name );

$this->quote_open++;

if ($date == "")
{
 $html = $this->wrap_style( array( 'STYLE' => 'QUOTE', 'EXTRA' => "($name)" ) );
}
else
{
 $html = $this->wrap_style( array( 'STYLE' => 'QUOTE', 'EXTRA' => "($name @ $date)" ) );
}

$extra = "-".$name.'+'.$date;

return "<!--QuoteBegin".$extra."-->{$html['START']}<!--QuoteEBegin-->";

}
Заменяем:
/**************************************************/
// regex_quote_tag: Builds this quote tag HTML
// [QUOTE=Matthew,14 February 2002]
/**************************************************/

function regex_quote_tag($name="", $date="", $txt="")
{
global $ibforums;

if ( $date != "" )
{
 $default = "\[quote=$name,$date\]\[\/quote\]";
}
else
{
 $default = "\[quote=$name\]\[\/quote\]";
}

if ( strstr( $name, '<!--c1-->' ) or strstr( $date, '<!--c1-->' ) )
{
 // Code tag detected...

 $this->quote_error++;
  return $default;
}

$name = str_replace( "+", "+", $name );
$name = str_replace( "-", "-", $name );
$name = str_replace( '[', "[", $name );
$name = str_replace( ']', "]", $name );

$this->quote_open++;

if ($date == "")
{
 $html = $this->wrap_style( array( 'STYLE' => 'QUOTE', 'EXTRA' => "($name)" ) );
}
else
{
 $html = $this->wrap_style( array( 'STYLE' => 'QUOTE', 'EXTRA' => "($name @ $date)" ) );
}

$extra = "-".$name.'+'.$date;

return "<!--QuoteBegin".$extra."-->{$html['START']}<!--QuoteEBegin-->".$txt."<!--QuoteEnd-->{$this->quote_html['END']}<!--QuoteEEnd-->";

}

Ссылка на комментарий
Поделиться на других сайтах

  • 0

овчинка ИМХО выделки не стоит.

Лучше бы чем посерьёзней занялись :D

Ссылка на комментарий
Поделиться на других сайтах

  • 0
Находим:
Находим в post_parser.php :)

 

овчинка ИМХО выделки не стоит.

Лучше бы чем посерьёзней занялись ;)

Может выделки оно и не стоит, но внешний вид форума покорежит будь здоров :)

 

зы Посерьезней мне и на работе хватает :) А это так... в свободное время балуемся... :D

Ссылка на комментарий
Поделиться на других сайтах

  • 0
Только не большая поправка - после одиночного / не должно быть пробелов - иначе комментом не считается... чушь - но ошибки выдаёт :D
Ссылка на комментарий
Поделиться на других сайтах

Присоединиться к обсуждению

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

Гость
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Ответить на вопрос...

×   Вы вставили отформатированный текст.   Удалить форматирование

  Допустимо не более 75 смайлов.

×   Ваша ссылка была автоматически заменена на медиа-контент.   Отображать как ссылку

×   Ваши публикации восстановлены.   Очистить редактор

×   Вы не можете вставить изображения напрямую. Загрузите или вставьте изображения по ссылке.

Зарузка...
×
×
  • Создать...

Важная информация

Находясь на нашем сайте, вы соглашаетесь на использование файлов cookie, а также с нашим положением о конфиденциальности Политика конфиденциальности и пользовательским соглашением Условия использования.