A ver.. intento hacer unos BBCodes... el problema es que el del youtube me da guerra... no se que pasa que para todos los videos que pongo me dice "We sorry, this video is no longer available"
Aqui el codigo... es el primero de control multimedia en la variable xhtml... me podeis decir como puede hacer usa de la funcion "highlight_string" como bbcode..
Código php:
Ver original
function BBCode ($texto) { // control texto '/\[b](.*?)\[\/b\]/is', '/\[i](.*?)\[\/i\]/is', '/\[u](.*?)\[\/u\]/is', '/\[s](.*?)\[\/s\]/is', '/\[align=(left|center|right)](.*?)\[\/align\]/is', '/\[font=(.*?)\](.*?)\[\/font\]/is', '/\[color=(.*?)\](.*?)\[\/color\]/is', '/\[size=(.*?)\](.*?)\[\/size\]/is', // fin control texto // control url, img '/\[url](.*?)\[\/url\]/is', '/\[url=(.*?)\](.*?)\[\/url\]/is', '/\[img](.*?)\[\/img\]/is', // fin control url, img '/\[code](.*?)\[\/code\]/is', '/\[php](.*?)\[\/php\]/is', //valor 1... revisar // control multimedia '/\[ytub](.*?)\[\/ytub\]/is', '/\[gvid](.*?)\[\/gvid\]/is', '/\[wmp](.*?)\[\/wmp\]/is' // fin control multimedia ); // control texto '<strong>$1</strong>', '<em>$1</em>', '<u>$1</u>', '<strike>$1</strike>', '<div style="text-align: $1;">$2</div>', '<span style="font-family:$1;">$2</span>', '<span style="color:$1;">$2</span>', '<span style="font-size:$1;">$2</span>', // fin control texto // control url, img '<a href="http://$1" target="_blank">$1</a>', '<a href="http://$1" target="_blank">$2</a>', '<img src="$1" />', // fin control url, ing '<pre>$1</pre>', 'highlight_string($1)', //valor 1 // control multimedia '<object width="425" height="349"> <param name="movie" value="http://www.youtube.com/v/$1&fs=1&color1=0x3a3a3a&color2=0x999999&border=1"> </param><param name="allowFullScreen" value="true"> </param><embed src="http://www.youtube.com/v/$1&fs=1&color1=0x3a3a3a&color2=0x999999&border=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="349"> </embed></object>', //youtube fin '<object type="application/x-shockwave-flash" data="http://video.google.com/googleplayer.swf?docId=$1" width="400" height="326"> <param name="movie" value="http://video.google.com/googleplayer.swf?docId=$1" /> <param name="allowScriptAcess" value="sameDomain" /> <param name="quality" value="best" /> <param name="bgcolor" value="#FFFFFF" /> <param name="scale" value="noScale" /> <param name="salign" value="TL" /> <param name="FlashVars" value="playerMode=embedded" /></object>', // google vidio fin '<OBJECT id="VIDEO" width="400" height="370" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"> <PARAM NAME="URL" VALUE="$1"> <PARAM NAME="SendPlayStateChangeEvents" VALUE="True"> <PARAM NAME="AutoStart" VALUE="False"> <PARAM NAME="stretchToFit" VALUE="True"> <PARAM name="uiMode" value="full"> <PARAM name="PlayCount" value="1"> <PARAM NAME="AutoRewind" VALUE="0"> <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="mediaplayer1" autostart="False" width="400" height="370" transparentstart="1" SHOWSTATUSBAR="1" loop="0" controller="true" src="$1" stretchToFit="true" > </embed></OBJECT>' //wmp fin // fin control multimedia ); }