You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 38 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - How to disable the WYSIWYG HTML editor (tinyMCE) [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Prophet
Captain
Captain


Joined: Mar 14, 2004
Posts: 422

Location: Florida, USA, Earth, Space

PostPosted: Sat Dec 10, 2005 1:05 pm Reply with quoteBack to top

This seemed like a good place to begin this thread. Here is some info I posted in another forum regarding this topic ....

I made a simple script for tinyMCE which allows you to enable on/off toggle for certain pages.

This code is placed at the very top of includes/javascript.php. Insert the allowed admin ops or module names into the array where *** is.

Example - $pages_to_allow_toggle = array("topicsmanager","Forums","Journal","adminStory");

Code:
global $op, $name, $editor;

// assemble list of allowed ops or names
$pages_to_allow_toggle = array("***","***");

// check for allowed pages in op or name
foreach($pages_to_allow_toggle as $pages){

// check for editor variable and define no_editor if off
if(eregi("$pages",$op) || eregi("$pages",$name)){
if($editor=="off"){define("NO_EDITOR", "true");
}
}
}


You can call this from a link something like this for admin ...

Code:
<?php
global $editor;
if($editor=="off"){
echo "<a href='".$admin_file.".php?op=***YourOp***'>Enable WYSIWYG Editor</a>";
} else {
echo "<a href='".$admin_file.".php?op=***YourOp***&editor=off'>Disable WYSIWYG Editor</a>";
}
?>


Or for modules ...

Code:
<?php
global $editor;
if($editor=="off"){
echo "<a href='modules.php?name=***YourName***'>Enable WYSIWYG Editor</a>";
} else {
echo "<a href='modules.php?name=***YourName***&editor=off'>Disable WYSIWYG Editor</a>";
}
?>


Or simply...

Code:
<a href='modules.php?name=YourModule&editor=off'>Disable WYSIWYG Editor</a>


Note - You may have to set the global variable $editor in whatever pages you use the above php links in (global $editor;). I have already inserted it into the codes above, so you may not have to.

The above code only allows the user to toggle the editor if it is enabled by default.
The user cannot enable the editor from a page where it is not enabled by default.

Additionally, with a few minor alterations, you could make it so that tinyMCE is disabled by default except on the pages in your array.
Code:
if(!eregi("$pages",$op) || !eregi("$pages",$name)){
define("NO_EDITOR", "true");
}



To disable the editor altogether, simply add the following to your config or to the top of includes/javascript.php
Code:
define("NO_EDITOR", "true");


Very Happy

_________________
- Prophet
Get the Last Visit module (and others modules I designed) from my website! FREE! http://jasonlau.biz

http://DotCom.Name
Find all posts by ProphetView user's profileSend private messageVisit poster's websiteAIM Address
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12403


PostPosted: Sat Dec 10, 2005 1:11 pm Reply with quoteBack to top

There is a WYSIWYG editor tweak at http://www.nukeresources.com
It allows you to turn off the editor by module, using an On/off in your Modules admin panel

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
Prophet
Captain
Captain


Joined: Mar 14, 2004
Posts: 422

Location: Florida, USA, Earth, Space

PostPosted: Sat Dec 10, 2005 1:20 pm Reply with quoteBack to top

You can change the tinyMCE configuration (buttons, tag filters, etc.) in includes/javascript.php.
You can find reference material at the tinyMCE website at
http://tinymce.moxiecode.com/index.php

Note - PHP-Nuke uses an altered version of tinyMCE, so installing the latest version of tinyMCE on your PHP-Nuke site will probably cause errors.
Don't delete the old version and overwrite it with the new version.

_________________
- Prophet
Get the Last Visit module (and others modules I designed) from my website! FREE! http://jasonlau.biz

http://DotCom.Name
Find all posts by ProphetView user's profileSend private messageVisit poster's websiteAIM Address
njnightsky
Sergeant
Sergeant


Joined: Jun 04, 2004
Posts: 93


PostPosted: Thu Jan 19, 2006 4:57 am Reply with quoteBack to top

To remove from a module just add this to the module.

Code:
define('NO_EDITOR', 1);
Find all posts by njnightskyView user's profileSend private message
adrian18w
Nuke Cadet
Nuke Cadet


Joined: Jan 28, 2006
Posts: 4


PostPosted: Sun Jan 29, 2006 3:44 pm Reply with quoteBack to top

Btw, how do I install the WYSIWYG editor tweak? Do I need to overwrite the files that i have curently? Is there a manual way to install it? Thx.
Find all posts by adrian18wView user's profileSend private message
Mtwo
Nuke Cadet
Nuke Cadet


Joined: Nov 16, 2004
Posts: 8


PostPosted: Sat May 27, 2006 5:58 am Reply with quoteBack to top

Using PC-Nuke 7.9031 and both TinyMCE and SPAW strip tags from my valid HTML. Most annoying is the stripping of the <DIV> tag. <div align=center> becomes simply a div tag. All news postings that have centered elements use this and SPAW uses the <div> tag by default for centering. I have added "div"=>2 to my allowable html array, but still no success. What else can I do to allow <div align=center> tags?
Find all posts by MtwoView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.182 Seconds - 164 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::