Witam, mam problem z instalacją FCK w CMSie Webtext. Plik php, w którym chcę, żeby pojawiał się edytor:

  1. <span class="nag">System nowości</span><br /><br />
  2. <?php
  3. if($_SESSION['poziom'] == '3' or $_SESSION['poziom'] == '2' or $_SESSION['poziom'] == '1') {
  4. if($zapiszedycje == 'tak') {
  5. NewsZapiszEdycje($linia,$tytulnewsa,$trescnewsa,$autornewsa,$data,$komentid);
  6. }
  7. if($dodajnewsa == 'tak') {
  8. NewsDodaj($tytulnewsa,$trescnewsa,$autornewsa);
  9. }
  10. if($usunnewsa == 'tak') {
  11. NewsUsun($linia);
  12. }
  13. if($id == 'ile') {
  14. ZapiszConfig($ilenowosci,$ksile,$rejzp,$galile,$knews3,$enews2);
  15. }
  16.  
  17. if($poziom == '2' or $poziom == '1') {
  18. ?>
  19. <fieldset class="form1" style="width:600px;">
  20. <legend class="form2">Ustawienia</legend>
  21. <form action="?sekcja=snews&amp;id=ile&amp;header=tak&amp;lokacja=?sekcja=snews" method="post">
  22. <fieldset style="border:0px;">
  23. Ilość newsów na stronie:<br />
  24. <input type="text" name="ilenowosci" value="<?=$newsile?>" style="width: 95%;margin-left:10px;" /><br /><br />
  25. Komentarze w newsach:<br />
  26. <select name="knews3" style="width: 95%;margin-left:10px;" class="option">
  27. <?php
  28. if($knews == 'tak') {
  29. <option value=\"tak\">Włączone</option>
  30. <option value=\"nie\">Wyłączone</option>";
  31. }
  32. else
  33. echo "<option value=\"nie\">Wyłączone</option>
  34. <option value=\"tak\">Włączone</option>";
  35.  
  36. ?>
  37. </select><br /><br />
  38. Emotikonki w newsach:<br />
  39. <select name="enews2" style="width: 95%;margin-left:10px;" class="option">
  40. <?php
  41. if($enews == 'tak') {
  42. <option value=\"tak\">Włączone</option>
  43. <option value=\"nie\">Wyłączone</option>";
  44. }
  45. else
  46. echo "<option value=\"nie\">Wyłączone</option>
  47. <option value=\"tak\">Włączone</option>";
  48.  
  49. ?>
  50. </select><br /><br />
  51. <input type="submit" value="zapisz" style="margin-left:10px;" />
  52. </fieldset>
  53. </form>
  54.  
  55. </fieldset>
  56. <!-- -->
  57.  
  58. <?php
  59. }
  60. if($id == '1') {
  61. $plik=file("db/news.txt");
  62. $tmp=explode("|+|",$plik[$linia]);
  63. $tmp[1]=str_replace("<br />","\n",$tmp[1]);
  64. $file2 = file("db/koment/$tmp[4].txt");
  65. $ilekom = count($file2);
  66. ?>
  67. <fieldset class="form1" style="width:600px;">
  68. <legend class="form2">Edycja newsa</legend>
  69. <form action="?sekcja=snews" method="post">
  70. <fieldset style="border:0px;">
  71. <input type="hidden" name="zapiszedycje" value="tak" />
  72. <input type="hidden" name="linia" value="<?=$linia?>" />
  73. <input type="hidden" name="komentid" value="<?=$tmp[4]?>" />
  74. Tytuł:<br />
  75. <input type="text" name="tytulnewsa" value="<?=$tmp[0]?>" style="width: 95%;margin-left:10px;" /><br /><br />
  76. Treść:<br />
  77. <textarea name="trescnewsa" style="width: 95%;height:70px;margin-left:10px;">
  78. <?=$tmp[1]?></textarea><br /><br />
  79. Autor:<br />
  80. <input type="text" name="autornewsa" value="<?=$tmp[2]?>" style="width: 95%;margin-left:10px;" /><br /><br />
  81. Data:<br />
  82. <input type="text" name="data" value="<?=$tmp[3]?>" style="width: 95%;margin-left:10px;" /><br /><br />
  83. Komentarzy: <?=$ilekom?>
  84. <br /><br />
  85. <input type="submit" value="zapisz" style="margin-left:10px;" />
  86. <input type="button" style="margin-left:10px;" value="zrezygnuj" onclick="location.href='?sekcja=snews'">
  87.  
  88. </fieldset>
  89. </form>
  90. </fieldset>
  91. <?php
  92. }
  93. else {
  94. ?>
  95. <fieldset class="form1" style="width:600px;">
  96. <legend class="form2">Dodaj newsa</legend>
  97. <form action="?sekcja=snews" method="post">
  98. <fieldset style="border:0px;">
  99. <input type="hidden" name="dodajnewsa" value="tak" />
  100. Tytuł:<br />
  101. <input type="text" name="tytulnewsa" style="width: 95%;margin-left:10px;" /><br /><br />
  102. Treść:<br />
  103. <textarea name="trescnewsa" style="width: 95%;height:70px;margin-left:10px;">
  104. </textarea>
  105. <br /><br />
  106. Autor:<br />
  107. <input type="text" name="autornewsa" value="<?=$log?>" style="width: 95%;margin-left:10px;" /><br /><br />
  108. <input type="submit" value="dodaj" style="margin-left:10px;" />
  109. </fieldset>
  110. </form>
  111.  
  112. </legend>
  113. </fieldset>
  114. <!-- -->
  115. <fieldset class="form1" style="width:600px;">
  116. <legend class="form2">Edytuj newsa</legend>
  117. <form action="?sekcja=snews&amp;id=1" method="post">
  118. <fieldset style="border:0px;">
  119. Wybierz newsa do edycji:<br />
  120. <select name="linia" style="width: 95%;margin-left:10px;" class="option">
  121. <?php
  122. $plik3=file('db/news.txt');
  123. $ile3=count($plik3);
  124. for ($i=0; $i<$ile3; $i++){
  125. $dane=explode("|+|",$plik3[$i]);
  126. echo("<option value=\"$i\">".$dane[0]." - ".$dane[3]."</option>");
  127. }
  128. ?>
  129. </select>
  130. <br /><br />
  131. <input type="submit" value="edytuj" style="margin-left:10px;" />
  132. </fieldset>
  133. </form>
  134.  
  135. </fieldset>
  136. <!-- -->
  137. <fieldset class="form1" style="width:600px;">
  138. <legend class="form2">Usuń newsa</legend>
  139. <form action="?sekcja=snews" method="post">
  140. <fieldset style="border:0px;">
  141. <input type="hidden" name="usunnewsa" value="tak" />
  142. Wybierz newsa do usunięcia:<br />
  143. <select name="linia" style="width: 95%;margin-left:10px;" class="option">
  144. <?php
  145. $plik3=file('db/news.txt');
  146. $ile3=count($plik3);
  147. for ($i=0; $i<$ile3; $i++){
  148. $dane=explode("|+|",$plik3[$i]);
  149. echo("<option value=\"$i\">".$dane[0]." - ".$dane[3]."</option>");
  150. }
  151. ?>
  152. </select>
  153. <br /><br />
  154. <input type="submit" value="usuń" style="margin-left:10px;" />
  155. </fieldset>
  156. </form>
  157.  
  158. </fieldset>
  159. <?php
  160. }
  161. ?>
  162. <?php
  163. }
  164. else echo "Niemasz uprawnień do oglądania tej strony!";
  165. ?>


Jestem bardzo początkujący, proszę o pomoc. FCK prawidłowo zainstalowałem na localhost, kwestia dodania odpowiedniego skryptu, ale nie wiem, jak to zrobić, żeby fck się wyświetlał. Próby dodania skryptu z sampla powodują wyświetlanie błędu o braku class FCKEditor w pliku.

Skrypt sampla wpisany zamiast textarea "trescnewsa" (linia 105 i 106):
  1. <?php
  2. // Automatically calculates the editor base path based on the _samples directory.
  3. // This is usefull only for these samples. A real application should use something like this:
  4. // $oFCKeditor->BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
  5. $sBasePath = $_SERVER['PHP_SELF'] ;
  6. $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
  7.  
  8. $oFCKeditor = new FCKeditor('FCKeditor1') ;
  9. $oFCKeditor->BasePath = $sBasePath ;
  10. $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
  11. $oFCKeditor->Create() ;
  12. ?>


Zdaję sobie sprawę z tego, że to tylko sample i nie ma prawa działać. Tylko co mam zmienić w pliku, żeby działało? Proszę o fachową pomoc. sciana.gif