
March 3rd, 2003, 09:23 AM
|
|
Junior Member
|
|
Join Date: Feb 2003
Location: near Amsterdam
Posts: 10
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
[EditWorks] multiple formfields
I've got EditWorksPro running! But i've got a problem.
I am making a CMS with a editnews page. The idea is that a popup window appears with a few fields which can be edit.
an input field '$inlezer' (this is the 'header')
and '$kop' will be opened in the WYSIWYG editor.
But for some reason $kop saves correctly but $inlezer won't be saved.
This is what i got:
PHP Code:
<?
include("ew/class.editworks.php");
$db0 = new mysqldb();
$query0="SELECT `id`, `kop`, `dag`, `maand`, `jaar`, `zichtbaar`, `inlezer` ".
"FROM `bvcnieuws` where id='$id' ";
$db0->setsql($query0);
$db0->selectquery();
$id = $db0->result[0][0];
$kop = $db0->result[0][1];
$dag = $db0->result[0][2];
$maand = $db0->result[0][3];
$jaar = $db0->result[0][4];
$zichtbaar = $db0->result[0][5];
$inlezer = $db0->result[0][6];
$myEW = new EW;
$c = mysql_connect($dbServer, $dbUser, $dbPass) or die("Couldn't connect to database");
$d = mysql_select_db($dbName) or die("Couldn't select database");
if(isset($_POST['save']) && $_POST['save']=="true")
{
$kop = $myEW->GetValue(true);
$result = @mysql_query("update bvcnieuws SET kop = '$kop', inlezer = '$inlezer' where id = '$id'");
echo "
<table width='610' border='0' cellpadding='0' cellspacing='0'>
<tr><td height='300'> </td></tr>
<tr>
<td align='center' class='sluit'>
De pagina is opgeslagen. <br><br><br><br>
<input type='button' value='Sluit venster' onClick='self.close()'></td></tr></table>";
}
else
{
$result = mysql_query("select kop, inlezer from bvcnieuws where id = '$id'");
if($row = mysql_fetch_array($result))
$data = $row["kop"];
else
$data = "";
$myEW->SetValue($data);
?>
<body background="images/back_pop.gif"onUnload="window.opener.location.reload()">
<div align="center"><img src="images/titel.gif" alt="" border="0"></div>
<form name="editor" action="popnieuws.php?id=<? echo($id) ?>" method="post">
<textarea class="inlezer" rows="5" name="inlezer"><? echo($inlezer) ?></textarea>
<?php
// These are the functions that you can call to hide varions buttons,
// lists and tab buttons. By default, everything is enabled
//$myEW->HideBoldButton();
//$myEW->HideUnderlineButton();
//$myEW->HideItalicButton();
//$myEW->HideNumberListButton();
//$myEW->HideBulletListButton();
//$myEW->HideDecreaseIndentButton();
//$myEW->HideIncreaseIndentButton();
//$myEW->HideLeftAlignButton();
//$myEW->HideCenterAlignButton();
//$myEW->HideRightAlignButton();
//$myEW->HideJustifyButton();
//$myEW->HideHorizontalRuleButton();
//$myEW->HideLinkButton();
//$myEW->HideAnchorButton();
//$myEW->HideMailLinkButton();
//$myEW->HideHelpButton();
$myEW->HideFontList();
//$myEW->HideSizeList();
//$myEW->HideFormatList();
$myEW->HideStyleList();
//$myEW->HideForeColorButton();
//$myEW->HideBackColorButton();
//$myEW->HideTableButton();
$myEW->HideFormButton();
//$myEW->HideImageButton();
//$myEW->HideSymbolButton();
//$myEW->HidePropertiesButton();
//$myEW->HideCleanHTMLButton();
//$myEW->HideGuidelinesButton();
//$myEW->DisableSourceMode();
//$myEW->DisablePreviewMode();
//$myEW->DisableImageUploading();
//$myEW->DisableImageDeleting();
//$myEW->DisableXHTMLFormatting();
//$myEW->DisableSingleLineReturn();
//$myEW->HideRemoveTextFormattingButton();
//$myEW->HideSuperScriptButton();
//$myEW->HideSubScriptButton();
//$myEW->HidePasteFromWordButton();
//How do we want images to be inserted into our HTML content?
//EW_PATH_TYPE_FULL will insert a link/image in this format: [url]http://www.mysite.com/test.html[/url]
//EW_PATH_TYPE_ABSOLUTE will insert a link/image in this format: /myimage.gif
$myEW->SetPathType(EW_PATH_TYPE_FULL);
//Do we want images to appear in the image manager as thumbnails or just in rows?
//EW_IMAGE_TYPE_ROW means just list in a tabular format, without a thumbnail
//EW_IMAGE_TYPE_THUMBNAIL means list in 4-per-line thumbnail mode
$myEW->SetImageDisplayType(EW_IMAGE_TYPE_THUMBNAIL);
$myEW->EnableGuidelines();
//If the user isnt running Internet Explorer, then a <textarea> tag will be shown.
//This function will set the rows and cols of that <textarea>
//$myEW->SetTextAreaDimensions(60, 90);
//Display the rest of the form
?>
<input type="hidden" name="save" value="true">
<?php $myEW->ShowControl(609, 370, "/myimages"); ?>
<br>
<!--<input type="submit" value="Save" align="left">-->
<input type="submit" name="submit" value="Save">
</form>
<?php
}
?>
can someone help me out?
I read somewhere about the editor not being inside a form??
What are the alternatives?
|