Hello

July 30, 2010, 05:21:53 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length
What sNews Is: - sNews is a simple, basic, customizable CMS tool suitable for developers with beginner-to-advanced PHP skills. It is also useful to have a good working knowledge of how to work with, set up and manage MySQL databases. sNews is not - geared towards the end-user who knows little or nothing about building and developing PHP-MySQL based websites.
News: Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.
 
   Home   Help Search Login Register  
Pages: [1] 2 3 4
  Print  
Author Topic: FCKEditor for snews 1.7  (Read 13958 times)
tumu
Newbie
*

Karma: 0
Posts: 2


« on: October 27, 2008, 11:13:14 AM »

I use FCKEditor on my projects mostly. So implemented FCKEditor to snews. Here how is it:

1. Download FCKEditor and upload your site's root folder (/fckeditor/)
2. Edit snews.php

After "//STARTUP" (~line 76) add this
Code:
if (_ADMIN) {
$times = substr_count($_SERVER['PHP_SELF'],"/");
$rootaccess = "";
$ix = 1;
while ($ix < $times) {
  $rootaccess .= "../";
  $ix++;
}
include_once ($rootaccess."fckeditor/fckeditor.php");
}

Below "// FORM GENERATOR" inside the function replace following lines
Code:
case 'textarea': $output = '<p>'.$lbl.':<br />
<textarea name="'.$name.'" rows="'.$rows.'" cols="'.$cols.'"'.$attribs.'>'.$value.
'</textarea></p>';
break;
to
Code:
case 'textarea':
if (_ADMIN) {
$oFCKeditor = new FCKeditor($name) ;
$oFCKeditor->Height = '600' ;  //optional
$oFCKeditor->Value = $value;
$oFCKeditor->Create() ;
} else {
$output = '<p>'.$lbl.':<br />
<textarea name="'.$name.'" rows="'.$rows.'" cols="'.$cols.'"'.$attribs.'>'.$value.
'</textarea></p>';
}
break;

You may need to edit some config files of FCKeditor to upload images etc. Script alerts when needs to edit config, follow the instructions.

Hope this helps.
Logged
emailoo
Newbie
*

Karma: 3
Posts: 36


« Reply #1 on: November 04, 2008, 06:20:32 PM »

Seems to be that this advice is outdated
and does not fit into the current version of the code sNews 1.7 Update 1.0.
Logged
kamikazee
Newbie
*

Karma: 0
Posts: 10


WWW
« Reply #2 on: November 06, 2008, 12:51:36 PM »

For me also doesn't work.
Logged

laudes
Newbie
*

Karma: 2
Posts: 5


« Reply #3 on: November 06, 2008, 09:44:28 PM »

Also tried it no luck, Ill try again then post someting hopefully positive.
Logged
philmoz
High flyer
Administrator
ULTIMATE member
******

Karma: 150
Posts: 1836



WWW
« Reply #4 on: November 06, 2008, 09:50:02 PM »

hmm, ok, will shove this thread into programming.

Then you all can use it for progress testing etc Wink
Logged

Take offs are optional, landings are mandatory, unless you get into space, then you have other issues.
mosh
Sr. Member
****

Karma: 62
Posts: 410



WWW
« Reply #5 on: November 07, 2008, 06:56:09 AM »

hello Smiley
this is a simple way to add fck, just as we did with sNewsCMS v1.6,

after install the fck.

open snews.php -->
find form_article() function,
find line and comment it ou
t:
Code:
echo html_input('textarea', 'text', 'txt', $frm_text, l('text'), '', '', '', '', '', '2', '100', '', '', '');

find and comment out --> buttons() function:
Code:
buttons();

Add under it the FCK code
Code:
////////////////////
include("fckeditor/fckeditor.php");
///////////////////////////////////////////////
echo "<div class=\"editor\">";
$oFCKeditor = new FCKeditor('text') ;
$oFCKeditor->BasePath = '/snews_root_dir_here/fckeditor/';
$oFCKeditor->Value = stripslashes($r['text']);
$oFCKeditor->Width  = '98%' ;
$oFCKeditor->Height = '550' ;
$oFCKeditor->ToolbarSet = 'Default' ;
$oFCKeditor->Create() ;
echo "</div>";
////////////////////



a bit after that, find the preview div and comment it out:
Code:
echo '<div class="adminpanel">';
echo html_input('fieldset', '', '', '', '', '', '', '', '', '', '', '', '', '', '<a title="'.l('preview').'" onclick="toggle(\'preview\')" style="cursor: pointer;">'.l('preview').'</a>');
echo '<div id="preview" style="display:none;"></div>';
echo '</fieldset>
</div>';

that is all Smiley

awesome day
Logged

emailoo
Newbie
*

Karma: 3
Posts: 36


« Reply #6 on: November 08, 2008, 02:34:24 PM »

   
Can someone publish your converted file snews.php with FCKeditor?

I can not do it according to instructions!
Logged
mosh
Sr. Member
****

Karma: 62
Posts: 410



WWW
« Reply #7 on: November 08, 2008, 04:16:31 PM »

Try this http://cms-zen.com/downloads/snewsFCK.zip
Logged

emailoo
Newbie
*

Karma: 3
Posts: 36


« Reply #8 on: November 08, 2008, 06:01:45 PM »


   
Thank you.

I have a question, what to do in the FCK to install it?

It is in the root: index.php, snews.php, fckeditor and specially created folder userfiles.

   
I have an error in the panel at the place where he is editor:

Not Found
The requested URL /snews_root_dir_here/fckeditor/editor/fckeditor.html?InstanceName=text&Toolbar=Default was not found on this server.
Logged
Sven
ULTIMATE member
******

Karma: 72
Posts: 1816


Chasing MY bugs!


WWW
« Reply #9 on: November 08, 2008, 06:20:44 PM »


   
Thank you.

I have a question, what to do in the FCK to install it?

It is in the root: index.php, snews.php, fckeditor and specially created folder userfiles.

   
I have an error in the panel at the place where he is editor:

Not Found
The requested URL /snews_root_dir_here/fckeditor/editor/fckeditor.html?InstanceName=text&Toolbar=Default was not found on this server.

Give the path to FCKeditor in this line:
Quote
$oFCKeditor->BasePath = '/snews_root_dir_here/fckeditor/';
If root:
Quote
$oFCKeditor->BasePath = 'fckeditor/';
Logged

emailoo
Newbie
*

Karma: 3
Posts: 36


« Reply #10 on: November 08, 2008, 07:18:30 PM »

      
It works!

Thank you so mean!
Logged
SederGraphics
Guest
« Reply #11 on: November 13, 2008, 01:51:19 AM »

I am having and issue with the latest version of FCKeditor installed on SNews 1.7. In the FCKeditor I see symbols such as & and quotes, and also see double spaces. But when I save the changes and view them on the site & is converted to the HTML equivalent such as &amp;  double spaces are converted to &nbsp; and so on. Does anyone know how to fix this.

Thank you,


Kraig
Logged
studio
Newbie
*

Karma: 1
Posts: 7


WWW
« Reply #12 on: November 13, 2008, 02:59:08 PM »

In sNews 1.7 without FCK also does not work
Logged

Keyrocks
Administrator
ULTIMATE member
******

Karma: 411
Posts: 5452


Semantically Challenged


WWW
« Reply #13 on: November 13, 2008, 03:12:56 PM »

I am having and issue with the latest version of FCKeditor installed on SNews 1.7. In the FCKeditor I see symbols such as & and quotes, and also see double spaces. But when I save the changes and view them on the site & is converted to the HTML equivalent such as &amp;  double spaces are converted to &nbsp; and so on. Does anyone know how to fix this.
Thank you, Kraig
In sNews 1.7 without FCK also does not work

This doesn't happen on my test install of the latest download. Perhaps I do not understand what you are referring to. If I use apostrophes, double quotes and & signs in my textarea, they get saved into the articles dbase table that way... they display in the article that way... and they are that way when I pull the article's content up in the Edit panel as well. I do not experience conversion to html entities.

Perhaps this has to do with the character collation setting you use when you created your empty database... before populating it with the tables. You should want to use utf8_unicode_ci in the MySQL Connection Collation field and again... replace Collation with utf8_unicode_ci in the dropdown field to the left of the Create button before creating it.
Logged

Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU
mosh
Sr. Member
****

Karma: 62
Posts: 410



WWW
« Reply #14 on: November 13, 2008, 06:07:21 PM »

I am having and issue with the latest version of FCKeditor installed on SNews 1.7. In the FCKeditor I see symbols such as & and quotes, and also see double spaces. But when I save the changes and view them on the site & is converted to the HTML equivalent such as &amp;  double spaces are converted to &nbsp; and so on. Does anyone know how to fix this.

Thank you,


Kraig

hello Smiley
try this:
open snews.php, in function articles, find and comment out line
Code:
file_include(str_replace('[break]', '',str_replace('&', '&amp;', $text)), $shorten);

replace it with
Code:
file_include(str_replace('[break]', '',$text), $shorten);

that should work Smiley
awesome evening
Logged

Pages: [1] 2 3 4
  Print  
 
Jump to:  

English Steel 1.6 © Saxon North Technologies
Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!