Witam, mam problem z instalacją FCK w CMSie Webtext. Plik php, w którym chcę, żeby pojawiał się edytor:
<span class="nag">System nowości</span><br /><br />
<?php
if($_SESSION['poziom'] == '3' or $_SESSION['poziom'] == '2' or $_SESSION['poziom'] == '1') {
if($zapiszedycje == 'tak') {
NewsZapiszEdycje($linia,$tytulnewsa,$trescnewsa,$autornewsa,$data,$komentid);
}
if($dodajnewsa == 'tak') {
NewsDodaj($tytulnewsa,$trescnewsa,$autornewsa);
}
if($usunnewsa == 'tak') {
NewsUsun($linia);
}
if($id == 'ile') {
ZapiszConfig($ilenowosci,$ksile,$rejzp,$galile,$knews3,$enews2);
}
if($poziom == '2' or $poziom == '1') {
?>
<fieldset class="form1" style="width:600px;">
<legend class="form2">Ustawienia</legend>
<form action="?sekcja=snews&id=ile&header=tak&lokacja=?sekcja=snews" method="post">
<fieldset style="border:0px;">
Ilość newsów na stronie:<br />
<input type="text" name="ilenowosci" value="<?=$newsile?>" style="width: 95%;margin-left:10px;" /><br /><br />
Komentarze w newsach:<br />
<select name="knews3" style="width: 95%;margin-left:10px;" class="option">
<?php
if($knews == 'tak') {
<option value=\"tak\">Włączone</option>
<option value=\"nie\">Wyłączone</option>";
}
else
echo "<option value=\"nie\">Wyłączone</option> <option value=\"tak\">Włączone</option>";
?>
</select><br /><br />
Emotikonki w newsach:<br />
<select name="enews2" style="width: 95%;margin-left:10px;" class="option">
<?php
if($enews == 'tak') {
<option value=\"tak\">Włączone</option>
<option value=\"nie\">Wyłączone</option>";
}
else
echo "<option value=\"nie\">Wyłączone</option> <option value=\"tak\">Włączone</option>";
?>
</select><br /><br />
<input type="submit" value="zapisz" style="margin-left:10px;" />
</fieldset>
</form>
</fieldset>
<!-- -->
<?php
}
if($id == '1') {
$plik=file("db/news.txt"); $file2 = file("db/koment/$tmp[4].txt"); ?>
<fieldset class="form1" style="width:600px;">
<legend class="form2">Edycja newsa</legend>
<form action="?sekcja=snews" method="post">
<fieldset style="border:0px;">
<input type="hidden" name="zapiszedycje" value="tak" />
<input type="hidden" name="linia" value="<?=$linia?>" />
<input type="hidden" name="komentid" value="<?=$tmp[4]?>" />
Tytuł:<br />
<input type="text" name="tytulnewsa" value="<?=$tmp[0]?>" style="width: 95%;margin-left:10px;" /><br /><br />
Treść:<br />
<textarea name="trescnewsa" style="width: 95%;height:70px;margin-left:10px;">
<?=$tmp[1]?></textarea><br /><br />
Autor:<br />
<input type="text" name="autornewsa" value="<?=$tmp[2]?>" style="width: 95%;margin-left:10px;" /><br /><br />
Data:<br />
<input type="text" name="data" value="<?=$tmp[3]?>" style="width: 95%;margin-left:10px;" /><br /><br />
Komentarzy: <?=$ilekom?>
<br /><br />
<input type="submit" value="zapisz" style="margin-left:10px;" />
<input type="button" style="margin-left:10px;" value="zrezygnuj" onclick="location.href='?sekcja=snews'">
</fieldset>
</form>
</fieldset>
<?php
}
else {
?>
<fieldset class="form1" style="width:600px;">
<legend class="form2">Dodaj newsa</legend>
<form action="?sekcja=snews" method="post">
<fieldset style="border:0px;">
<input type="hidden" name="dodajnewsa" value="tak" />
Tytuł:<br />
<input type="text" name="tytulnewsa" style="width: 95%;margin-left:10px;" /><br /><br />
Treść:<br />
<textarea name="trescnewsa" style="width: 95%;height:70px;margin-left:10px;">
</textarea>
<br /><br />
Autor:<br />
<input type="text" name="autornewsa" value="<?=$log?>" style="width: 95%;margin-left:10px;" /><br /><br />
<input type="submit" value="dodaj" style="margin-left:10px;" />
</fieldset>
</form>
</legend>
</fieldset>
<!-- -->
<fieldset class="form1" style="width:600px;">
<legend class="form2">Edytuj newsa</legend>
<form action="?sekcja=snews&id=1" method="post">
<fieldset style="border:0px;">
Wybierz newsa do edycji:<br />
<select name="linia" style="width: 95%;margin-left:10px;" class="option">
<?php
$plik3=file('db/news.txt'); for ($i=0; $i<$ile3; $i++){
echo("<option value=\"$i\">".$dane[0]." - ".$dane[3]."</option>"); }
?>
</select>
<br /><br />
<input type="submit" value="edytuj" style="margin-left:10px;" />
</fieldset>
</form>
</fieldset>
<!-- -->
<fieldset class="form1" style="width:600px;">
<legend class="form2">Usuń newsa</legend>
<form action="?sekcja=snews" method="post">
<fieldset style="border:0px;">
<input type="hidden" name="usunnewsa" value="tak" />
Wybierz newsa do usunięcia:<br />
<select name="linia" style="width: 95%;margin-left:10px;" class="option">
<?php
$plik3=file('db/news.txt'); for ($i=0; $i<$ile3; $i++){
echo("<option value=\"$i\">".$dane[0]." - ".$dane[3]."</option>"); }
?>
</select>
<br /><br />
<input type="submit" value="usuń" style="margin-left:10px;" />
</fieldset>
</form>
</fieldset>
<?php
}
?>
<?php
}
else echo "Niemasz uprawnień do oglądania tej strony!"; ?>
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):
<?php
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// $oFCKeditor->BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
$sBasePath = $_SERVER['PHP_SELF'] ;
$sBasePath = substr( $sBasePath, 0
, strpos( $sBasePath, "_samples" ) ) ;
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
$oFCKeditor->Create() ;
?>
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.