0

Hello i have been trying this now for 2 weeks and its messing with my head, i can not seem to get a WYSIWYG editor working on my site,

main page

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
  <title>my site</title>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

<link rel="Stylesheet" type="text/css" href="css/jqrte.css" />
<link type="text/css" href="css/jqpopup.css" rel="Stylesheet"/>
<link rel="stylesheet" href="css/jqcp.css" type="text/css"/>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.bgiframe.min.js"></script>
<script type="text/javascript" src="js/jqDnR.min.js"></script>
<script type="text/javascript" src="js/jquery.jqpopup.min.js"></script>
<script type="text/javascript" src="js/jquery.jqcp.min.js"></script>
<script type="text/javascript" src="js/jquery.jqrte.min.js"></script>

</head>

<body>
  <?php
         include_once("content_editor.php");
         include_once("editor.php");
      ?>

<h1>Send funny emails to your friends and familys</h1>

<?php

if ($_POST["email"]<>'') { 
	$ToEmail = $_POST['email-1']; 
	$EmailSubject = $_POST['subject']; 
	$mailheader = "From: ".$_POST["email-2"]."\r\n"; 
	$mailheader .= "Reply-To: ".$_POST["email"]."\r\n"; 
	$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
	$MESSAGE_BODY = $_POST["comment"]."<br>";
	 
	
	mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); 
?> 

<h1>Your message was sent</h1> 

<?php 
} 
else
{
?> 
<form action="email.php" method="post">
Enter Friends email: <br/>
<input type="text" name="email-1" /> <br />
Enter fake email: <br/>
<input type="text" name="email-2" /> <br />
Enter Subject: <br/>
<input type="text" name="subject" /> <br />

Enter Your message: <br/> <br/>

<textarea id="comment" name="comment" class="jqrte_popup" rows="10" cols="55">rich text editor with &lt;b&gt;Content&lt;/b&gt;</textarea>

<br /><br /><br />

<input name="Submit" type="submit" class="center" value="Send">

</form>
<?php 

}; 
?>
<script type="text/javascript">
   window.onload = function(){ 
      try{
         $("#content_rte").jqrte();
      }
      catch(e){}
   } 

   $(document).ready(function() {
         $("#content_rte").jqrte_setIcon();
         $("#content_rte").jqrte_setContent();
   });
</script>

</body>
</html>

content_editor.php

<div class="jqrte_body">
<table>
<tr>
   <td>
   <table class="jqrte_menu">
      <tr>
         <td colspan="4" title="<?php echo getLabel("Select Format",$language);?>">
            <select name="formatblock" id="content_rte_formatblock">
               <option value="" selected="selected"><?php echo getLabel("Select Format",$language);?></option>
               <option value="&lt;p&gt;">Paragraph</option>
               <option value="&lt;pre&gt;">Pre</option>
               <option value="&lt;h6&gt;">Heading 6</option>
               <option value="&lt;h5&gt;">Heading 5</option>
               <option value="&lt;h4&gt;">Heading 4</option>
               <option value="&lt;h3&gt;">Heading 3</option>
               <option value="&lt;h2&gt;">Heading 2</option>
               <option value="&lt;h1&gt;">Heading 1</option>
            </select>
         </td>
         <td colspan="4" title="<?php echo getLabel("Font Fmaily",$language);?>">
            <select name="fontname" id="content_rte_fontname">
               <option value="" selected="selected"><?php echo getLabel("Select Font",$language);?></option>
               <option value="arial"><?php echo getLabel("Arial",$language);?></option>
               <option value="comic sans ms"><?php echo getLabel("Comic Sans",$language);?></option>
               <option value="courier new"><?php echo getLabel("Courier New",$language);?></option>
               <option value="georgia"><?php echo getLabel("Georgia",$language);?></option>
               <option value="helvetica"><?php echo getLabel("Helvetica",$language);?></option>
               <option value="impact"><?php echo getLabel("Impact",$language);?></option>
               <option value="times new roman"><?php echo getLabel("Times",$language);?></option>
               <option value="trebuchet ms"><?php echo getLabel("Trebuchet",$language);?></option>
               <option value="verdana"><?php echo getLabel("Verdana",$language);?></option>
            </select>
         </td>
         <td colspan="4" title="<?php echo getLabel("Select Font Size",$language);?>">
            <select name="fontsize" id="content_rte_fontsize">
               <option value="" selected="selected"><?php echo getLabel("Select Font Size",$language);?></option>
               <option value="1">8</option>
               <option value="2">10</option>
               <option value="3">12</option>
               <option value="4">14</option>
               <option value="5">18</option>
               <option value="6">24</option>
            </select>
         </td>
         <td id="content_rte_subscript" title="<?php echo getLabel("Subscript",$language);?>"></td>
         <td id="content_rte_superscript" title="<?php echo getLabel("Superscript",$language);?>"></td>
      </tr>
      <tr>
         <td id="content_rte_bgcolor" title="<?php echo getLabel("Background Color",$language);?>"></td>
         <td id="content_rte_forecolor" title="<?php echo getLabel("Font Color",$language);?>"></td>
         <td id="content_rte_bold" title="<?php echo getLabel("Bold",$language);?>"></td>
         <td id="content_rte_italic" title="<?php echo getLabel("Italic",$language);?>"></td>
         <td id="content_rte_underline" title="<?php echo getLabel("Underline",$language);?>"></td>
         <td id="content_rte_strikethrough" title="<?php echo getLabel("Strikethrough",$language);?>"></td>
         <td id="content_rte_justifyleft" title="<?php echo getLabel("Justify Left",$language);?>"></td>
         <td id="content_rte_justifycenter" title="<?php echo getLabel("Justify Center",$language);?>"></td>
         <td id="content_rte_justifyright" title="<?php echo getLabel("Justify Right",$language);?>"></td>
         <td id="content_rte_justifyfull" title="<?php echo getLabel("Justify Full",$language);?>"></td>
         <td id="content_rte_insertorderedlist" title="<?php echo getLabel("Insert Ordered List",$language);?>"></td>
         <td id="content_rte_insertunorderedlist" title="<?php echo getLabel("Insert Unordered List",$language);?>"></td>
         <td id="content_rte_insertHorizontalRule" title="<?php echo getLabel("Insert Horizontal Rule",$language);?>"></td>
         <td id="content_rte_removeformat" title="<?php echo getLabel("Remove Format",$language);?>"></td>
      </tr>
      <tr>
         <td id="content_rte_addlink" title="<?php echo getLabel("Add Link",$language);?>"></td>
         <td id="content_rte_unlink" title="<?php echo getLabel("Unlink",$language);?>"></td>
         <td id="content_rte_addtable" title="<?php echo getLabel("Add Table",$language);?>"></td>
         <td id="content_rte_addimage" title="<?php echo getLabel("Add Image",$language);?>"></td>
         <td id="content_rte_uploadimage" title="<?php echo getLabel("Upload Image",$language);?>"></td>
         <td id="content_rte_uploadfile" title="<?php echo getLabel("Upload File",$language);?>"></td>
         <td id="content_rte_character" title="<?php echo getLabel("Special Character",$language);?>"></td>
         <td id="content_rte_emotion" title="<?php echo getLabel("Emotion",$language);?>"></td>
         <td id="content_rte_indent" title="<?php echo getLabel("Indent",$language);?>"></td>
         <td id="content_rte_outdent" title="<?php echo getLabel("Outdent",$language);?>"></td>
         <td id="content_rte_html" title="<?php echo getLabel("Html Content",$language);?>"></td>
         <td id="content_rte_copyright" title="<?php echo getLabel("Copyright",$language);?>"></td>
      </tr>
   </table>
   </td>
</tr>
<tr>
   <td>
      <iframe id="content_rte" src="about:blank" class="jqrte_iframebody"></iframe>
   </td>
   </tr>
   </table>
   </div>

editor.php

<div id="color_div" style="display:none" title="<?php echo getLabel("Color Picker",$language);?>">
   <table>
      <tr>
         <td colspan="3">
            H:<input type="text" id="jqcp_h" size="3" value="0">
            S:<input type="text" id="jqcp_s" size="3" value="0">
            L:<input type="text" id="jqcp_l" size="3" value="0"><br>
            R:<input type="text" id="jqcp_r" size="3" value="255">
            G:<input type="text" id="jqcp_g" size="3" value="255">
            B:<input type="text" id="jqcp_b" size="3" value="255"><br>
            <input type="text" id="color_value" class="jqcp_value" size="8">
            <input type="button" id="color_btn" value="<?php echo getLabel("Pick",$language);?>">
         </td>
      </tr>
      <tr>
         <td align="left"><div id="color_picker"></div></td>
      </tr>
   </table>
</div>


<div id="character_div" style="display:none" title="<?php echo getLabel("Special Character",$language);?>">
</div>


<div id="addtable_div" style="display:none" title="<?php echo getLabel("Add Table",$language);?>">
   <table>
      <tr>
         <td><?php echo getLabel("Rows",$language);?></td>
         <td><input type="text" id="addtable_row" name="table_row" value="2" size="10"></td>
         <td>&nbsp;</td>
      </tr>
      <tr>
         <td><?php echo getLabel("Columns",$language);?></td>
         <td><input type="text" id="addtable_column" name="table_column" value="2" size="10"></td>
         <td>&nbsp;</td>
      </tr>
      <tr>
         <td><?php echo getLabel("Width",$language);?></td>
         <td><input type="text" id="addtable_width" name="table_width" value="100" size="10"></td>
         <td>
            <select name="table_width_format" id="addtable_format">
               <option value="%">%</option>
               <option value=""><?php echo getLabel("pixels",$language);?></option>
            </select>
         </td>
      </tr>
      <tr>
         <td><?php echo getLabel("Border",$language);?></td>
         <td><input type="text" id="addtable_border" name="table_border" value="1" size="10"></td>
         <td>&nbsp;</td>
      </tr>
      <tr>
         <td><?php echo getLabel("Cellspacing",$language);?></td>
         <td><input type="text" id="addtable_cellspacing" name="table_cellspacing" value="0" size="10"></td>
         <td>&nbsp;</td>
      </tr>
      <tr>
         <td><?php echo getLabel("Cellpadding",$language);?></td>
         <td><input type="text" id="addtable_cellpadding" name="table_cellpadding" value="0" size="10"></td>
         <td>&nbsp;</td>
      </tr>
      <tr>
         <td><?php echo getLabel("Alignment",$language);?></td>
         <td>
            <select id="addtable_alignment" name="table_alignment">
               <option value=""><?php echo getLabel("default",$language);?></option>
               <option value="left"><?php echo getLabel("left",$language);?></option>
               <option value="right"><?php echo getLabel("right",$language);?></option>
               <option value="center"><?php echo getLabel("center",$language);?></option>
            </select>
         </td>
         <td>&nbsp;</td>
      </tr>
      <tr>
         <td>
            <input type="button" id="addtable_btn" value="<?php echo getLabel("Submit",$language);?>">
         </td>
      </tr>
   </table>
</div>


<div id="addlink_div" style="display:none"  title="<?php echo getLabel("Add Link",$language);?>">
   <table>
      <tr>
         <td><?php echo getLabel("Site Name",$language);?></td>
         <td><input type="text" id="addlink_name" name="link_name" size="20"></td>
      </tr>
      <tr>
         <td><?php echo getLabel("URL",$language);?></td>
         <td><input type="text" id="addlink_url" name="link_url"></td>
      </tr>
      <tr>
         <td><?php echo getLabel("Target",$language);?></td>
         <td>
            <select name="link_target" id="addlink_target">
               <option value=""></option>
               <option value="_blank"><?php echo getLabel("_blank",$language);?></option>
               <option value="_parent"><?php echo getLabel("_parent",$language);?></option>
               <option value="_self"><?php echo getLabel("_self",$language);?></option>
               <option value="_top"><?php echo getLabel("_top",$language);?></option>
            </select>
         </td>
      </tr>
      <tr>
         <td>
            <input type="button" id="addlink_btn" value="<?php echo getLabel("Submit",$language);?>">
         </td>
      </tr>
   </table>
</div>

<div id="addimage_div" style="display:none" title="<?php echo getLabel("Add Image",$language);?>">
   <table>
      <tr>
         <td><?php echo getLabel("Image URL",$language);?></td>
         <td><input type="text" id="addimage_url" name="image_url"></td>
      </tr>
      <tr>
         <td><?php echo getLabel("Image Description",$language);?></td>
         <td><input type="text" id="addimage_desc" name="image_desc"></td>
      </tr>
      <tr>
         <td><?php echo getLabel("Alignment",$language);?></td>
         <td>
            <select name="image_alignment" id="addimage_alignment">
               <option value=""></option>
               <option value="left"><?php echo getLabel("left",$language);?></option>
               <option value="right"><?php echo getLabel("right",$language);?></option>
            </select>
         </td>
      </tr>
      <tr>
         <td><?php echo getLabel("Border",$language);?></td>
         <td><input type="text" id="addimage_border" name="image_border" value="0" size="10"></td>
      </tr>
      <tr>
         <td>
            <input type="button" id="addimage_btn" value="<?php echo getLabel("Submit",$language);?>">
         </td>
      </tr>
   </table>
</div>


<div id="uploadimage_div" style="display:none" title="<?php echo getLabel("Upload Image",$language);?>">
   <form id="uploadimageform" name="uploadimageform" action="" method="post" enctype="multipart/form-data">
   <table>
      <tr>
         <td><?php echo getLabel("Upload Image",$language);?></td>
         <td>
            <input type="hidden" name="uploadimage_url" id="uploadimage_url">
            <input type="file" name="fileToUpload" id="uploadimage_fileToUpload">
         </td>
      </tr>
      <tr>
         <td><?php echo getLabel("Image Description",$language);?></td>
         <td><input type="text" id="uploadimage_desc" name="uploadimage_desc"></td>
      </tr>
      <tr>
         <td><?php echo getLabel("Alignment",$language);?></td>
         <td>
            <select name="uploadimage_alignment" id="uploadimage_alignment">
               <option value=""></option>
               <option value="left"><?php echo getLabel("left",$language);?></option>
               <option value="right"><?php echo getLabel("right",$language);?></option>
            </select>
         </td>
      </tr>
      <tr>
         <td><?php echo getLabel("Border",$language);?></td>
         <td><input type="text" id="uploadimage_border" name="uploadimage_border" value="0" size="10"></td>
      </tr>
      <tr>
         <td>
            <input type="button" id="uploadimage_btn" value="<?php echo getLabel("Upload",$language);?>">
         </td>
      </tr>
   </table>
   </form>
</div>

<div id="uploadfile_div" style="display:none"  title="<?php echo getLabel("Upload File",$language);?>">
   <form id="uploadfileform" name="uploadfileform" action="" method="post" enctype="multipart/form-data">
   <table>
      <tr>
         <td><?php echo getLabel("Upload File",$language);?></td>
         <td>
            <input type="hidden" name="uploadfile_url" id="uploadfile_url">
            <input type="file" name="fileToUpload" id="uploadfile_fileToUpload">
         </td>
      </tr>
      <tr>
         <td><?php echo getLabel("File Name",$language);?></td>
         <td><input type="text" name="name" id="uploadfile_name" size="10"></td>
      </tr>
      <tr>
         <td>
            <input type="button" id="uploadfile_btn" value="<?php echo getLabel("Upload",$language);?>">
         </td>
      </tr>
   </table>
   </form>
</div>

<div id="emotion_div" style="display:none"  title="<?php echo getLabel("Emotion",$language);?>">
   <table>
      <tr>
         <td><img class="emoticon" src="images/emotions/angry.gif" alt="<?php echo getLabel("angry",$language);?>"></td>
         <td><img class="emoticon" src="images/emotions/cry.gif" alt="<?php echo getLabel("cry",$language);?>"></td>
         <td><img class="emoticon" src="images/emotions/die.gif" alt="<?php echo getLabel("die",$language);?>"></td>
         <td><img class="emoticon" src="images/emotions/dislike.gif" alt="<?php echo getLabel("dislike",$language);?>"></td>
         <td><img class="emoticon" src="images/emotions/embarass.gif" alt="<?php echo getLabel("embarass",$language);?>"></td>
      </tr>
      <tr>
         <td><img class="emoticon" src="images/emotions/laugh.gif" alt="<?php echo getLabel("laugh",$language);?>"></td>
         <td><img class="emoticon" src="images/emotions/nochoice.gif" alt="<?php echo getLabel("nochoice",$language);?>"></td>
         <td><img class="emoticon" src="images/emotions/sad.gif" alt="<?php echo getLabel("sad",$language);?>"></td>
         <td><img class="emoticon" src="images/emotions/smile.gif" alt="<?php echo getLabel("smile",$language);?>"></td>
         <td><img class="emoticon" src="images/emotions/suprise.gif" alt="<?php echo getLabel("suprise",$language);?>"></td>
      </tr>
      <tr>
         <td><img class="emoticon" src="images/emotions/tongue.gif" alt="<?php echo getLabel("tongue",$language);?>"></td>
         <td><img class="emoticon" src="images/emotions/wink.gif" alt="<?php echo getLabel("wink",$language);?>"></td>
         <td><img class="emoticon" src="images/emotions/worry.gif" alt="<?php echo getLabel("worry",$language);?>"></td>
         <td><img class="emoticon" src="images/emotions/yell.gif" alt="<?php echo getLabel("yell",$language);?>"></td>
         <td></td>
      </tr>
   </table>
</div>
<div id="html_div" style="display:none" title="<?php echo getLabel("Html Content",$language);?>">
   <textarea id="html_content" rows="8" cols="50"></textarea><br>
   <input type="button" id="html_btn" value="submit">
</div>

when all this is in place i dont get a error all i get when i load my web page up is

<td colspan="4" title="

i have no idea what i am doing wrong? if any one can hep it would be great thank you

Edited by nats01282: n/a

2
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by pritaeas
0
getLabel("Select Format",$language);

will probably fail. Where is getLabel and $language defined ? There should be a getLabel function somewhere, unless you want to output this as text, in which case you should add quotes.

Edited by pritaeas: n/a

0
<?php
$language="enus";
include_once("locale/".$language.".php");
function getLabel($key,$language){
   global $label;
   return $label[$language][$key];
}
?>

is this right?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.