This sample shows how to configure CKEditor to output BBCode format instead of outputting HTML, along with the appropriate editor configurations that fits for a BBCode editing environment.
A snippet of the configuration code can be seen below; check the source of this page for full definition:
CKEDITOR.replace( 'editor1', { extraPlugins : 'bbcode', enterMode : CKEDITOR.ENTER_BR, entities : false, fontSize_sizes : "30/30%;50/50%;100/100%;120/120%;150/150%;200/200%;300/300%", colorButton_colors : 'Red/FF0000,Green/00FF00,Blue/0000FF', toolbar : [ ['Source', '-', 'Save','NewPage','Preview','-','Bold', 'Italic','-', 'TextColor', 'FontSize','-','Underline','-','Link', 'Image'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['Smiley','SpecialChar'], ['NumberedList','BulletedList','-','Blockquote'] ] });