It is easy for install colorful ubb editor on your webpage. You just need to load this script before ”</body>”(Document End) .
(Demo: http://api.colorfulphp.com/ubb/ | Happy Songtext )
First Step:
Please insert this code before ”</body>” tag, and after you Textarea (Form).
<script type="text/javascript" src="http://api.colorfulphp.com/ubb/ubb.js"></script>
Second Step:
You should config UBB Editor Code before load the script above.(Insert this config code before above script.) example:
<script type="text/javascript"> coUBB_c = {'id':'do_content', 'mode':'basic', 'ver':'0.1', 'width':'99%', 'height':'200px', 'auto':1, 'css':':default', 'css_e':}; </script>
About Config Arguments:
You must edit the arg of “id” to the id of you textarea or input.
Example:
<textarea cols="50" rows="10" name="do_content" id="do_content" style="width:99%" onclick="if(typeof(coUBB) == 'object'){coUBB.make(coUBB_c);}"></textarea>
do_content is the id value.
Don’t modify arg: mode , ver. Because there are no other version at present.
“width” and ” height” is default value if you are use a INPUT element.
You can load your css as: ‘css’ : ‘http://yourpath’
Please check about css for more information.
Full Example:
1. textarea id is “do_content” same as default config, so you don’t need config it.
<form method="post">
<textarea cols="50" rows="10" name="do_content" id="do_content" style="width:99%" onclick="if(typeof(coUBB) == 'object'){coUBB.make(coUBB_c);}"></textarea>
<input type="submit" />
</form>
<script type="text/javascript" src="http://api.colorfulphp.com/ubb/ubb.js"></script>
2: use your custom config
<form method="post">
<textarea cols="50" rows="10" name="myname" id="myname" style="width:99%" onclick="if(typeof(coUBB) == 'object'){coUBB.make(coUBB_c);}"></textarea>
<input type="submit" />
</form>
<script type="text/javascript"> coUBB_c = {'id':'myname', 'mode':'basic', 'ver':'0.1', 'auto':1,'css':'http://mycsspath', 'css_e':}; </script>
<script type="text/javascript" src="http://api.colorfulphp.com/ubb/ubb.js"></script>