Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Pages: 1 [2] 3

Author Topic: [MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)  (Read 23965 times)

piXelatedEmpire

  • MIA
  • ULTIMATE member
  • ******
  • Karma: 37
  • Posts: 1401
  • currently MIA
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #15 on: December 14, 2006, 10:43:58 PM »

Quote from: Cesboa
I have a sNews 1.5.30 version with integrated FCKEditor, and some other addons (like article authoring) I haven't posted anything here in this forum yet....

www.wouz.dk/download/snews_with_FCK.zip

Just download FCK and put it in the root dir... There are still somethings that needs to be fixed, but it basically workes... Later on I will write a article on www.wouz.dk with our modifications and "how-to's"   :)
Hopefully you will release your mods here for all of us to have a peek at!  :D

Nice site design too Ceboa  ;)
Logged
my apologies to the sNews crew, but I will be MIA for the forseeable future

Cesboa

  • Newbie
  • *
  • Karma: 0
  • Posts: 2
    • http://www.wouz.dk
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #16 on: December 14, 2006, 11:44:54 PM »

Quote from: piXelatedEmpire
Hopefully you will release your mods here for all of us to have a peek at!  :D

Nice site design too Ceboa  ;)
Spanks!!  :)

Well you can download the snews zip file i have uploadet to wouz.dk - but basically just locate this (under Articles Form):
Quote
html_input('textarea', 'text', 'txt', $frm_text, l('text'), '', '', '', '', '', '2', '100', '', '', '');
and replace it with this:   
Quote
include("FCKeditor/fckeditor.php");
      echo "<p>";
      $oFCKeditor = new FCKeditor('text') ;
      $oFCKeditor->BasePath = '/FCKeditor/';
      $oFCKeditor->Value = stripslashes($r['text']);
      $oFCKeditor->Create() ;
      echo "</p>";
remember to upload FCKEditor in the root of your web ;)... There are still some features that doesn't work - like the little disk save icon... But the sNews save button works ;-)
« Last Edit: February 21, 2009, 02:36:59 PM by Joost »
Logged

modis

  • Newbie
  • *
  • Karma: 0
  • Posts: 11
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #17 on: December 15, 2006, 04:48:38 AM »

hi Cesboa

Thanks so much for the mod'ed script — much appreciated.
I'm so close to getting there…

After uploading the most recent FCKeditor folder to my serverb and setting the DB connection stuff, your snews.php needed one more change before the FCKeditor would show up:

Code: [Select]
$oFCKeditor->BasePath = '/FCKeditor/';to

Code: [Select]
$oFCKeditor->BasePath = 'FCKeditor/';So now the editor shows up and I can edit away to my heart's content!
Then I press Edit or Submit (for an existing or new article), snews reports that the operation has been completed successfully, but the edited article is completely unchanged and new articles don't appear.

Please tell me there's something super-basic I'm doing wrong here.  :)

Regards
Peter
Logged

modis

  • Newbie
  • *
  • Karma: 0
  • Posts: 11
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #18 on: December 15, 2006, 06:12:11 AM »

Ah…
OK, I got it all working by mod'ing my own script with your changes.
Thanks again, Cesboa, I think you just saved my project!

Regards
Peter
Logged

Zucye

  • Sr. Member
  • ****
  • Karma: 5
  • Posts: 347
    • Simplemente una Mujer
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #19 on: December 18, 2006, 04:04:41 PM »

The TinyMCe Editor works great, but it takes very long to load, the FCK is much faster and I was even able to add some buttons to it (like [break] ), with makes editing a lot easier, not to mention that it allows to upload images while you are editing the article.  I love how it works.... but I get a little browser error, everything still works fine, but is bugging me and I don't know how to get rid of it.  I know the problem is with the following line, but if I erase the line, the additional buttons don't work.
"document.getElementById('eButtons').style.visibility = '' ;"

The code goes as follows:

Code: [Select]
The buttons part was edited like this:
Code: [Select]
//FCK editor 1st Part
  if (isset($_GET["richarea"])){
html_input('button', '', '', 'Set Break', '', 'button', 'onclick="Setbreak();"', '', '', '', '', '', '', '', '');
html_input('button', '', '', 'Insert HTML', '', 'button', 'onclick="InsertHTML();"', '', '', '', '', '', '', '', '');
html_input('button', '', '', 'Insert HTML2', '', 'button', 'onclick="InsertHTML();"', '', '', '', '', '', '', '', '');
html_input('button', '', '', 'Simple Editor', '', 'button', 'onclick="document.location=document.location.href.substr(0,document.location.href.indexOf(\'&richarea=\'))"', '', '', '', '', '', '', '', '');
    }else{
        html_input('button', '', '', 'Word Editor', '', 'button', 'onclick="document.location=document.location + \'&richarea=\'"', '', '', '', '', '', '', '', '');
html_input('button', 'strong', '', 'B', '', 'button', 'onclick="tag(\'strong\')"', '', '', '', '', '', '', '', '');
html_input('button', 'em', '', 'I', '', 'button', 'onclick="tag(\'em\')"', '', '', '', '', '', '', '', '');
html_input('button', 'strike', '', 'Strike', '', 'button', 'onclick="tag(\'strike\')"', '', '', '', '', '', '', '', '');
html_input('button', 'p', '', 'P', '', 'button', 'onclick="tag(\'p\')"', '', '', '', '', '', '', '', '');
html_input('button', 'br', '', 'BR', '', 'button', 'onclick="tag(\'br\')"', '', '', '', '', '', '', '', '');
html_input('button', 'break', '', 'Break', '', 'button', 'onclick="tag(\'break\')"', '', '', '', '', '', '', '', '');
html_input('button', 'img', '', 'Image', '', 'button', 'onclick="tag(\'img\')"', '', '', '', '', '', '', '', '');
html_input('button', 'link', '', 'Link', '', 'button', 'onclick="tag(\'link\')"', '', '', '', '', '', '', '', '');
html_input('button', 'include', '', 'Include', '', 'button', 'onclick="tag(\'include\')"', '', '', '', '', '', '', '', '');

    }
//ENDS FCK editor 1st Part
Any suggestions???
Logged
We can always learn from our failures, not so much from obvious success - C. Robinson (W. Disney). :)

dagda

  • Newbie
  • *
  • Karma: 0
  • Posts: 2
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #20 on: December 28, 2006, 07:35:29 AM »

Thanks Cesboa. FCKeditor and Snews are great together.
Logged

Vorsoron

  • Newbie
  • *
  • Karma: 0
  • Posts: 25
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #21 on: December 31, 2006, 03:39:52 PM »

I've used FCK but I still like TinyMCE better.  Maybe it's that javascript window enlarging... TinyMCE just seems to work better.
Logged

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #22 on: January 18, 2007, 12:18:06 PM »

Disable/Enable FCKeditor

Nothing special, only allows to choose FCK or not via js cookie (FCKeditor files in Root, of course)

around line 1150 find

Code: [Select]
... else {

html_input('text', 'seftitle', 'as', $frm_sef_title, ...
After insert:
Code: [Select]
// FCKeditor implementing start
if ($_COOKIE["fckeditor"]=="yes") {
// button Disable FCKeditor - added js function setcokie at bottom of this file too
echo '<input type="button" value="Disable FCKditor" onclick=\'setCookie("fckeditor", "no", new Date(new Date().getTime() + 99999999999));history.go(0)\' /> (All changes will be lost!)
';
// FCK Core start
include("FCKeditor/fckeditor.php");
       echo "<p>";
         $oFCKeditor = new FCKeditor('text') ;
         $oFCKeditor->BasePath = 'FCKeditor/';
         $oFCKeditor->Value = stripslashes($r['text']);
         $oFCKeditor->Create() ;
         echo "</p>";
         // FCK Core end
} else {
// button Allow FCKeditor - added js function setcokie at bottom of this file too
echo '<input type="button" value="Allow FCKeditor" onclick=\'setCookie("fckeditor", "yes", new Date(new Date().getTime() + 99999999999));history.go(0)\' /> (All changes will be lost!)
';
// old code start
and right after the old code
Code: [Select]
html_input('button', 'include', '', 'Include', '', 'button', 'onclick="tag(\'include\')"', '', '', '', '', '', '', '', '');

echo '</p>';
insert
Code: [Select]
} // added closing }
// FCK Implementing end
At the end of snews.php add js function setcookie (right before //]]> line)
Code: [Select]
// setcookie function for FCK editor
function setCookie(name, value, expires, path, domain, secure) {
     document.cookie= name + "=" + escape(value) +
       ((expires) ? "; expires=" + expires.toGMTString() : "") +
         ((path) ? "; path=" + path : "") +
         ((domain) ? "; domain=" + domain : "") +
         ((secure) ? "; secure" : "");
}
« Last Edit: February 21, 2009, 02:37:35 PM by Joost »
Logged
I like sNews!

spencermjax

  • Newbie
  • *
  • Karma: 0
  • Posts: 4
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #23 on: January 29, 2007, 03:39:15 AM »

I hate that this thread has been jumbled with FCK stuff. Is there a way to seperate them?

I have in stalled the TinyMCE as per the above instructions. everything is working just fine. However, I have a few "visual" problems (see image). Any thoughts?

Logged

mininovax

  • Newbie
  • *
  • Karma: 1
  • Posts: 44
    • http://www.ondapc.net
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #24 on: February 18, 2007, 01:27:57 AM »

Quote from: Zucye
The TinyMCe Editor works great, but it takes very long to load, the FCK is much faster...
Have you thought of using the GZIP compressed version of TINYMCE. I noticed about 8 seconds better download time.

I could not figure out FCK editor to work completely either. Sorry.
Logged

mininovax

  • Newbie
  • *
  • Karma: 1
  • Posts: 44
    • http://www.ondapc.net
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #25 on: February 18, 2007, 01:31:28 AM »

Quote from: spencermjax
I hate that this thread has been jumbled with FCK stuff. Is there a way to seperate them?

I have in stalled the TinyMCE as per the above instructions. everything is working just fine. However, I have a few "visual" problems (see image). Any thoughts?

http://southernjewelrynews.com/articles/tinymce_problem.gif
There seems to be a javascript error in your integration. This can be annoying.

First of the paths, you seem to have it correct, or else it would not have displayed.

Check your javascript code.

Sometimes it is easier to work backwards, so I would suggest you copy the entire contents of the examples that tinymce supplied with their distribution and use it instead of yours

Once you see that it is working, than start copying back your javascript menu stuff.

Remember the last line must not have a "comma" ...
Logged

edsil

  • Jr. Member
  • **
  • Karma: 5
  • Posts: 97
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #26 on: February 18, 2007, 11:55:11 AM »

Hi there!

Sorry guys I dont catch at all, the first release of this MOD was  using the sNews 1.5.26 RC

I was trying to apply the ZIP file sent by SEVIR using a sNews 1.5.30 Stable and it doesnt work (and even using 1.5.31).

I was looking in my old files and the earlest sNews version I have is 1.5.27 and it doesnt work.

I was trying to do it manually, and it doesnt work nor.

So my question is: theres is something to see if I use old versions (not 1.5.26 like used by Sevir) and/or recent versions (1.5.30 and/or 1.5.31)?

Anyway Thanks Sevir it seems a nice MOD
(a ver si una manito indulgente nos puede ayudar por aca en el foro, saludos!  ;) )
Logged

reanimator

  • Newbie
  • *
  • Karma: 0
  • Posts: 31
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #27 on: March 05, 2007, 04:30:19 PM »

anyone got it working in 1.5.31?
Logged

mattonik

  • Full Member
  • ***
  • Karma: 7
  • Posts: 123
    • http://www.mattonik.sk
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #28 on: March 08, 2007, 05:32:42 PM »

wow, great mods, byt can i ask, if there is somebody who knows how to implement this one: http://www.spaweditor.com/en/disp.php/en_products/en_spaw/en_spaw_intro
any help is welcome. thanks:)
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
[MOD] Toogle button: Simple Editor / TinyMCE Editor (sNews 1.5)
« Reply #29 on: March 08, 2007, 09:14:05 PM »

It does look interesting and has a lot of features, many of which are not well suited to sNews. I would not try to adapt it for sNews use.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU
Pages: 1 [2] 3