net3x
how to create youtube embed BBcode function,
[youtube ] a1xb2yc3z[/youtube ]
to ->
<embed src="http://www.youtube.com/watch?v=[ID]" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed> Copy code
-------------
and also for YOUTU.BE
any wapmaster..
net3x
Hadest for php site..
i need [map]...[ /map]
[youtube]...[ /youtube] bbcode to embed html preview..
Hadest
net3x If you use forum function, you can add this code to {{ msg|...|raw }} in my_blocks.twig
replace({'[youtube]':'<iframe width="560" height="315" src="//www.youtube.com/embed/','[/youtube]':'" frameborder="0" allowfullscreen="true"></iframe>'}) Copy code
Graham
The forum function already has the bbcode built in
but it uses <object> not <iframe>
[youtube]ID CODE[/youtube] [vimeo]ID NUMBER[/vimeo] Copy code
So if you add your own use different names for the bbcode
net3x
Graham It is for php site.. anyways, i solved this metter. i user "str_replace" "array" function.. but i cant solve the
code..
ne1 help me..?
Hadest
V.I.P không cần khách 6 : ))
dùng chèn zingtv cũng tốt
Graham
net3x The most simple form of map image is like
<img src="http://maps.googleapis.com/maps/api/staticmap?zoom=16&size=190x190¢er=new+york&markers=label:Marker|new+york" alt="map" /> Copy code
so use the same code and set the "center" and "markers" to the same value
The value should be url encoded
you can use almost anything as the "center" value and Google will try and interpret it as a location
net3x
Graham I m using like this
<?php function bbcode ( $msg ) { $msg = htmlentities ( $msg ); $search = array( '/\[br\]/is' , '/\[b\](.*?)\[\/b\]/is' , '/\[i\](.*?)\[\/i\]/is' , '/\[u\](.*?)\[\/u\]/is' ,); $replace = array( '<br />' , '<strong>$1</strong>' , '<em>$1</em>' , '<u>$1</u>' ,); $msg = preg_replace ( $search , $replace , $msg ); $msg = bbcode ( $msg ); return $msg ; } ?> Copy code
now can u guide me for [googlemap]LOCATION[ /googlemap]..