PDA

View Full Version : Changing the default Editor for Vivvo V3.5 to CuteEdit


Capper
10-02-2007, 11:25 PM
Changing the default Editor for Vivvo V3.5

1. Always save copies of any files you plan on editing, or which might be changed or otherwise overwritten by any changes you make to your Vivvo installation. This way, if you make a mistake, you can simply replace the edited file with the original. a good way of replacing files with the same name within a folder is to simply rename the original (I simply add a old_in front of the file name).

2. Different folks use different applications for editing files, some use Notepad (which is fine, make sure you turn off wordwrap), some use Dreamweaver (expensive), others use the built in browser that comes with most FTP programs (I use Coffee cup FTP, and it has a nice built in browser/editor). Experiment with different editors, and find the one you are most comfortable with. Any time you edit or create a file, make sure you save the file with the same name (everything is case sensitive), and don't forget the extensions (some applications save files with a .txt extension or a doc. extension).

Now that we have that out of the way, we can move on to removing the default editor (TinyMCE) and replacing it with the editor of your choice.

The first file to edit is /public_html/admin/templates/article_add_tiny.tpl.

Remove the following Java Script from the top of the file:
<script language="javascript" type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "table,save,advhr,advimage,advlink,iespell,insertd atetime,preview,zoom,flash,searchreplace,print,con textmenu,ibrowser,paste",
theme_advanced_buttons1_add_before : "save,separator",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separ ator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "iespell,flash,advhr,separator,print,ibrowser,past etext,pasteword,selectall",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|h eight|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
external_link_list_url : "example_data/example_link_list.js",
external_image_list_url : "example_data/example_image_list.js",
flash_external_list_url : "example_data/example_flash_list.js"
});
</script>
Save the file to your server as article_add_(Name).tpl.

Next is the /public_html/admin/templates/edit_tiny.tpl file.
Remove the Java Script from the top of the file here also:
<script language="javascript" type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "table,save,advhr,advimage,advlink,iespell,insertd atetime,preview,zoom,flash,searchreplace,print,con textmenu,ibrowser,paste",
theme_advanced_buttons1_add_before : "save,separator",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separ ator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "iespell,flash,advhr,separator,print,ibrowser,past etext,pasteword,selectall",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|h eight|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
external_link_list_url : "example_data/example_link_list.js",
external_image_list_url : "example_data/example_image_list.js",
flash_external_list_url : "example_data/example_flash_list.js"
});
</script>
Again, save the file to your server as edit_(Name).tpl.

Now, the default editor has been removed from your Admin Panel (If you look, you'll notice the buttons are gone, and any text in the box is in an html view).

From here, you can integrate your own editor into Vivvo.......

How to change default editor of Vivvo to Cute Editor?

Step 1. Open admin/include.php file and in the bottom of this file, set the editor to:

$wysiwyg_editor = "cute";

Step 2. Create a new file, name it to article_add_cute.tpl. Copy the content of article_add_tiny.tpl into it (after you have removed the TinyMCE JS).

Step 3. Open admin/article_add.php file, find the following code:

if (!isset($wysiwyg_editor) or $wysiwyg_editor=="spaw")
include('spaw/spaw_control.class.php');

change to:

if (!isset($wysiwyg_editor) or $wysiwyg_editor=="cute")
include_once("CuteEditor_Files/include_CuteEditor.php");

Find the following code:

$sw = new SPAW_Wysiwyg('body' ,"",
'en', 'full', 'default', '550px' , '350px');
$body_editor = $sw->getHtml();
$filename=$root . $admin_directory . "/templates/article_add_spaw.tpl";

Change it to:

$editor=new CuteEditor();
$editor->ID="body";
$editor->Text="{$body}";
$editor->FilesPath="CuteEditor_Files";
$body_editor = $editor->GetString();
$editor=null;
$filename=$root . $admin_directory . "/templates/article_add_cute.tpl";

Step 4. Create a new file, name it to edit_cute.tpl. Copy the content of edit_tiny.tpl into it (after you have removed the TinyMCE JS).
Open admin/edit.php, make the same edits as you did in Step 3, except link to edit_cute.tpl.

$editor=new CuteEditor();
$editor->ID="body";
$editor->Text="{$body}";
$editor->FilesPath="CuteEditor_Files";
$body_editor = $editor->GetString();
$editor=null;
$filename=$root . $admin_directory . "/templates/edit_cute.tpl";

Mark
10-05-2007, 07:23 PM
Thanks for your hard work!

Capper
10-06-2007, 02:47 AM
No worries. I hope people realize I wasn't trying to be a pain.....I was just wanting people to realize that a lot of potential customers don't have the knowledge, time, or resources to spend making major customizations to Vivvo. My hope was that by spelling things out, other contributors would see what I mean when I say "spell things out for those who need help", I think it would cut down on tickets for the staff, and redundant questions for the forum lurkers who answer questions.

Hopefully, this guide made changing the editor easier, and was easy enough to follow. I have four more I'm currently working on, which I hope will help people.....although after testing V4.0, it might be a bit, as I have other obligations, and V4 is very different.