Автор: S2pidsMan: Дата: 02.28.2011
Доброго времени.
Вот мучаю вывод с форума на сайт и получил ошибку
Notice: Undefined index: close in C:\apache\localhost\www\functionbb.php on line 40
function bbcode($sText)
{
$sTagArray['hr'] = array('tag'=>'
');
$sTagArray['eagudo'] = array('tag'=>'é');
$atagArray['img'] = array('open'=>'');
$atagArray['b'] = array('open'=>'', 'close'=>'');
$atagArray['i'] = array('open'=>'', 'close'=>'');
$atagArray['u'] = array('open'=>'', 'close'=>'');
$atagArray['s'] = array('open'=>'', 'close'=>'');
$atagArray['table'] = array('open'=>'', 'close'=>'
');
$atagArray['td'] = array('open'=>'', 'close'=>' ');
$atagArray['tr'] = array('open'=>'', 'close'=>' ');
$atagArray['pre'] = array('open'=>'', 'close'=>'');
$atagArray['esquerda'] = array('open'=>'', 'close'=>'
');
$atagArray['direita'] = array('open'=>'', 'close'=>'
');
$atagArray['centro'] = array('open'=>'', 'close'=>'
');
$atagArray['sub'] = array('open'=>'', 'close'=>'');
$atagArray['sup'] = array('open'=>'', 'close'=>'');
$atagArray['br'] = array('open'=>'
');
$atagArray['citar'] = array('open'=>'QUOTE:', 'close'=>'');
$atagArray['ftp=(.*)'] = array('open'=>'\\1');
$atagArray['email=(.*)'] = array('open'=>'\\1');
$atagArray['url=(.*)'] = array('open'=>'\\2');
$atagArray['cor=(.*)'] = array('open'=>'\\2');
$atagArray['tamanho=(.*)'] = array('open'=>'\\2');
$atagArray['fonte=(.*)'] = array('open'=>'\\2');
$atagArray['flash=(.*),(.*)'] = array('open'=>'');
foreach ($atagArray as $stagName => $replace)
{
$tagEnd = preg_replace("/\W/sUi", "", $stagName);
$sText = preg_replace(
"|\[$stagName\](.*)\[/$tagEnd\]|sUi",
"$replace[open]\\1$replace[close]",
$sText
);
}
foreach ($sTagArray as $stagName => $replace)
{
if (eregi("[)(#$]", $stagName))
{
$stagNameNew = preg_replace("#([\)\(\$\#])#", "\\ \\1", $stagName);
$stagNameNew = preg_replace("#( +)#", "", $stagNameNew);
$sTagArray[ $stagNameNew ] = array('tag' => $replace['tag']);
unset($sTagArray[ $stagName ]);
}
}
foreach ($sTagArray as $stagName => $replace)
{
$sText= preg_replace("|\[$stagName\]|sUi", "$replace[tag]", $sText);
}
return $sText;
}
?>
Автор: : Дата: 01.01.1970