Back to vBulletin 3 Articles

How to add WYSIWYG editor in admincp
by Lionel 02 Feb 2008

I saw a couple of posts about inquiries on adding an editor in admincp. It's actually quite simple, using an external editor. Downloadd the free http://tinymce.moxiecode.com/ editor.

To most people that should be sufficient. If you need upload power (images, flash, movies etc...) they are also selling a couple of extensions to do so, or you could install the free jQuery ajax upload for that editor.

In your application, insert at the top below the print_cp_header. Consult the TinyMCE documentation for adding/removing elements in editor. The one below will insert everything.

Code:
?>
<link href="../PATH_TO/tinymce/themes/advanced/css/editor_ui.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="../PATH_TO/tinymce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
    mode : "textareas",
    theme : "advanced"});
</script>
<?php
In your print_textarea_row, make sure that you disable the large edit text button. You don't need it anymore and it will not work anyway.

PHP Code:
print_textarea_row($vbphrase['yourphrase'], 'name_of_field'$item[database_column], '','',1,0); 
That's it. Every textarea in your application will now have a powerful WYSIWYG editor.

It's really a nice editor, you can use preset templates to do your inserts etc ...

vblts.ru supports vBulletin®, 2022-2024