Cute Editor deployment/integration: newbie questions

Last post 05-12-2008, 4:06 AM by Adam. 5 replies.
Sort Posts: Previous Next
  •  05-07-2008, 1:55 AM 40132

    Cute Editor deployment/integration: newbie questions

    I am new to this and have some (pretty basic, I guess) questions about the integration of CE in my html/php page, but hey, arent the most stupid questions not the ones that are not asked? :-) 
     
    So, I have uploaded the CE files to my server, so far no problem.
    Then I have a php/html page, with a textarea I want to have replaced by the Editor.
    The content of the textarea will be stored/retrieved in/from a MySQL database.
    I have copied the code of the form in which I have put the text area :
     
     <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
      <table align="center">
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Cont_omsch:</td>
          <td><input type="text" name="cont_omsch" value="<?php echo htmlentities($row_Content['cont_omsch'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right" valign="top">Cont_text:</td>
          <td><textarea name="cont_text" cols="50" rows="5"><?php echo htmlentities($row_Content['cont_text'], ENT_COMPAT, 'utf-8'); ?></textarea>
          </td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">&nbsp;</td>
          <td><input type="submit" value="Record bijwerken" /></td>
        </tr>
      </table>
      <table border="0" align="center">
        <tr>
          <td><?php if ($pageNum_Content > 0) { // Show if not first page ?>
                <a href="<?php printf("%s?pageNum_Content=%d%s", $currentPage, 0, $queryString_Content); ?>">Eerst</a>
                <?php } // Show if not first page ?>
          </td>
          <td><?php if ($pageNum_Content > 0) { // Show if not first page ?>
                <a href="<?php printf("%s?pageNum_Content=%d%s", $currentPage, max(0, $pageNum_Content - 1), $queryString_Content); ?>">Vorige</a>
                <?php } // Show if not first page ?>
          </td>
          <td><?php if ($pageNum_Content < $totalPages_Content) { // Show if not last page ?>
                <a href="<?php printf("%s?pageNum_Content=%d%s", $currentPage, min($totalPages_Content, $pageNum_Content + 1), $queryString_Content); ?>">Volgende</a>
                <?php } // Show if not last page ?>
          </td>
          <td><div align="center">
            <?php if ($pageNum_Content < $totalPages_Content) { // Show if not last page ?>
              <a href="<?php printf("%s?pageNum_Content=%d%s", $currentPage, $totalPages_Content, $queryString_Content); ?>">Laatste</a>
              <?php } // Show if not last page ?>
          </div></td>
        </tr>
      </table>
      <input type="hidden" name="MM_update" value="form1" />
      <input type="hidden" name="cont_id" value="<?php echo $row_Content['cont_id']; ?>" />
      </p>
    </form>
     
    So here are my questions:
     
    1) Where do I put php code in this form in order to replace the text area with the editor (so that I can edit the content of the corresponding field in my MySQL database?
     
    2) What will be this php code?
     
    3) Do I have to put php code elsewhere on my page and if so, what will be this code?
     
     
    Any help will be greatly appreciated.
     
    Erik
  •  05-07-2008, 2:10 PM 40176 in reply to 40132

    Re: Cute Editor deployment/integration: newbie questions

    1. Firstly, you must include the CuteEditor class file.
    <?php include_once("CuteEditor_Files/include_CuteEditor.php") ; ?>
     
    2. Secondly, you must create a new CuteEditor class object. Finally, you must assign a unique ID to your CuteEditor control, as shown below:

    <?php
             $editor=new CuteEditor();
             $editor->ID="cont_text";  // same ID as your textarea
             $editor->Text=htmlentities($row_Content['cont_text'], ENT_COMPAT, 'utf-8'); // Set value
             $editor->FilesPath="CuteEditor_Files";
             $editor->Draw();
             $editor=null; 

             //use $_POST["cont_text"]to catch the data
    ?>


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  05-07-2008, 3:30 PM 40179 in reply to 40176

    Re: Cute Editor deployment/integration: newbie questions

    Adam, thanks so much for your reply.
     
    1) I copied <?php include_once("CuteEditor_Files/include_CuteEditor.php") ; ?> into the <head> section of my page ; this seems to give the following error message when running the page:
     
    Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /www/htdocs/vvtnn/test/edit/CuteEditor_Files/include_CuteEditor.php on line 5
     
    2) How do I create a new Cute Editor class object?
     
    3) Do I have to remove the // in //use $_POST["cont_text"]to catch the data?

    Thanks again for your help.
     
    Regards,
     
    Erik
  •  05-07-2008, 3:48 PM 40180 in reply to 40179

    Re: Cute Editor deployment/integration: newbie questions

    Erik,
     
    1. It looks like you are running PHP version 4.0. This applicatio need PHP 5.0.
     
     
    Please run the following file in your server.

    <?php

    // Show all information, defaults to INFO_ALL
    phpinfo();


    ?>
     
    2) How do I create a new Cute Editor class object?
     

    <?php
             $editor=new CuteEditor();
             $editor->ID="cont_text";  // same ID as your textarea
             $editor->Text=htmlentities($row_Content['cont_text'], ENT_COMPAT, 'utf-8'); // Set value
             $editor->FilesPath="CuteEditor_Files";
             $editor->Draw();
             $editor=null; 

             //use $_POST["cont_text"]to catch the data
    ?>

    3) Do I have to remove the // in //use $_POST["cont_text"]to catch the data?
     
    You can remove it.
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  05-08-2008, 2:27 PM 40221 in reply to 40180

    Re: Cute Editor deployment/integration: newbie questions

    Sorry to bother you again Adam,
     
    I solved the PHP version problem
    Now the Cute Editor appears correctly on my page,
    However, the textarea appears as well
    The data (text) do not appear in the editor but in the textarea
    How can I have the text displayed in the editor and have it saved in my database when confirming my edit?
    Where do I exacly put the Cute Editor Class object? Before the <textarea> tag, after it or do I have to remove the <textarea> tag?
     
    Thanks again for your help.
     
    Erik
  •  05-12-2008, 4:06 AM 40308 in reply to 40221

    Re: Cute Editor deployment/integration: newbie questions

    Erk,
     
    Please try the following code:
     
    <?php include_once("CuteEditor_Files/include_CuteEditor.php") ; ?>
     
    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
      <table align="center">
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Cont_omsch:</td>
          <td><input type="text" name="cont_omsch" value="<?php echo htmlentities($row_Content['cont_omsch'], ENT_COMPAT, 'utf-8'); ?>" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right" valign="top">Cont_text:</td>
          <td>
                <textarea name="cont_text" cols="50" rows="5"><?php echo htmlentities($row_Content['cont_text'], ENT_COMPAT, 'utf-8'); ?></textarea>

                <?php
                   $editor=new CuteEditor();
                   $editor->ID="cont_text";  // same ID as your textarea
                   $editor->Text=htmlentities($row_Content['cont_text'], ENT_COMPAT, 'utf-8'); // Set value
                   $editor->FilesPath="CuteEditor_Files";
                   $editor->Draw();
                   $editor=null; 
                ?>
          </td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">&nbsp;</td>
          <td><input type="submit" value="Record bijwerken" /></td>
        </tr>
      </table>
      <table border="0" align="center">
        <tr>
          <td><?php if ($pageNum_Content > 0) { // Show if not first page ?>
                <a href="<?php printf("%s?pageNum_Content=%d%s", $currentPage, 0, $queryString_Content); ?>">Eerst</a>
                <?php } // Show if not first page ?>
          </td>
          <td><?php if ($pageNum_Content > 0) { // Show if not first page ?>
                <a href="<?php printf("%s?pageNum_Content=%d%s", $currentPage, max(0, $pageNum_Content - 1), $queryString_Content); ?>">Vorige</a>
                <?php } // Show if not first page ?>
          </td>
          <td><?php if ($pageNum_Content < $totalPages_Content) { // Show if not last page ?>
                <a href="<?php printf("%s?pageNum_Content=%d%s", $currentPage, min($totalPages_Content, $pageNum_Content + 1), $queryString_Content); ?>">Volgende</a>
                <?php } // Show if not last page ?>
          </td>
          <td><div align="center">
            <?php if ($pageNum_Content < $totalPages_Content) { // Show if not last page ?>
              <a href="<?php printf("%s?pageNum_Content=%d%s", $currentPage, $totalPages_Content, $queryString_Content); ?>">Laatste</a>
              <?php } // Show if not last page ?>
          </div></td>
        </tr>
      </table>
      <input type="hidden" name="MM_update" value="form1" />
      <input type="hidden" name="cont_id" value="<?php echo $row_Content['cont_id']; ?>" />
      </p>
    </form>

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML