Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/07/2010, 12:45
Avatar de MaTyS
MaTyS
 
Fecha de Ingreso: enero-2009
Ubicación: Mar del Plata
Mensajes: 220
Antigüedad: 15 años, 3 meses
Puntos: 18
Respuesta: tap tipo bbcode

Mira esta funcion la hizo pato12 en este aporte
espero que te sirva

Código PHP:
Ver original
  1. function parsearTags($mensaje)
  2. {
  3.     $mensaje = str_replace("[citar]", "<blockquote><hr width='100%' size='2'>", $mensaje);
  4.     $mensaje = str_replace("[/citar]", "<hr width='100%' size='2'></blockquote>", $mensaje);
  5.    
  6.     $mensaje = str_replace("[b]", "<b>", $mensaje);
  7.     $mensaje = str_replace("[/b]", "</b>", $mensaje);
  8.    
  9.     $mensaje = str_replace("[i]", "<u>", $mensaje);
  10.     $mensaje = str_replace("[/i]", "</i>", $mensaje);
  11.  
  12.     $mensaje = str_replace("[php]", '<TABLE width="460" height="58" border="1" cellpadding="2" cellspacing="2" bordercolor="#CCCCCC" bgcolor="#000000">  <TBODY>    <TR>      <TD width="448" height="25" align="right" bgcolor="#FFFFFF"><font color="#000000"><strong>PHP</strong></font></TD>    </TR>    <TR>      <TD height="25" valign="top" bgcolor="#F0F0F0"><font color="#910000">', $mensaje);
  13.     $mensaje = str_replace("[ / p h p]", "</font></TD>  </TR>  </TBODY></TABLE>", $mensaje);
  14.  
  15.  
  16.     return $mensaje;
  17. }

Saludos.