Using KFM as a plugin for TinyMCE
In the header of the page where your TinyMCE is to be displayed, place this script (as written by Benjamin Ter Kuile):
<script type="text/javascript">
function kfm_for_tiny_mce(field_name, url, type, win){
window.SetUrl=function(url,width,height,caption){
win.document.forms[0].elements[field_name].value = url;
if(caption){
win.document.forms[0].elements["alt"].value=caption;
win.document.forms[0].elements["title"].value=caption;
}
}
window.open('../../../kfm/index.php?mode=selector&type='+type,'kfm','modal,width=800,height=600');
}
tinyMCE.init({
mode: "exact",
elements: "content",
theme : "advanced",
content_css : "styles/structure.css, styles/editor.css",
plugins : "save,table,contextmenu, paste, style, advlink, advimage, searchreplace",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1: "save,code, undo, redo, cleanup, pastetext, pasteword, selectall, styleprops,replace, help",
theme_advanced_buttons2: "link, unlink, anchor, image,table,charmap, formatselect, fontselect,fontsizeselect",
theme_advanced_buttons3: "bold,italic,underline,strikethrough,bullist,numlist,outdent,indent,justifyleft,justifycenter,justifyright,justifyfull,sub,sup,forecolor,backcolor,removeformat",
external_image_list_url : "admin/tiny_mce_images.php",
file_browser_callback : "kfm_for_tiny_mce"
});
</script>
Edit the above as you need to. The important parts are emphasised.
