Re: Replacing editor in news publishing program

  •  10-03-2007, 12:15 AM

    Re: Replacing editor in news publishing program

    Did you look at what I posted? The instructions say 5 minutes to add the editor, and I've been working on it almost 12 hours without any success. Above are the two files they list as needing to be edited, along with a link to their forums. They say to remove the JS and add your own editor....thats about it.
    where am i going to find the text area ID?

     

    Myself and two other people have looked at it, and cannot figure it out at all. I have the files uploaded, both the Editor files into the /admin/ directory (where they have tinymce), and the php file i created....same directory, named "Editor1".....They won't help or even give suggestions, and I'm trying to get a guide done so more people aren't stuck.....i need some help here


    http://www.vivvo.net/forums/showthread.php?t=325

    i've tried to start a small tutorial to make it easier, but not understanding at all how they do things, i can't get it installed or working correctly..... here is what I have done

    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. With this file, you'll simply remove the Java Script for the default editor

    Code:
    <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,separator,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|height|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.

    Next up is the /public_html/admin/templates/edit_tiny.tpl file. Remove the Java Script for the default editor from here also:

    Code:
    <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,separator,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|height|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.

    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.......

    Here's where I'm currently stuck...............
    (Maybe some explanation from Vivvo staff on what this next step does).

    public_html/admin/include.php. you need to change the editor name here (the "tiny" in this example)
    Code:
    $wysiwyg_editor = "tiny";   //  "spaw", "tiny"
    To whatever editor you plan on using. save the file to your server.


    http://phphtmledit.com/document/scr/...Deployment.htm


    Since I'm using Cute Editor, I uploaded the Cute Editor folder into the /public/_html/admin folder of Vivvo (the same directory as the TinyMCE folder)

    after creating the PHP file:
    Code:
    <?php
    $editor=new CuteEditor();
    $editor->ID="Editor1";
    $editor->Text="Type here";
    $editor->FilesPath="public_html/admin/CuteEditor_Files";
    $editor->Draw();
    $editor=null;

    //use $_POST["Editor1"]to catch the data
    ?>
    I put this file (Editor1.php) in the same directory (/public_html/admin/Editor1.php)

    This part stumped me........



    "Once you've created a CuteEditor class object, you call functions against that object.

    You can retrieve the CuteEditor contents using the $_POST array. The name of the variable in the $_POST array will be CuteEditor ID. For example if your Cute Editor class ID is "Editor1", the variable would be $_POST["Editor1"].

View Complete Thread