Mam problem z FCKeditor jego postac jest nastepujaca chodzi o oto ze uzywam go do edycji plikow includowanych przez strone jeden plik obsluguje wszystkie strony ktore sa mu przeazywane przez mienna GET w tym pliku otwieram plik w nastepujacy sposob:
  1. <?php
  2. $file = fopen($sciezka, &#092;"r\");
  3. flock($file, 1); 
  4. while($linia=fgets($file, 1025)) 
  5. { 
  6. print $linia;
  7. }
  8. flock($file, 3); 
  9.  
  10. fclose($file);  
  11.  
  12. ?>


i teraz aby wyswiwtlic TextArea z FKKeditor musze zupelnic nastepujace wartosci:
  1. <?php
  2.  
  3. $sBasePath = $_SERVER['PHP_SELF'];
  4.  
  5.  
  6. $oFCKeditor = new FCKeditor('FCKeditor1');
  7.  
  8. $oFCKeditor->BasePath = 'editor/';
  9.  
  10. $oFCKeditor->Value = '<!----tutaj powinienm wysiwtlic zmienna $linia----!>';
  11.  
  12. $oFCKeditor->Create();
  13.  
  14. ?>

i nie wiem jak zrobic by ta zmienna sie tam wyswietlila caly czas albo nic sie nie wyswietla albo jakies krzaczki patrzylem do pliku ktory includuje na gorze ale nie wiem jak cos tam zmienic oto ten plik:
  1. <?php 
  2.  
  3.  
  4. class FCKeditor
  5. {
  6. var $InstanceName ;
  7. var $BasePath ;
  8. var $Width ;
  9. var $Height ;
  10. var $ToolbarSet ;
  11. var $Value ;
  12. var $Config ;
  13.  
  14. function FCKeditor( $instanceName )
  15. {
  16. $this->InstanceName = $instanceName ;
  17. $this->BasePath = '/editor/' ;
  18. $this->Width = '800' ;
  19. $this->Height = '600' ;
  20. $this->ToolbarSet = 'Default' ;
  21. $this->Value = '' ;
  22.  
  23. $this->Config = array();
  24. }
  25.  
  26. function Create()
  27. {
  28. echo $this->CreateHtml();
  29. }
  30.  
  31. function CreateHtml()
  32. {
  33. $HtmlValue = htmlspecialchars( $this->Value );
  34.  
  35. $Html = '<div>' ;
  36.  
  37. if ( $this->IsCompatible() )
  38. {
  39. $Link = &#092;"{$this->BasePath}editor/fckeditor.html?InstanceName={$this->InstanceName}\" ;
  40.  
  41. if ( $this->ToolbarSet != '' )
  42. $Link .= &#092;"&amp;Toolbar={$this->ToolbarSet}\" ;
  43.  
  44. // Render the linked hidden field.
  45. $Html .= &#092;"<input type=\"hidden\" id=\"{$this->InstanceName}\" name=\"{$this->InstanceName}\" value=\"{$HtmlValue}\" />\" ;
  46.  
  47. // Render the configurations hidden field.
  48. $Html .= &#092;"<input type=\"hidden\" id=\"{$this->InstanceName}___Config\" value=\"\" . $this->GetConfigFieldString() . \"\" />\" ;
  49.  
  50. // Render the editor IFRAME.
  51. $Html .= &#092;"<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"no\" scrolling=\"no\"></iframe>\" ;
  52. }
  53. else
  54. {
  55. if ( strpos( $this->Width, '%' ) === false )
  56. $WidthCSS = $this->Width . 'px' ;
  57. else
  58. $WidthCSS = $this->Width ;
  59.  
  60. if ( strpos( $this->Height, '%' ) === false )
  61. $HeightCSS = $this->Height . 'px' ;
  62. else
  63. $HeightCSS = $this->Height ;
  64.  
  65. $Html .= &#092;"<textarea name=\"{$this->InstanceName}\" rows=\"4\" cols=\"40\" style=\"width: {$WidthCSS}; height: {$HeightCSS}\" wrap=\"virtual\">{$HtmlValue}</textarea>\" ;
  66. }
  67.  
  68. $Html .= '</div>' ;
  69.  
  70. return $Html ;
  71. }
  72.  
  73. function IsCompatible()
  74. {
  75. global $HTTP_USER_AGENT ;
  76.  
  77. if ( isset( $HTTP_USER_AGENT ) )
  78. $sAgent = $HTTP_USER_AGENT ;
  79. else
  80. $sAgent = $_SERVER['HTTP_USER_AGENT'];
  81.  
  82. if ( strpos($sAgent, 'MSIE') !== false && strpos($sAgent, 'mac') === false && strpos($sAgent, 'Opera') === false )
  83. {
  84. $iVersion = (float)substr($sAgent, strpos($sAgent, 'MSIE') + 5, 3);
  85. return ($iVersion >= 5.5);
  86. }
  87. else if ( strpos($sAgent, 'Gecko/') !== false )
  88. {
  89. $iVersion = (int)substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8);
  90. return ($iVersion >= 20030210);
  91. }
  92. else
  93. return false ;
  94. }
  95.  
  96. function GetConfigFieldString()
  97. {
  98. $sParams = '' ;
  99. $bFirst = true ;
  100.  
  101. foreach ( $this->Config as $sKey => $sValue )
  102. {
  103. if ( $bFirst == false )
  104. $sParams .= '&amp;' ;
  105. else
  106. $bFirst = false ;
  107.  
  108. if ( $sValue === true )
  109. $sParams .= $this->EncodeConfig( $sKey ) . '=true' ;
  110. else if ( $sValue === false )
  111. $sParams .= $this->EncodeConfig( $sKey ) . '=false' ;
  112. else
  113. $sParams .= $this->EncodeConfig( $sKey ) . '=' . $this->EncodeConfig( $sValue );
  114. }
  115.  
  116. return $sParams ;
  117. }
  118.  
  119. function EncodeConfig( $valueToEncode )
  120. {
  121. $chars = array( 
  122. '&' => '%26', 
  123. '=' => '%3D', 
  124. '\"' => '%22' );
  125.  
  126. return strtr( $valueToEncode, $chars );
  127. }
  128. }
  129.  
  130. ?>