Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Pytanie w sprawie FckEditor
Forum PHP.pl > Forum > Po stronie przeglądarki
Konuss
Witam mam takie pytanie w sprawie tego edytora a więc działa mi wszystko w nim wywało go za pomocą php kod:

  1. <?php
  2. <table width="80%" cellpadding="0" cellspacing="0" border="0" align="center">
  3. <tr>
  4. <td class="uni_01"><br><Br>Krótka tre&para;&aelig;:<br><Br>';
  5. $oFCKeditor = new FCKeditor('text') ;
  6. $oFCKeditor->BasePath = '/FCKeditor/';
  7. $oFCKeditor->Value = $text;
  8. $oFCKeditor->Width = '100%' ;
  9. $oFCKeditor->Height = '300' ;
  10. $oFCKeditor->Create() ;
  11. echo'</td>
  12. </tr>
  13.  
  14.  
  15. <tr>
  16. <td class="uni_01"><br>D&sup3;uga tre&para;&aelig;:<br><br>';
  17. $oFCKeditor = new FCKeditor('textcd') ;
  18. $oFCKeditor->BasePath = '/FCKeditor/';
  19. $oFCKeditor->Value = $textcd;
  20. $oFCKeditor->Width = '100%' ;
  21. $oFCKeditor->Height = '300' ;
  22. $oFCKeditor->Create() ;
  23. echo'<br></td>
  24. </tr>
  25. </table>
  26. ?>


I wszystko działa pieknie ażdo czasu gdy np ktośchce zedytować newsa tzn: po edycji zamiast tekstu i stylow użytych w nim wywala caly kod html. Czy wię ktoś jak to naprawić. Bardzo dziekuję za pomoc.
acztery
jezeli masz to na smarty to ja mam tak i mi działa

  1. <?php
  2. $oFCKeditor = new FCKeditor('desc') ;
  3. $oFCKeditor->BasePath = 'FCKeditor/';
  4. $oFCKeditor->Config['CustomConfigurationsPath'] = '../../FCKeditor/hollandpensioen-fckconfig.js' ;
  5. $oFCKeditor->Config['DefaultLanguage'] = 'en' ;
  6.  
  7. $oFCKeditor->Value = $oubase['data']['0']['Desc'];
  8. $oFCKeditor->Width = '100%' ;
  9. $oFCKeditor->Height = '400' ;
  10. $Config['UserFilesPath'] = '/hollandpensioen/UserFiles/' ;
  11.  
  12. $output = $oFCKeditor->CreateHtml();
  13. $s->assign('editor',$output); // deklaracja zmiennej w smarty.
  14. ?>
Konuss
Jestes pewniej bardzie zaawansowany niz ja i wybacz ale nie rozumiem gdzie lub cos mam wkleic ten kod co podałem wyzej odpowiada za wyswietlenie danych podczas edycji wiec jak mam go zmodyfikować lub co mam zrobić. Proszę o pomoc ?

To jest cala funkcja u mnie co odpowiada za edytowanie newsa:

  1. <?php
  2. function edit_form() {
  3.  
  4. global $PHP_SELF, $news_tbl, $id, $access, $nick, $op, $goto, $op, $topic_tbl, $source, $sources_tbl;
  5.  
  6.  
  7. if(have_access($op)=='ok') {
  8.  
  9.  $query = "SELECT * FROM $news_tbl WHERE id=$id";
  10.  $result = mysql_query($query);
  11.  
  12.  $r = mysql_fetch_array($result);
  13.  
  14. $text = $r['text'];
  15. $topic = $r['topic'];
  16. $text = stripslashes($text);
  17.  
  18. $textcd = $r['textcd'];
  19. $textcd = stripslashes($textcd);
  20.  
  21. $title = $r['title'];
  22. $title = stripslashes($title);
  23.  
  24. $title = htmlspecialchars($title);
  25. $text = htmlspecialchars($text);
  26. $textcd = htmlspecialchars($textcd);
  27.  
  28.  
  29. $author = $r['author'];
  30. $icon = $r['icon'];
  31. $source = $r['source'];
  32.  
  33.  
  34. echo '<form name="post" method="post" action="'.$PHP_SELF.'?op='.$op.'" enctype="multipart/form-data">
  35. <table width="80%" border="0" cellspacing="3" cellpadding="0" align="center">
  36. <tr>
  37. <td align="right" valign="top" class="uni_01">tytuł newsa</td>
  38. <td>
  39. <input type="text" name="title" size="35" value="'.$title.'">
  40. </td>
  41. </tr>
  42. <tr>
  43. <td align="right" valign="top" class="uni_01">link do wywiadu audio</td>
  44. <td>
  45. <input type="text" name="wywiad" size="35" value="'.$r['wywiad'].'">
  46. </td>
  47. </tr>
  48. <tr><td align="right" valign="top" class="uni_01">Ľródło</td>
  49. <td class="uni_01">
  50. <select name="source">
  51. <option value="0">brak</option>';
  52.  
  53. $query = "SELECT * FROM $sources_tbl";
  54. $result = mysql_query($query);
  55. while($rs = mysql_fetch_array($result)){
  56.  
  57. $linkb = $rs['linkb'];
  58. $sid = $rs['id'];
  59. echo'<option value="'.$sid.'">'.$linkb.'</option>';}
  60.  
  61.  
  62. echo'</select></td></tr>
  63. <tr>
  64. <td align="right" valign="top" class="uni_01">dział</td>
  65. <td class="next">';
  66.  
  67. echo '<select name="topic">
  68. <option value="no">(pomiń działy)</option>';
  69.  
  70.  
  71. $query = "SELECT * FROM $topic_tbl ORDER BY title";
  72. $result = mysql_query($query);
  73.  
  74. while($r = mysql_fetch_array($result)) {
  75.  
  76. $tid = $r['id'];
  77. $title = $r['title'];
  78.  
  79. if($tid==$topic) {
  80. echo '<option value="'.$tid.'" selected>'.$title.'</option>';
  81. } else {
  82. echo '<option value="'.$tid.'">'.$title.'</option>';
  83. }
  84.  
  85. }
  86.  
  87. echo '</select>';
  88.  
  89. echo '</td>
  90. </tr>
  91. </table>';
  92.  
  93.  
  94. echo '<table width="80%" cellpadding="0" cellspacing="0" border="0" align="center">
  95. <tr>
  96. <td class="uni_01"><br><Br>Krótka tre&para;ć:<br><Br>';
  97. $oFCKeditor = new FCKeditor('text') ;
  98. $oFCKeditor->BasePath = '/FCKeditor/';
  99. $oFCKeditor->Value = $text;
  100. $oFCKeditor->Width = '100%' ;
  101. $oFCKeditor->Height = '300' ;
  102. $oFCKeditor->Create() ;
  103. echo'</td>
  104. </tr>
  105.  
  106.  
  107. <tr>
  108. <td class="uni_01"><br>Długa tre&para;ć:<br><br>';
  109. $oFCKeditor = new FCKeditor('textcd') ;
  110. $oFCKeditor->BasePath = '/FCKeditor/';
  111. $oFCKeditor->Value = $textcd;
  112. $oFCKeditor->Width = '100%' ;
  113. $oFCKeditor->Height = '300' ;
  114. $oFCKeditor->Create() ;
  115. echo'<br></td>
  116. </tr>
  117. </table>
  118. <table cellpadding="0" cellspacing="0" border="0" align="center">
  119. <tr>
  120. <td align="right" class="uni_01">ikonka: upload <input class="poll" type="radio" name="itype" value="upload"></td>
  121. <td>
  122. <input type="file" name="icon" size="35">
  123. </td>
  124. </tr>
  125. <tr>
  126. <td align="right" class="uni_01">ikonka: url <input class="poll" type="radio" name="itype" value="url"';
  127. if($icon<>'') echo ' checked';
  128. echo '></td>
  129. <td>
  130. <input type="text" name="icon_" size="35" value="'.$icon.'">
  131. </td>
  132. </tr>
  133. <tr>
  134. <td align="right" class="uni_01">ikonka: brak <input class="poll" type="radio" name="itype" value="none"';
  135. if($icon=='') echo ' checked';
  136. echo '></td>
  137. <td>&nbsp;</td>
  138. </tr>
  139. <tr>
  140. <td align="right" class="uni_01">ikonka: z kolekcji <input class="poll" type="radio" name="itype" value="library"></td>
  141. <td valign="top">
  142.  
  143. <script language="javascript">
  144. <!--
  145. function showimage()
  146. {
  147. if (!document.images)
  148. return
  149. document.images.pictures.src=
  150. document.post.icons_.options[document.post.icons_.selectedIndex].value
  151. }
  152. //-->
  153. </script>
  154. <select name="icons_" onChange="showimage()">';
  155.  
  156. $i=0;
  157. if ($h_kat = @opendir(getcwd()."/uploads/news/")) {
  158.  while($h_plik = readdir($h_kat)) {
  159. $h_dl = strlen($h_plik)-3;
  160. $h_roz = substr($h_plik, $h_dl, 3);
  161. $h_GIF = strncasecmp($h_roz, "gif", 3);
  162. $h_BMP = strncasecmp($h_roz, "bmp", 3);
  163. $h_JPG = strncasecmp($h_roz, "jpg", 3);
  164. $h_PNG = strncasecmp($h_roz, "png", 3);
  165. if($h_GIF==|| $h_BMP==|| $h_JPG==|| $h_PNG==0){
  166. $tab[$i]=$h_plik;
  167. $i++;}}}
  168.  
  169. sort ($tab);
  170.  
  171. if($i!=0){
  172. for($a=; $a<$i ; $a++){
  173. $h_plik=$tab[$a];
  174. $h_dl = strlen($h_plik)-3;
  175. $h_nazwa = substr($h_plik, 0, $h_dl-1);
  176.  echo '<option value="uploads/news/'.$h_plik.'">'.$h_nazwa.'</option>';
  177.  if(!$h_pierwszy)$h_pierwszy=$h_plik;
  178.  }}
  179. closedir($h_kat);
  180.  
  181. if($icon=="")$icon="uploads/news/".$h_pierwszy;
  182.  
  183. </select>
  184. </td>
  185. </tr>
  186. <tr><td></td><td><img src="'.$icon.'" name="pictures"></td></tr>
  187. <tr><td></td><td height="20"></td></tr>
  188. <tr>
  189. <td align="right" valign="top" class="uni_01">&nbsp;</td>
  190. <td>
  191. <input style="font-weight: bold;" type="submit" name="ok" value="zapisz">
  192. <input type="reset" name="Reset" value="wyczy&para;ć">
  193. <input type="hidden" name="goto" value="'.$goto.'">
  194. <input type="hidden" name="cmd" value="update">
  195. <input type="hidden" name="id" value="'.$id.'">
  196. </td>
  197. </tr>
  198. </table>
  199. </form>
  200. ';
  201.  
  202.  
  203. }
  204. }
  205. ?>


Czy ktos pomógł by mi aby po edycji wyswietlało by mi sie wszytsko poprawnie a nie tak jak dotychczas kod html

Link 1 pisanie newsa: http://ekonin.net/nowy.gif

Link 2 edycja tego newsa: http://ekonin.net/edycja.gif



Proszę o pomoc chyba nikt nie chce widzę pomagać tu sad.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.