Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#76 2005-08-19 05:33:45

jimro
New member
Registered: 2005-08-19
Posts: 7

Re: Newbie Guide

Hi,
Under Firefox (it works fine under IE), I can't recover the data from the textarea to enter them in my MySQL database via PHP.  They are lost when I submit the form (I use a classic submit, no javascript).  I search and search  in these forums and in another ones, and find nothing to solve this problem. 
In update mode, existing data are recovered from database and displayed into editor, no problem, but when I modify or create new data, they are lost.
With full example under Firefox, updated data are displayed in alert box when I click on Submit button.

Thank you for any help.
Excuse me for my poor english.

jimro

Last edited by jimro (2005-08-23 07:05:01)

Offline

#77 2005-08-23 07:06:51

jimro
New member
Registered: 2005-08-19
Posts: 7

Re: Newbie Guide

No help ?

jimro

Offline

#78 2005-08-25 00:26:45

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Newbie Guide

You will have to post a URL to where we can try this if you want help.


James Sleeman

Offline

#79 2005-08-25 09:08:09

jimro
New member
Registered: 2005-08-19
Posts: 7

Re: Newbie Guide

Hello,

Sorry, but my system is on an intranet. However, I can give code :

Xinha config (between <head> et </head>) :

<script type="text/javascript">
   _editor_url = "../outils/xinha/"; // (de préférence absolue) URL (incluant le slash de fin) où Xinha est installé
   _editor_lang = "fr"; // Et la langue que nous voulons utiliser dans l'éditeur.
   _editor_skin = "xp-blue";
</script>

<script type="text/javascript" src="../outils/xinha/htmlarea.js"></script>

<script type="text/javascript">

   xinha_editors = null;
   xinha_init    = null;
   xinha_config  = null;
   xinha_plugins = null;
   xinha_init = xinha_init ? xinha_init : function() {

      xinha_plugins = xinha_plugins ? xinha_plugins :
      [
       'CharacterMap',
       'ContextMenu',
       'FullScreen',
       'ListType',
       'SpellChecker',
       'Stylist',
       'SuperClean',
       'TableOperations',
       'ImageManager'
      ];

      // CETTE TOUCHE DE JAVASCRIPT CHARGE LES PLUGINS, NE PAS TOUCHER :)
      if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;

      xinha_editors = xinha_editors ? xinha_editors :
      [
        'texte'
      ];

       xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
       xinha_config.width  = 'auto';
       xinha_config.height = '420px';

      xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);

      HTMLArea.startEditors(xinha_editors);
   }

   window.onload = xinha_init;
</script>

My script (partial):

<?php
session_start();
error_reporting(0);

...

// (data display for modification : works with Firefox)
//--------------------------------

  if (isset($_GET['id_news'])) {
   $id_news=$_GET['id_news'];
   $checkdate="<input type=\"checkbox\" name=\"newdate\" value=\"ok\"> $LG_MAJDATE<br><br>";

   $requete="select * from ".$extension."news where id_news='$id_news'";
   $result2=mysql_query($requete, $link);
   $news=mysql_fetch_object($result2);

  $news->titreNews = stripslashes($news->titreNews);
  $news->texteNews = stripslashes($news->texteNews);

...

   $news->titreNews=eregi_replace('<br[[:space:]]*/?[[:space:]]*>', "", $news->titreNews);

    if ($_GET['selection']==1) {
      $modif="<font size=\"2\">$LG_NEWSMODEDIT <font style=\"color:red\">" .$news->dateNews."</font></font>";
    } else {
      $modif="<font size=\"2\">$LG_NEWSMODNEWS <font style=\"color:red\"> ".$news->titreNews."</font> - <font style=\"color:red\">" .$news->dateNews."</font></font>";
    }
  } else {
    if ($_GET['selection']==1) {
      $modif="<font size=\"2\">$LG_NEWSCREAEDIT</font>";
    } else {
      $modif="<font size=\"2\">$LG_NEWSCREANEWS</font>";
    }
  }

//formulaire de saisie
//--------------------

 /*si un champ n'est pas renseigné, message d'erreur*/

  if (! $_POST['titre'] || ! $_POST['texte']) {
   $meserreur="<font style=\"color:red\"><br>$LG_FORMERROR </font>";

 /*si on recupere id_news, c'est une mise à jour (Update) */
  } elseif ($_POST['id_news']) {
  $id_news=$_POST['id_news'];
  $selection=$_POST['selection'];
  $titre = addslashes($_POST['titre']);
  $texte = addslashes($_POST['texte']);
  $liens = addslashes($_POST['liens']);
  $texte = doscode($texte);

   if (!$_POST['newdate']){

     if ($_SESSION['SESSION_STATUT']=="auteur") {
     } else {
     $requete="update ".$extension."news set titreNews='$titre', texteNews='$texte', lienNews='$liens', newsEdito='$selection' where id_news='$id_news'";
     }

   } else {

     if ($_SESSION['SESSION_STATUT']=="auteur") {
     } else {
     $requete="update ".$extension."news set titreNews='$titre', dateNews='$date', texteNews='$texte', lienNews='$liens', ordreNews='$ordre', newsEdito='$selection' where id_news='$id_news'";
     }

   }

   $result=mysql_query($requete, $link);

   header ("Location:../artzone/newsindex.php");
   exit();

 /* sinon, c'est un ajout (Add) */
  } else {

  $selection=$_POST['selection'];
  $titre = addslashes($_POST['titre']);
  $texte = addslashes($_POST['texte']);
  $liens = addslashes($_POST['liens']);
  $texte = doscode($texte);
  $SESSION_ID=$_SESSION['SESSION_ID'];

     if ($_SESSION['SESSION_STATUT']=="auteur") {
     $SESSION_ID=$_SESSION['SESSION_ID'];
     $requete="INSERT into ".$extension."newstemp SET titreNews='$titre', texteNews='$texte', dateNews='$date', lienNews='$liens', ordreNews='$ordre', id_autNews='$SESSION_ID'";
     } else {
     $SESSION_ID=$_SESSION['SESSION_ID'];
     $requete="INSERT into ".$extension."news SET titreNews='$titre', texteNews='$texte', dateNews='$date', lienNews='$liens', newsEdito='$selection', ordreNews='$ordre', id_autNews='$SESSION_ID'";
     }
   $result=mysql_query($requete, $link);

...
?>

<p><?php echo $choix; ?><p>

<div align="center"><center>
<table width="95%" border="0" cellspacing="5" cellpadding="5">
<tr>
<form method="POST" NAME="form" action="newssaisie.php">

<td>
<p><img src="imgadmin/ptecrire.gif" align="absmiddle" border="0"> 
<strong><?php echo $modif; ?></strong>
<?php echo $meserreur; ?>

</td></tr>

<tr>
<td valign="top" bgcolor="#CCCCFF" style="BORDER:#000000 1px dashed">

<?php echo $checkdate; ?>
<p><b><?php echo $LG_FORMTITRE; ?> <font color=red>*</font></b> <br>
<input type="text" name="titre" value="<?php echo $news->titreNews;  echo $_POST['titre']; ?>" size="30"></p>

<?php
/** zone de texte (TEXTAREA) */
  $texte = $_POST['texte'];
  $nomtxt="<b>$LG_DESCRIPTION <font color=red>*</font></b>"; // nom de la textearea
  $texte="".$news->texteNews."".$texte.""; // affichage de texte dans le textearea
...

$menu .="<p>$nomtxt<br><a href=\"$lienNS\">Afficher la boîte à outils Netscape</a></p>\n";
$menu .="<table cellspacing=\"0\" cellpadding=\"0\" style=\"border: 1px solid #000000; width: 100%;\"><tr><td>\n";
$menu .="<textarea id=\"texte\" name=\"texte\" rows=\"25\" cols=\"80\" style=\"width: 100%\">".$texte.$ins."</textarea>\n";
$menu .="</td></tr></table>\n";

?>

<br><?php echo $menu; ?>

<p><b><?php echo $LG_LIENHYPER; ?></b>
<input type="text" name="liens" value="<?php echo $news->lienNews;  echo $_POST['liens']; ?>" size="30"></p>
<input type="hidden" name="id_news" value="<?php echo $news->id_news; echo $_POST['id_news'] ?>">
<input type="hidden" name="selection" value="<?php echo $_GET['selection']; ?>">
<input type="hidden" name="nav" value="<?php echo $nav; ?>">
<input type="submit" value="<?php echo $LG_ENVOI; ?>" name="B1"></p>

</td></form></tr></table>
</center></div>
<p></p>

<?php
 ...
?>

It works fine within Internet Explorer 6 (add, modif, delete), but not within Firefox (only display old data when I want to modify).
No javascript error in Firefox javascrip console.

Thanks for your help.

Some precisions : my script works fine under Firefox and IE with HTMLArea 2 (HTMLArea-3.0-rc1 release), FCKeditor, TinyMCE, Xstandard and WysiwygPro.

jimro

Last edited by jimro (2005-08-25 12:20:57)

Offline

#80 2005-08-25 22:30:16

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Newbie Guide

You really need to simplify this down to a testcase... but what do you mean by "(only display old data when I want to modify)."


James Sleeman

Offline

#81 2005-08-26 02:16:45

jimro
New member
Registered: 2005-08-19
Posts: 7

Re: Newbie Guide

Hello James,

gogo wrote:

You really need to simplify this down to a testcase...

Yes, I'll try to do that as soon as possible.

but what do you mean by "(only display old data when I want to modify)."

With Firefox, the script can get data from MySQL database and can display it in textarea handled by editor via $texte.

jimro

Last edited by jimro (2005-08-26 09:57:53)

Offline

#82 2005-08-26 09:52:51

jimro
New member
Registered: 2005-08-19
Posts: 7

Re: Newbie Guide

Hello,

Well I have made a little script that shows the problem

<?php
session_start();
error_reporting(0);
?>

<html><head><title>Tests Xinha sous ArtiPHP (CMS)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META HTTP-EQUIV="Content-Style-Type" content="text/CSS">

<script type="text/javascript">
   _editor_url = "path/to/xinha/"; // (de préférence absolue) URL (incluant le slash de fin) où Xinha est installé
   _editor_lang = "fr"; // Et la langue que nous voulons utiliser dans l'éditeur.
   _editor_skin = "xp-blue";
</script>

<script type="text/javascript" src="path/to/xinha/htmlarea.js"></script>

<script type="text/javascript">

   xinha_editors = null;
   xinha_init    = null;
   xinha_config  = null;
   xinha_plugins = null;
   xinha_init = xinha_init ? xinha_init : function() {

      xinha_plugins = xinha_plugins ? xinha_plugins :
      [
       'CharacterMap',
       'ContextMenu',
       'FullScreen',
       'ListType',
       'SpellChecker',
       'Stylist',
       'SuperClean',
       'TableOperations',
       'ImageManager'
      ];

      // CETTE TOUCHE DE JAVASCRIPT CHARGE LES PLUGINS, NE PAS TOUCHER :)
      if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;

      xinha_editors = xinha_editors ? xinha_editors :
      [
        'ta'
      ];

       xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
       xinha_config.width  = 'auto';
       xinha_config.height = '200px';

      xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);

      HTMLArea.startEditors(xinha_editors);
   }

   window.onload = xinha_init;
</script>

</head>

<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" MARGINHEIGHT="0" MARGINWIDTH="0">

<table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
      <td valign="top">

<?php

//formulaire de saisie
//--------------------

/*if a field is empty, results are not displayed*/

if (! $_POST['titre'] || ! $_POST['ta']) {

   $meserreur = "<font style=\"color:red\"><br>Champ non renseigné </font>";
   $titre = stripslashes($_POST['titre']);
   $texte = stripslashes($_POST['ta']);

} elseif ($_POST['titre'] && $_POST['ta']) {

   $titre = stripslashes($_POST['titre']);
   $texte = stripslashes($_POST['ta']);

   $affichage = "<br /><b>RESULTATS<br /></b><br />";
   $affichage .= "<b>Titre : </b><br />".$titre."<br /><br />";
   $affichage .= "<b>Description : </b><br />".$texte."<br />";

}

?>

         <div align="center"><center>
            <table width="95%" border="0" cellspacing="5" cellpadding="5">
               <tr>
               <form method="POST" NAME="form" action="">
                  <td>
                     <p>Formulaire de saisie<?php echo $meserreur; ?></p>
                  </td>
               </tr>
               <tr>
                  <td valign="top" bgcolor="#CCCCFF" style="BORDER:#000000 1px dashed">
                     <p><b>Titre <font color=red>*</font></b><br>
                     <input type="text" name="titre" value="<?php echo $titre; ?>" size="30"></p>

<?php

/** zone de texte (TEXTAREA) */
$menu = "<p><b>Description <font color=red>*</font></b><br>\n"; // nom de la textearea
$menu .= "<table cellspacing=\"0\" cellpadding=\"0\" style=\"border: 1px solid #000000; width: 100%;\"><tr><td>\n";
$menu .= "<textarea id=\"ta\" name=\"ta\" rows=\"10\" cols=\"80\" style=\"width: 100%\">".$texte."</textarea>\n";
$menu .= "</td></tr></table>\n";

?>

                     <br><?php echo $menu; ?>
                     <input type="submit" value="Submit" name="B1"></p>
                  </td>
               </form>
               </tr>
            </table></center>
         </div>
      </td>
   </tr>
</table>

<div>
<br /><br /><br />
   <p><?php echo $affichage; ?></p>
</div>

<table width="100%" border="0" cellspacing="0" cellpadding="0" style="BORDER-TOP:#000000 1px solid; BORDER-BOTTOM:#000000 1px solid">
  <tr> 
    <td bgcolor="#A588F9" colspan="2"> 
      <div align="center"><b><a href="http://www.artiloo.com">Artiphp</a> © 2001-2005</b></div>
    </td>
  </tr>
</table>
</body>
</html>

It works within IE6 with Xinha and textarea normal mode, but within Firefox 1.0.x it works only in textarea normal mode (with Xinha, textarea data are lost ?!?!). I should like very much to use it in Artiphp CMS.

jimro

Last edited by jimro (2005-08-26 11:06:33)

Offline

#83 2005-08-27 05:28:39

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Newbie Guide

That's still too much rubbish in there to easily see what the problem might be.  Allow me to simplify it more

<?php
session_start();
error_reporting(0);
?>

<html><head>=

<script type="text/javascript">
   _editor_url = "path/to/xinha/"; // (de préférence absolue) URL (incluant le slash de fin) où Xinha est installé
   _editor_lang = "fr"; // Et la langue que nous voulons utiliser dans l'éditeur.
   _editor_skin = "xp-blue";
</script>

<script type="text/javascript" src="path/to/xinha/htmlarea.js"></script>

<script type="text/javascript">

   xinha_editors = null;
   xinha_init    = null;
   xinha_config  = null;
   xinha_plugins = null;
   xinha_init = xinha_init ? xinha_init : function() {

      xinha_plugins = xinha_plugins ? xinha_plugins :
      [
       'CharacterMap',
       'ContextMenu',
       'FullScreen',
       'ListType',
       'SpellChecker',
       'Stylist',
       'SuperClean',
       'TableOperations',
       'ImageManager'
      ];

      // CETTE TOUCHE DE JAVASCRIPT CHARGE LES PLUGINS, NE PAS TOUCHER :)
      if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;

      xinha_editors = xinha_editors ? xinha_editors :
      [
        'ta'
      ];

       xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
       xinha_config.width  = 'auto';
       xinha_config.height = '200px';

      xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);

      HTMLArea.startEditors(xinha_editors);
   }

   window.onload = xinha_init;
</script>

</head>

<body >


<?php

$texte = 'bonjour';

?>

    
               <form method="POST" NAME="form" action="">


<?php
$menu =  "<textarea id=\"ta\" name=\"ta\" rows=\"10\" cols=\"80\" style=\"width: 100%\">".$texte."</textarea>\n";
?>

<?php echo $menu; ?>
                     <input type="submit" value="Submit" name="B1">
               </form>
</body>
</html>

James Sleeman

Offline

#84 2005-08-27 05:30:50

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Newbie Guide

Your testcase doesn't show how $texte is filled, or what is in it.  Are you sure you are entizing it before it goes into the textarea?


James Sleeman

Offline

#85 2005-09-06 19:24:06

jimhans
New member
Registered: 2005-09-06
Posts: 5

Re: Newbie Guide

Hallo, i have a problem using xinha outside my xampp. At home one my xampp server everything is ok.
But when i move the xinha to a server the control pannel is not shown. Only the blank textfield. I try it on  some servers. Its always the same. I copy xinha-nightly and rename it to xinha at the docroot directory, where the webpage starts. There comes now error message. I used two computers and i try with the firefox and the ie6. The expample does not work. You can watch that on http://frolleinwunder.net/xinha/example … ample.html
That is one server i tried.

Whats wrong?

Offline

#86 2005-09-07 09:09:17

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Newbie Guide

The link you gave works just fine for me in Firefox.  i suggest you check your firewall/adblocking etc.


James Sleeman

Offline

#87 2005-10-13 00:36:57

lok
New member
Registered: 2005-10-13
Posts: 2

Re: Newbie Guide

I have searched the forums to no avail. Sorry.
I have currently installed xinha exactly as the newbie directions state.
When I open xinha editor, I only have a text box that I can type in and nothing else: http://wnyelite.com/test.htm
This is the error code:
Line: 45
Char: 22
Error: Object doesn't support this property or method
Code: 0

I have checked my code several times and read thoroughly threw the forums. I have seen that other people have had the same issues, but no concrete fix. Possibly I do not have the proper "Plug ins" on my server??


Thank-you for your help,

Lok

Offline

#88 2005-10-14 04:16:37

guillaumed
Xinha Administrator
From: Lyon, France
Registered: 2005-02-23
Posts: 85

Re: Newbie Guide

Seems that your htmlarea.js is not correct and doesn't have this method which should... Why?

(I've try to synchronize with the latest version to see if it has desapear but the server was too slow??)

Offline

#89 2005-10-14 10:49:43

pbl
New member
From: Brussels - Belgium
Registered: 2005-10-14
Posts: 2

Re: Newbie Guide

Hi all,

I've looked trough this guide and tried to find an answer to my problem, but with no results, so here I go.

I've installed xinha and everything workis fine. But I have trouble customizing it via the my_config.js file...
What I'd like to do now is to custmize the toolbar (remove some buttons and re-order the remaining ones), but my custom configuration seems to be ignored. I think I did everything as described in the newbie guide...so here are my files:

First, here's the HTML file:

<html>
    <head>
    <script type="text/javascript">
        _editor_url  = "./xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
        _editor_lang = "fr";      // And the language we need to use in the editor.
    </script>
      <script type="text/javascript" src="./xinha/htmlarea.js"></script>
        <script type="text/javascript" src="./my_config.js"></script>
    </head>
   
    <body>
        <form name="form" method="post">
            <textarea id="pbleditor" name="pbleditor" rows="10" cols="50" style="width: 100%"></textarea>
        </form>
    </body>
</html>

Here is the my_config.js file (changes made from the newbie guide
     step 1: removed all the plugins
     step 2: name/id of the textarea
     step 5: Tried to define my custom toolbar)

xinha_editors = null;
xinha_init    = null;
xinha_config  = null;
xinha_plugins = null;

// This contains the names of textareas we will make into Xinha editors
xinha_init = xinha_init ? xinha_init : function() {
  /** STEP 1 ***************************************************************
   * First, what are the plugins you will be using in the editors on this
   * page.  List all the plugins you will need, even if not all the editors
   * will use all the plugins.
   ************************************************************************/

  xinha_plugins = xinha_plugins ? xinha_plugins :
  [
  ];
 
  // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  smile
  if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;

  /** STEP 2 ***************************************************************
   * Now, what are the names of the textareas you will be turning into
   * editors?
   ************************************************************************/

  xinha_editors = xinha_editors ? xinha_editors :
  [
    'pbleditor'
  ];

  /** STEP 3 ***************************************************************
   * We create a default configuration to be used by all the editors.
   * If you wish to configure some of the editors differently this will be
   * done in step 5.
   *
   * If you want to modify the default config you might do something like this.
   *
   *   xinha_config = new HTMLArea.Config();
   *   xinha_config.width  = '640px';
   *   xinha_config.height = '420px';
   *
   *************************************************************************/

   xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();

  /** STEP 4 ***************************************************************
   * We first create editors for the textareas.
   *
   * You can do this in two ways, either
   *
   *   xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
   *
   * if you want all the editor objects to use the same set of plugins, OR;
   *
   *   xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config);
   *   xinha_editors['myTextArea'].registerPlugins(['Stylist','FullScreen']);
   *   xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']);
   *
   * if you want to use a different set of plugins for one or more of the
   * editors.
   ************************************************************************/

  xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);

  /** STEP 5 ***************************************************************
   * If you want to change the configuration variables of any of the
   * editors,  this is the place to do that, for example you might want to
   * change the width and height of one of the editors, like this...
   *
   *   xinha_editors.myTextArea.config.width  = '640px';
   *   xinha_editors.myTextArea.config.height = '480px';
   *
   ************************************************************************/

    xinha_editors.pbleditor.toolbar = [
        ["separator","htmlmode","showhelp","about"]
    ["popupeditor"],
    ["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"],
    ["separator","forecolor","hilitecolor","textindicator"],
    ["separator","subscript","superscript"],
    ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
    ["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
    ["separator","inserthorizontalrule","createlink","insertimage","inserttable"],
    ["separator","undo","redo","selectall","print"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]),
    ["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright", "righttoleft"],
  ];
   
  /** STEP 6 ***************************************************************
   * Finally we "start" the editors, this turns the textareas into
   * Xinha editors.
   ************************************************************************/

  HTMLArea.startEditors(xinha_editors);
}

window.onload = xinha_init;

I suppose I'm making a stupid mistake, but I can't put my finger on it. Any help would be greatly appreciated.

Regards,
Philippe Blockmans

Last edited by pbl (2005-10-14 10:50:20)

Offline

#90 2005-10-17 04:19:34

pbl
New member
From: Brussels - Belgium
Registered: 2005-10-14
Posts: 2

Re: Newbie Guide

pbl wrote:

Hi all,

I've looked trough this guide and tried to find an answer to my problem, but with no results, so here I go.

I've installed xinha and everything workis fine. But I have trouble customizing it via the my_config.js file...
What I'd like to do now is to custmize the toolbar (remove some buttons and re-order the remaining ones), but my custom configuration seems to be ignored. I think I did everything as described in the newbie guide...so here are my files:

First, here's the HTML file:

<html>
    <head>
    <script type="text/javascript">
        _editor_url  = "./xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
        _editor_lang = "fr";      // And the language we need to use in the editor.
    </script>
      <script type="text/javascript" src="./xinha/htmlarea.js"></script>
        <script type="text/javascript" src="./my_config.js"></script>
    </head>
   
    <body>
        <form name="form" method="post">
            <textarea id="pbleditor" name="pbleditor" rows="10" cols="50" style="width: 100%"></textarea>
        </form>
    </body>
</html>

Here is the my_config.js file (changes made from the newbie guide
     step 1: removed all the plugins
     step 2: name/id of the textarea
     step 5: Tried to define my custom toolbar)

xinha_editors = null;
xinha_init    = null;
xinha_config  = null;
xinha_plugins = null;

// This contains the names of textareas we will make into Xinha editors
xinha_init = xinha_init ? xinha_init : function() {
  /** STEP 1 ***************************************************************
   * First, what are the plugins you will be using in the editors on this
   * page.  List all the plugins you will need, even if not all the editors
   * will use all the plugins.
   ************************************************************************/

  xinha_plugins = xinha_plugins ? xinha_plugins :
  [
  ];
 
  // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  smile
  if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;

  /** STEP 2 ***************************************************************
   * Now, what are the names of the textareas you will be turning into
   * editors?
   ************************************************************************/

  xinha_editors = xinha_editors ? xinha_editors :
  [
    'pbleditor'
  ];

  /** STEP 3 ***************************************************************
   * We create a default configuration to be used by all the editors.
   * If you wish to configure some of the editors differently this will be
   * done in step 5.
   *
   * If you want to modify the default config you might do something like this.
   *
   *   xinha_config = new HTMLArea.Config();
   *   xinha_config.width  = '640px';
   *   xinha_config.height = '420px';
   *
   *************************************************************************/

   xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();

  /** STEP 4 ***************************************************************
   * We first create editors for the textareas.
   *
   * You can do this in two ways, either
   *
   *   xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
   *
   * if you want all the editor objects to use the same set of plugins, OR;
   *
   *   xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config);
   *   xinha_editors['myTextArea'].registerPlugins(['Stylist','FullScreen']);
   *   xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']);
   *
   * if you want to use a different set of plugins for one or more of the
   * editors.
   ************************************************************************/

  xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);

  /** STEP 5 ***************************************************************
   * If you want to change the configuration variables of any of the
   * editors,  this is the place to do that, for example you might want to
   * change the width and height of one of the editors, like this...
   *
   *   xinha_editors.myTextArea.config.width  = '640px';
   *   xinha_editors.myTextArea.config.height = '480px';
   *
   ************************************************************************/

    xinha_editors.pbleditor.toolbar = [
        ["separator","htmlmode","showhelp","about"]
    ["popupeditor"],
    ["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"],
    ["separator","forecolor","hilitecolor","textindicator"],
    ["separator","subscript","superscript"],
    ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
    ["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
    ["separator","inserthorizontalrule","createlink","insertimage","inserttable"],
    ["separator","undo","redo","selectall","print"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]),
    ["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright", "righttoleft"],
  ];
   
  /** STEP 6 ***************************************************************
   * Finally we "start" the editors, this turns the textareas into
   * Xinha editors.
   ************************************************************************/

  HTMLArea.startEditors(xinha_editors);
}

window.onload = xinha_init;

I suppose I'm making a stupid mistake, but I can't put my finger on it. Any help would be greatly appreciated.

Regards,
Philippe Blockmans

Ok, my problem's solved: I had to use "xinha_editors.pbleditor.config.toolbar"  instead of xinha_editors.pbleditor.toolbar in STEP5

Regards,
Philippe Blockmans

Offline

#91 2005-10-30 23:47:50

4sak3n0ne
New member
Registered: 2005-10-30
Posts: 1

Re: Newbie Guide

I am having a problem with Xinha and PHP's $_POST function in Firefox.  The code works fine in IE, but it fails in Firefox.

Here is my header code:

  <script type="text/javascript">
    _editor_url  = "xinha/"
    _editor_lang = "en";
  </script>
  <script type="text/javascript" src="xinha/htmlarea.js"></script>
  <script type="text/javascript" src="xinha/myconfig.js"></script>

Here is my Form Code:

    <table cellspacing="0" cellpadding="0" border="0" width="90%" align="center">
    <form action="post_news_process.php" method="post">
        <tr><td align="center"><strong>Post News</strong></td></tr>
        <tr><td align="left"><strong>Title: </strong><input type="text" name="newstitle" size="40"></td></tr>
        <tr><td> </td></tr>
        <tr><td align="left"><strong>News: <br /><textarea cols="50" rows="20" id="addNews" name="addNews" style="width:100%"></textarea></strong></td></tr>
        <tr><td align="right"><input type="hidden" name="username" value="<? echo $session->username; ?>"><input type="submit" value="Post News"></td></tr>
        <tr><td align="left"><span class="smalltext">Note: You must include a title, and your news must be longer than 50 characters.</span></td></tr>
    </form>
    </table>

Here the relavant part of my submit code:

$q = "INSERT INTO news(title, news, author, date)VALUES('$_POST[newstitle]','$_POST[addNews]','$_POST[username]', now())";

lastly, my config:

    xinha_editors = null;
    xinha_init    = null;
    xinha_config  = null;
    xinha_plugins = null;

    // This contains the names of textareas we will make into Xinha editors
    xinha_init = xinha_init ? xinha_init : function()
    {
      /** STEP 1 ***************************************************************
       * First, what are the plugins you will be using in the editors on this
       * page.  List all the plugins you will need, even if not all the editors
       * will use all the plugins.
       ************************************************************************/

      xinha_plugins = xinha_plugins ? xinha_plugins :
      [
       'CharacterMap',
       'ContextMenu',
       'FullScreen',
       'ListType',
       'Stylist',
       'SuperClean',
       'TableOperations'     
      ];
             // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :)
             if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;

      /** STEP 2 ***************************************************************
       * Now, what are the names of the textareas you will be turning into
       * editors?
       ************************************************************************/

      xinha_editors = xinha_editors ? xinha_editors :
      [
        'addNews'
      ];

      /** STEP 3 ***************************************************************
       * We create a default configuration to be used by all the editors.
       * If you wish to configure some of the editors differently this will be
       * done in step 4.
       *
       * If you want to modify the default config you might do something like this.
       *
       *   xinha_config = new HTMLArea.Config();
       *   xinha_config.width  = 640;
       *   xinha_config.height = 420;
       *
       *************************************************************************/

       xinha_config = xinha_config ? xinha_config : new HTMLArea.Config();
/*
       // We can load an external stylesheet like this - NOTE : YOU MUST GIVE AN ABSOLUTE URL
      //  otherwise it won't work!
      xinha_config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css'));

      // Or we can load styles directly
      xinha_config.stylistLoadStyles('p.red_text { color:red }');

      // If you want to provide "friendly" names you can do so like
      // (you can do this for stylistLoadStylesheet as well)
      xinha_config.stylistLoadStyles('p.pink_text { color:pink }', {'p.pink_text' : 'Pretty Pink'});
*/
      /** STEP 3 ***************************************************************
       * We first create editors for the textareas.
       *
       * You can do this in two ways, either
       *
       *   xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
       *
       * if you want all the editor objects to use the same set of plugins, OR;
       *
       *   xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config);
       *   xinha_editors['myTextArea'].registerPlugins(['Stylist','FullScreen']);
       *   xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']);
       *
       * if you want to use a different set of plugins for one or more of the
       * editors.
       ************************************************************************/

      xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);

      /** STEP 4 ***************************************************************
       * If you want to change the configuration variables of any of the
       * editors,  this is the place to do that, for example you might want to
       * change the width and height of one of the editors, like this...
       *
       *   xinha_editors.myTextArea.config.width  = 640;
       *   xinha_editors.myTextArea.config.height = 480;
       *
       ************************************************************************/


      /** STEP 5 ***************************************************************
       * Finally we "start" the editors, this turns the textareas into
       * Xinha editors.
       ************************************************************************/

      HTMLArea.startEditors(xinha_editors);
      window.onload = null;
    }

    window.onload   = xinha_init;
    // window.onunload = HTMLArea.collectGarbageForIE;

Any help is greatly appreciated.

Last edited by 4sak3n0ne (2005-10-30 23:59:11)

Offline

#92 2005-11-10 13:13:33

skylarzook
New member
Registered: 2005-11-10
Posts: 2

Re: Newbie Guide

WYSIWYG EDITOR for a web designers' client to use

Righto

I've been tooling around for a few days as the basic web designer that I am with virtually non-existent programming skills. I've been trying to find a way for a client of mine to be able to easily edit the text of his web pages inside his browser and then be able to save them so they can become the new page everyone sees, without screwing up the structural code.

The site will be on a Linux server. PHP is on there. I've made the site so far in Dreamweaver and am using a template I made.

I'm wondering if the way Xinha works is acessible to everybody on the web or if only people who have a password can edit the pages. And if so how does that work?

And whether this would be a good option for a client to be able to just change some text here and there. Simple for them to learn and use. Or if you know of something else you'd recommend, in view of my sparse programming skills,  my limited budget, my love of helpful, unneglected forums, and the client needs.

Thank you very much!

Best,
S

Offline

#93 2005-11-13 20:30:21

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Newbie Guide

Xinha is only a "widget" how you put it to use is up to the developer.  Xinha in and of itself does not provide any useful function out of the box, you must write the other stuff to use it however you wish.


James Sleeman

Offline

#94 2005-11-18 10:30:10

skylarzook
New member
Registered: 2005-11-10
Posts: 2

Re: Newbie Guide

I appreciate your explanation. Jumping into this world without knowing a thing, it's hard to catch up on all the assumed knowledge.
Rock on. I'll keep looking for something that might take care of the editing issue.

Cheers,
S

Offline

#95 2005-12-15 07:29:15

timc
New member
Registered: 2005-12-15
Posts: 1

Re: Newbie Guide

Hi

I have installed xinha as per the newbie guide, and trying to test it (not on a server, just as plain html files on my c drive - but I assume that would still display xinha textareas correctly) and I get
'An error has occurred: Unkown'

The system then continues, and I can see the textarea and edit, but I only see 2 rows, not 10.

Any ideas what might be causing this?

(ps I tried download the example page - which works for me on your site - and the same thing happened)

My code is below :


----------- test.htm ----------------


<html>
<head>
<script type="text/javascript" src="/xinha/my_config.js"></script>
<script type="text/javascript">
    _editor_url  = "/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
    _editor_lang = "en";      // And the language we need to use in the editor.
  </script>
<script type="text/javascript" src="/xinha/htmlarea.js"></script>




</head>


<bodY>

<form id="editors_here">
Name           <input type="text" name = "name"><br>
Something else        <input type="text" name = "se"><br>
Text           <textarea id="ta" name = "ta" rows="10" cols = "80"></textarea>
</form>


</body>

</html>



----------- myconfig.js ------------

xinha_editors = null;
    xinha_init    = null;
    xinha_config  = null;
    xinha_plugins = null;

    // This contains the names of textareas we will make into Xinha editors
    xinha_init = xinha_init ? xinha_init : function()
    {
      /** STEP 1 ***************************************************************
       * First, what are the plugins you will be using in the editors on this
       * page.  List all the plugins you will need, even if not all the editors
       * will use all the plugins.
       *
       * The list of plugins below is a good starting point, but if you prefer
       * a must simpler editor to start with then you can use the following
       *
       * xinha_plugins = xinha_plugins ? xinha_plugins : [ ];
       *
       * which will load no extra plugins at all.
       ************************************************************************/

      xinha_plugins = xinha_plugins ? xinha_plugins :
      [
       'CharacterMap',
       'ContextMenu',
       'FullScreen',
       'ListType',
       'SpellChecker',
       'Stylist',
       'SuperClean',
       'TableOperations'
      ];
             // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  smile
             if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;

      /** STEP 2 ***************************************************************
       * Now, what are the names of the textareas you will be turning into
       * editors?
       ************************************************************************/

      xinha_editors = xinha_editors ? xinha_editors :
      [
        'ta'
      ];

      /** STEP 3 ***************************************************************
       * We create a default configuration to be used by all the editors.
       * If you wish to configure some of the editors differently this will be
       * done in step 5.
       *
       * If you want to modify the default config you might do something like this.
       *
       *   xinha_config = new HTMLArea.Config();
       *   xinha_config.width  = '640px';
       *   xinha_config.height = '420px';
       *
       *************************************************************************/

       xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();

      /** STEP 4 ***************************************************************
       * We first create editors for the textareas.
       *
       * You can do this in two ways, either
       *
       *   xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
       *
       * if you want all the editor objects to use the same set of plugins, OR;
       *
       *   xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config);
       *   xinha_editors['myTextArea'].registerPlugins(['Stylist','FullScreen']);
       *   xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']);
       *
       * if you want to use a different set of plugins for one or more of the
       * editors.
       ************************************************************************/

      xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);

      /** STEP 5 ***************************************************************
       * If you want to change the configuration variables of any of the
       * editors,  this is the place to do that, for example you might want to
       * change the width and height of one of the editors, like this...
       *
       *   xinha_editors.myTextArea.config.width  = '640px';
       *   xinha_editors.myTextArea.config.height = '480px';
       *
       ************************************************************************/


      /** STEP 6 ***************************************************************
       * Finally we "start" the editors, this turns the textareas into
       * Xinha editors.
       ************************************************************************/

      HTMLArea.startEditors(xinha_editors);
    }

    window.onload = xinha_init;

Last edited by timc (2005-12-15 08:20:42)

Offline

#96 2006-02-03 04:47:32

oenone
New member
Registered: 2006-02-03
Posts: 1

Re: Newbie Guide

timc wrote:

'An error has occurred: Unkown'

I had this error, too...

I solved it by disabling the 'SuperClean' plugin:

xinha_plugins = xinha_plugins ? xinha_plugins :
      [
       'CharacterMap',
       'ContextMenu',
       'FullScreen',
       'ListType',
       'SpellChecker',
       'Stylist',
//       'SuperClean',
       'TableOperations'
      ];

Hope this helps..

regards,
oenone

Offline

#97 2006-02-10 04:29:23

saxy
Xinha Community Member
Registered: 2006-02-07
Posts: 15

Re: Newbie Guide

Because the code in newbie guide doesn't work I took the code from the examples and put it in the header of my page. And it works. But sometimes I can see the editor, but the textarea isn't active. Clicking on the textarea in the javascript console appeares the error message:
Fehler: [Exception... "Access to restricted URI denied"  code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)"  location: "http://www.buerostudio-neumann.at/xinha/htmlarea.js Line: 1288"]
Quelldatei: http://www.buerostudio-neumann.at/xinha/htmlarea.js
Zeile: 1288

It seems to be a problem of invoking the page multiple times.

What I am doing wrong?

Thank you for advices,

saxy

Offline

#98 2006-02-10 05:13:24

saxy
Xinha Community Member
Registered: 2006-02-07
Posts: 15

Re: Newbie Guide

After many tests I found, that after using history.go(-3) and reinvoking the page the problem occours. Is there a replacement for history.back or history.go(-3)? Absolute adressing isn't possible, because I doesn't know, from where the user is coming.
Thanks for help,
saxy

Offline

#99 2006-02-13 13:06:09

audg
New member
Registered: 2005-11-29
Posts: 6

Re: Newbie Guide

Having to include Each textarea in Each form?

Hi, after searching in this forum and doing some testing on my site, it seems you must have each textarea in my_config.js in each form?

That seems very awkward and suprising, as this would be difficult to maintain, i.e. each time you add a text area, you have to add a dummy text area in each of your forms?

Do I have this correct? Is there a more elegant solution?

Thank you,
Audrey

Last edited by audg (2006-02-13 13:21:11)

Offline

#100 2006-02-14 05:52:58

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Newbie Guide

Hello Audrey,
xinha, or HTMLArea (the original program) was made to do exactly this: replace a textarea in a form.
My humble opinion--this is the elegant solution as opposed to just clutching some javascript in the page. You need the form anyway to get the stuff to the server, don't you?

Offline

Board footer

Powered by FluxBB