forummp3 @@@@@@@@@@@@@ @@@@@@@@@@@@@@@@ | finallement j'ai reussi,je met la fonction en entier, ca sera plus facile a comprendre:
Code :
- function ubbcode($reponse)
- {
- ///////////creation du code html//////////////////////
- $search = array(
- "/\[img\](http|https|ftp|mms)\:\/\/(\S+)\[\/img\]/si",
- "/\[center\](.+?)\[\/center\]/si",
- "/\[left\](.+?)\[\/left\]/si",
- "/\[right\](.+?)\[\/right\]/si",
- "/\[justify\](.+?)\[\/justify\]/si",
- "/\[g\](.+?)\[\/g\]/si",
- "/\[i\](.+?)\[\/i\]/si",
- "/\[s\](.+?)\[\/s\]/si",
- "/\[\*\](.+?)\n/si",
- "/\[url=(http|https|ftp|mms)\:\/\/(.+?)\](.+?)\[\/url\]/si",
- "/\[url=(\S+)\](.+?)\[\/url\]/si",
- "/\[url\](.+?)\[\/url\]/si",
- "/\[fixe\](.*)([ ])(.*)\[\/fixe\]/si",
- "/(^|\s)(http|https|ftp|mms)\:\/\/([^ !\'\"\(\)\[\]\r\n ]+)/i",
- "/(^|\s)www\.([^ !\'\"\(\)\[\]\r\n]+)/i"
- );
- $teste= preg_replace($search[12],"\\1 \\3",$reponse);
- $teste=str_replace(" "," ",$teste);
- $replace = array(
- " <img src=\"\\1://\\2\" alt=\"\\1://\\2\" border=\"0\" title=\"\\1://\\2\" /> ",
- "<div align=\"center\">\\1</div>",
- "<div align=\"left\">\\1</div>",
- "<div align=\"right\">\\1</div>",
- "<div align=\"justify\">\\1</div>",
- "<b>\\1</b>",
- "<i>\\1</i>",
- "<u>\\1</u>",
- "<div><ul class=\"bleu\"><li>\\1</li><ul></div>",
- "<a href=\"\\1://\\2\" target=\"_blank\" >\\3</a>",
- "<a href=\"http://\\1\" target=\"_blank\" >\\2</a>",
- "<a href=\"\\1\" target=\"_blank\" >\\1</a>",
- "$teste",
- "<a href=\"\\2://\\3\" target=\"_blank\" class=\"lientopic2\">\\2://\\3</a>",
- "<a href=\"http://www.\\2\" target=\"_blank\" class=\"lientopic2\">www.\\2</a>"
- );
- //----------| remplacement des expression regulieres |---------//
- $reponse = preg_replace($search, $replace, $reponse);
- $reponse=str_replace("\n"," <br />\n ",$reponse);
- //----------| fin remplacement |-----------------//
- return $reponse;
- }
|
---------------
lecteur mp3 yvele's smilies jeux de fille
|