예제 #1
0
파일: tools.php 프로젝트: gitkv/bash
function convert_quote_tag($text = "", $quote_table_class, $quote_head_class, $quote_body_class)
{
    global $QUOTE_ERROR, $QUOTE_OPENED, $QUOTE_CLOSED;
    if ($text == '') {
        return '';
    }
    $text = stripslashes($text);
    $helper = new CConvertorsPregReplaceHelper("");
    $helper->setQuoteClasses($quote_table_class, $quote_head_class, $quote_body_class);
    $txt = $text;
    $txt = preg_replace_callback("#\\[quote\\]#i", array($helper, "convertOpenQuoteTag"), $txt);
    $txt = preg_replace_callback("#\\[/quote\\]#i", array($helper, "convertCloseQuoteTag"), $txt);
    if ($helper->checkQuoteError()) {
        return $txt;
    } else {
        return $text;
    }
}