I've created a small cms to edit articles on my site. I have an option to select a checkbox next to each article and then press the edit button so I can edit multiple articles at once. Each content textarea field is replaced by FCKeditor.
So in PHP I have a while loop which returns each row of data (each article), and places it into a fieldset of which the content field is FCKeditor.
This is, however, returning the same value in the iframe of FCKeditor for every article, even though the display:none input field has the correct values (which are different).
The html that is being poduced:
Article one - value of FCKeditor field = 'Content for the first article here' - Actual value = 'Content for the first article here':
Article two - value of FCKeditor field = 'Content for the first article here' - Actual value = 'Different content here for the second article which isn't appearing in FCKeditor field':
Has anyone got any ideas?
Thanks thanks.
So in PHP I have a while loop which returns each row of data (each article), and places it into a fieldset of which the content field is FCKeditor.
This is, however, returning the same value in the iframe of FCKeditor for every article, even though the display:none input field has the correct values (which are different).
$blog_content = $row['blog_content'];
$oFCKeditor = new FCKeditor('blog_content[]') ;
$oFCKeditor->BasePath = '../../add_ons/fckeditor/' ;
$oFCKeditor->ToolbarSet = 'Basic';
$oFCKeditor->Value = $blog_content ;
$oFCKeditor->Create() ;The html that is being poduced:
Article one - value of FCKeditor field = 'Content for the first article here' - Actual value = 'Content for the first article here':
<input type="hidden" id="blog_content[]" name="blog_content[]" value="Content for the first article here" style="display:none" /><input type="hidden" id="blog_content[]___Config" value="" style="display:none" /><iframe id="blog_content[]___Frame" src="../../add_ons/fckeditor/editor/fckeditor.html?InstanceName=blog_content[]&Toolbar=Basic" width="100%" height="200" frameborder="0" scrolling="no"></iframe>
Article two - value of FCKeditor field = 'Content for the first article here' - Actual value = 'Different content here for the second article which isn't appearing in FCKeditor field':
<input type="hidden" id="blog_content[]" name="blog_content[]" value="Different content here for the second article which isn't appearing in FCKeditor field" style="display:none" /><input type="hidden" id="blog_content[]___Config" value="" style="display:none" /><iframe id="blog_content[]___Frame" src="../../add_ons/fckeditor/editor/fckeditor.html?InstanceName=blog_content[]&Toolbar=Basic" width="100%" height="200" frameborder="0" scrolling="no"></iframe>
Has anyone got any ideas?
Thanks thanks.

Re: Editor loop problem
for ($i = 0; $i<count($_POST["blog_id"]); $i++) { $edit_blog_id = $_POST["blog_id"][$i]; $query = "SELECT * FROM blog WHERE blog_id = $edit_blog_id"; $result = @mysql_query ($query); if ($result) { while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { echo '<fieldset class="project_cms"> <h3>' . $project_title_split[0] . '</h3> <p><label for="blog_title">Title</label> <input type="text" name="blog_title[]" value="' . $row['blog_title'] . '" /></p> <p><label for="blog_content">Content</label></p> <div class="editor">'; $blog_content = $row['blog_content']; $trans = array('\n' => '', '\r' => '', '<p>&nbsp;</p>' => ''); $blog_content = strtr($blog_content, $trans); $trans = array('<' => '<', '>' => '>', '"' => '"'); $blog_content = strtr(stripslashes($blog_content), $trans); $oFCKeditor = new FCKeditor('blog_content[]') ; $oFCKeditor->BasePath = '../../add_ons/fckeditor/' ; $oFCKeditor->ToolbarSet = 'Basic'; $oFCKeditor->Value = $blog_content ; $oFCKeditor->Create() ; echo '<!--editor--></div> <p><label for="blog_image">Image</label> <input type="text" name="blog_image[]" value="' . $row['blog_image'] . '" /><input type="hidden" name="blog_id[]" value="' . $row['blog_id'] . '" /></p> </fieldset>'; } }Re: Editor loop problem
Re: Editor loop problem