UseBB Community

The official board for UseBB help and discussion

UseBB Community » Resources & Customization » function BBCODE for swf&wmp

function BBCODE for swf&wmp

Moderators: Gaia.

Page: 1

Author Post
Member
Registered: May 2007
Posts: 11
open useBB/sorce/functions.php

search for
Quote
$existing_tags = array('code', 'b', 'i', 'u', 's', 'img', 'url', 'mailto', 'color', 'size', 'google', 'quote');


and
Quote
$existing_tags = array('code', 'b', 'i', 'u', 's', 'img', 'url', 'mailto', 'color', 'size', 'google', 'quote');


replace this
Quote
$existing_tags = array('code', 'b', 'i', 'u', 's', 'img', 'url', 'mailto', 'color', 'size', 'google', 'quote', 'em', 'swf');



and go to line 1868

insert this for WMP

"#\[em=(.*?)x(.*?)\](.*?)\[/em\]#is" => '<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"id="WindowsMediaPlayer"height="\\2" width="\\1" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"; standby="Loading Microsoft Media Player compnents..." type="application/x-oleobject"><param name="URL" value="\\3" valuetype="ref"><param name="rate" value="1"><param name="balance" value="0"><param name="currentPosition" value="0"><param name="defaultFrame"><param name="playCount" value="1"><param name="autoStart" value="false"><param name="AudioStream" value="-1"><param name="currentMarker" value="0"><param name="invokeURLs" value="-1"><param name="baseURL" value="\\3" valuetype="ref"><param name="volume" value="80"><param name="mute" value="0"><param name="uiMode" value="full"><param name="enabled" value="-1"><param name="enableContextMenu" value="0"><param name="fullScreen" value="0"><param name="SAMIStyle" value><param name="SAMILang" value><param name="SAMIFilename" value><param name="captioningID" value><embed name="movie1" src="\\3" width="\\1" height="\\2" bgcolor="ffffff" autoplay="false" cache="true" enablejavascript="true" controller="true"></object>',



And this for SWF
 "
#\[swf=(.*?)x(.*?)\](.*?)\[/swf\]#is" => '<object width="\\1" height="\\2" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/ shockwave/cabs/flash/swflash.cab#version=8,0,0,0"><param name="movie" value="" /><param name="menu" value="false" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="u=\\3" /><param name="flashvars" value="u=\\3" /><embed src="" width="425" height="350" menu="false" bgcolor="#ffffff" flashvars="u=\\3" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>',


set <param name="movie" value="" and <embed src="" for Your SWF Player

BB Code
[em=widexheight]DirecLink mp3,wma,wmv,wav,mp4[/em]
[swf=widexheight]DirecLink flv,swf[/swf]


Picture for Example http://img54.imageshack.us/img54/2830/samuh3.gif
Result Sample: http://forum.itemxp.net/topic.php?id=2099

Credit
www.useBB.net for a Good Forum
Tana_Sara @ www.itemxp.net Editor
Thailand for my Country :D
« Last edit by tana_sara on Tue Jul 31, 2007 8:38 am. »
Member
Registered: Jun 2007
Posts: 43
Location: Adelaide, Australia.
Would it not be better to not modify the UseBB core files and call a config file for the additional BB-Code once only.

Without going into a verbose explanation, any additions could be called from functions.php with "require_once MyCode-Mod.php etc." and then they could be commented in or out for any of the extra BB-code.php files you want to add.

Adding extra code / buttons to the editor is a different matter, as it breaks into an array.

I'm not fully aware of the UseBB code and its functions, but I'm sure you will understand at what I am trying to suggest. ;)
_______________
Growing old is compulsory
Growing up is optional :mrgreen:
« Last edit by lopalong on Tue Jul 31, 2007 10:37 am. »
Member
Registered: May 2007
Posts: 11
^^

Thank for knowledge

I'm a Beginner, I'm 18 Year Olds.
I'm study php by my self.
Member
Registered: Jun 2007
Posts: 43
Location: Adelaide, Australia.
You're welcome, ;)

I could give you an example of something I did for other forum software so that you can see how it all comes together. It's not difficult, but as I said; I'm not up to date with UseBB code / variables and would like to see Dietrich's response to this coding suggestion before I offer any other examples of how it could be done. :)
_______________
Growing old is compulsory
Growing up is optional :mrgreen:
Developer
Registered: Apr 2004
Posts: 2202
Location: Belgium
You can't just include a PHP file which adds BBCode tags to the code. Perhaps phpBB's or MyBB's code allows this, but UseBB's doesn't.
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog

Page: 1

UseBB Community » Resources & Customization » function BBCODE for swf&wmp

UseBB Community is powered by UseBB 1 Forum Software