İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

HTML to BBCODE

ReGuaL

0
İyinet Üyesi
Katılım
1 Ekim 2006
Mesajlar
204
Reaction score
0
Merhaba arkadaslar

Buradaki kullanilan HTML to BBCODE function'da, linkleri düz yazi olarak gösteriyor ve resimleri hic almiyor sizce sorun ne olabilir ?

PHP:
	function bb2html($text) { 
	  $bbcode = array("<", ">", 
					"[LIST]", "[*]", "[/LIST]",  
					"[IMG]", "[/IMG]",  
					"[B]", "[/B]",  
					"[U]", "[/U]",  
					"[I]", "[/I]", 
					'[COLOR="', "[/COLOR]", 
					"[SIZE=\"", "[/SIZE]", 
					'[URL="', "[/URL]", 
					"[MAIL=\"", "[/MAIL]", 
					"[CODE]", "[/CODE]", 
					"[QUOTE]", "[/QUOTE]", 
					'"]'); 
	  $htmlcode = array("<", ">", 
					"<ul>", "<li>", "</ul>",  
					"<img src=\"", "\">",  
					"<b>", "</b>",  
					"<u>", "</u>",  
					"<i>", "</i>", 
					"<span style=\"color:", "</span>", 
					"<span style=\"font-size:", "</span>", 
					'<a href="', "</a>", 
					"<a href=\"mailto:", "</a>", 
					"<code>", "</code>", 
					"<table width=100% bgcolor=lightgray><tr><td bgcolor=white>", "</td></tr></table>", 
					'">'); 
	  $newtext = str_replace($bbcode, $htmlcode, $text); 
	  $newtext = str_replace('<br />'," \r\n ",$newtext);
	  $newtext = str_replace('<br/>'," \r\n ",$newtext);
	  $newtext = str_replace('<br>'," \r\n ",$newtext);
	  $newtext = str_replace('<BR>'," \r\n ",$newtext);
	 // $newtext = nl2br($newtext);//second 
	    
	  return $newtext; 
	}

Simdiden tesekkürler.
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Üst