Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/02/2006, 00:44
Avatar de Watas
Watas
 
Fecha de Ingreso: diciembre-2005
Ubicación: Caracas
Mensajes: 151
Antigüedad: 18 años, 4 meses
Puntos: 0
ya encontre la solucion
lo que buscaba tiene el nombre de BBCODE

aca dejo el link dnd me ayudo
http://www.forosdelweb.com/showthrea...ghlight=bbcode

aca dejo el codigo por si alguien lo necesite
Código PHP:
<?php

    
include("conectar.php");

function 
code_gen($str){ 
 
  
$str htmlentities($str); 
  
$str nl2br($str); 
  
$str=preg_replace("/\[n\](.*?)\[\/n\]/i""<b>$1</b>"$str); 
  
$str=preg_replace("/\[c\](.*?)\[\/c\]/i""<i>$1</i>"$str); 
  
$str=preg_replace("/\[s\](.*?)\[\/s\]/i""<u>$1</u>"$str); 
  
$str=preg_replace("/\[url\](.*?)\[\/url\]/i""<a href=\"$1\">$1</a>"$str); 
  
$str str_replace("[img]","<img src='",$str); 
  
$str str_replace("[/img]","'>",$str);

  return 
$str


    
$nC conectar();


    
$noticias mysql_query("select * from noticiaoffroad order by id desc limit 1") or die ("Intentelo mas tarde.".mysql_error());

    while(
$row mysql_fetch_array($noticias)){

    echo 
"<span class='Estilo1'>$row[titulo]</span><br>
<span class='Estilo2'>Autor: $row[autor]</span><br><br>"
;
echo 
nl2br (code_gen($row["noticia"])); 
}
?>

Saludos y suerte