Mmm Otro mas xD... DJ46, el lo que quiere es el
script para poder poner BBCode en su Sistema de Noticias.
Voy a tener que hacer una explicación rápida para él
. Bueno, no tanto explicación... Te voy a poner el código. Todo esto suponiendo que la noticia está en la variable
$not:
Para negrita<?php
$not = preg_replace ("/\[b\](.+)\[\/b\]/si","<b>\\1</b>",$not);
?>
Formato:
Para URL<?php
$not = preg_replace ("/\[url=(http:\/\/www\.([0-9a-z](.+))\.([A-Z]{2,3}))\]([0-9a-z](.+))\[\/url\]/i","<a target=_blank href=\\1>\\5</a>",$not);
?>
Formato:
[url=NombreWeb]http://www.algo.com[/url]
Para imágen<?php
$not = preg_replace ("/\[img\]([0-9a-z](.+))\[\/img\]/i","<img src=\"\\1\">",$not);
?>
Formato:
[img]http://www.algo.com/imagen.algo[/img]
Para citar<?php
$not = preg_replace ("/\[quote\](.+)\[\/quote\]/si","<font size=\"1\"><b>Citar</b></font><br><table border=1 cellpadding=3 width=100% bordercolor=#000000 style=\"border-collapse: collapse\" bgcolor=\"#99AFC1\"><td><div class=\"texto\">\\1</div></td></table>",$not);
?>
Formato:
Para Código:<?php
$not = preg_replace ("/\[code\](.+)\[\/code\]/si","<font size=\"1\"><b>Código</b></font><br><table border=1 cellpadding=3 width=100% bordercolor=#000000 style=\"border-collapse: collapse\" bgcolor=\"#F0F0F0\"><td><code class=\"texto\">\\1</code></td></table>",$not);
?>
Formato:
<?php
algo
?>
Y hay mas, pero son parecidas
Salu2!