Username:
Password:
Search for Plugins: Advanced
Please Sign in, Register or Resend Activation Email

Forums

  e107 Coders.org :: Forums :: E107 Plugins :: Code Bank
 
<< Previous thread | Next thread >>  
(The best) e107 Preferences & Settings:     Go to page       >>        
Author Post
Butcher.
Thu Mar 29 2007, 06:59PM

Registered Member #76943
Joined: Fri Mar 23 2007, 12:57PM
Location: Virtual Reality
Posts: 118
Website
1. Regarding e107 Preferences: Shouldn't cache & gzip of output always be enabled? So why is the opposite default?
2. The editor as default doesn't comprehend a simple copy from a normal html document: is it liza on the team - who ever that is -, that decided it must not allow <p>? So every little boyscout need to add <br> all over their old documents to slip them pass their strange thing...
3. And soon people feel like peeing, when they can't do some modern code with the default editor, because "u must not speak unpolite at the table"!
4. ..

So here's the puzzle:
1. Start with downloading the new tinyMCE from [link]
2. find therin the plugins missing in the same directory on your website's e107_filehandlers/tinymce/plugins because we'll need these plugins to add those missing buttons ...
3. Next we'll have to decide the settings for tinyMCE and implement the full rule set as valid_elements: [link]
But there are 2 php files from e107 team in the tiny_mce directory which implement this rule set, have any one tested the difference just for fun?
4. The missing Buttons ... later!
bugrain
Thu Mar 29 2007, 08:03PM

Registered Member #22953
Joined: Fri Mar 25 2005, 11:21AM
Location:
Posts: 1031
1. No, some sites don't support gzip (AFAIK) and I prefer cache to be off for my sites. Only my opinion, though.

2. If you mean Lisa (not liza) on the dev team then I think you have the wrong person. He's never checked in the wysiwyg.php file, which is the file that configures TinyMCE in e107.

3 There are two PHP files, but only wysiwyg.php will do the initialization as far as I can tell. The other is used for gzipped file serving but the init is repeated by the values in wysiwyg.php - but check with mygoogie at e107.org forums
Back to top
Butcher.
Thu Mar 29 2007, 10:08PM

Registered Member #76943
Joined: Fri Mar 23 2007, 12:57PM
Location: Virtual Reality
Posts: 118
I have searched after mygoogie at e107.org forums and other categories, I don't find the pro anywhere.

1. Cache
2. Gzip
3. WYSIWYG
4. tinyMCE buttons
5. tinyMCE valid_elements
6. security setting?
7. ...


1-2. If php code can request server type (apache) and more, why can't e107 cms adjust the best cache & gzip option by itself? I know what their function are in theory, but I haven't found any practical test results anywhere. I would assume, that with large unziped text files, setting gzip on would mean a lot. And I can't think of any situation: where it would hurt? Neither do I know what happen when a server doesn't support cache. Perhaps cache enabled is bad with random content on a page, but who knows without some test results? I guess a server administration must be able to test it. Like bugrain I also only got an opinion.

3. WYSIWYG on/off should not at all be an option in e107 preferences. There should instead be options to desellect spellchecker button and others, and also security options like autoclean on (no clean button then) or off (with a clean button then). But even if I find e107 better than all the others joomla, yacs, php-nuke ... that use php & mysql, it's not my call.

4. tinyMCE button possiblities. I want it all! I want it all! And I want it now!! Default should at least be:
bold italic underline strikethrough justifyleft justifycenter justifyright justifyfull bullist numlist outdent indent
cut copy paste <- not nessecary! (since u can cut, copy & past with ctrl + x, c or v)
undo redo link unlink image cleanup
help <- for what???
code hr removeformat formatselect fontselect fontsizeselect
styleselect <- isn't style bold, italic ... a duplication of buttons?
sub sup forecolor backcolor
forecolorpicker backcolorpicker <- not nessecary!
charmap
visualaid <- I haven't tried this.
anchor
newdocument

Okay to get these default - should have been - features do this:
4.1 Download tinymce_2_1_0.zip
4.2 Find therein the plugin directory and upload all - especially those missing - to your e107_handlers/tiny_mce/plugins/ directory. Notice how the emotions plugin defer from emoticons (because more users obviously have problems with missing emotions in editors.) Personally I find emotions unnessecary, since inserting an image is a better option!
4.3 Edit the file wysiwyg.php in your e107_handlers/tiny_mce directory to change buttons to show.
find:

$text .= ",theme_advanced_buttons1 : 'fontsizeselect,separator,bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent, indent,separator, forecolor,cut,copy,paste'";

$text .= ",theme_advanced_buttons2 : 'tablecontrols,separator,undo,redo,separator,link,unlink";
$text .= ($pref['smiley_activate']) ? ",emoticons" : "";
$text .= ",charmap,iespell,media";
$text .= (ADMIN) ? ",ibrowser," : ",image";
$text .= (ADMIN) ? ",code" : "";
$text .= "'"; // end of buttons 2

$text .= ",theme_advanced_buttons3 : ''";


and change it to:


$text .= ",theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,sub,sup,separator,forecolor,backcolor'";

$text .= ",theme_advanced_buttons2 : 'tablecontrols,separator,link,unlink,anchor,separator";
$text .= ($pref['smiley_activate']) ? ",emoticons" : "";
$text .= ",charmap,media";
$text .= (ADMIN) ? ",ibrowser," : ",image";
$text .= "'"; // end of buttons 2

$text .= ",theme_advanced_buttons3 : 'formatselect,fontselect,fontsizeselect,separator";
$text .= (ADMIN) ? ",code,cleanup" : "";
$text .= ",removeformat,hr,separator,undo,redo'"; // end of buttons 3


Take a look at the new editor buttons now on your website...

5-7. later....
Back to top
Website
Butcher.
Thu Mar 29 2007, 11:00PM

Registered Member #76943
Joined: Fri Mar 23 2007, 12:57PM
Location: Virtual Reality
Posts: 118
5. tinyMCE valid_elements
6. security setting?
7. ...


5. Now to get a normal editor, we must puzzle along with the tinyMCE rule set used to cleanup code. Shortly said we want to implement the Full XHTML rule set!

5.1 Edit again the file wysiwyg.php in your e107_handlers/tiny_mce directory

find this line...
$text .= ",invalid_elements: 'p,font,align,script,applet,iframe'\n";
Do we want it? NO! Why? Cause u can't copy a simply doc.html into an editor, that won't accept <p> without trouble! So..

$text .= ",auto_cleanup_word: true\n"; <- set it false, cause we use a cleanup button and a large/complete rule set.

$text .= ",convert_fonts_to_spans : true\n"; <- Are we talking esperanto now? Set it false!
$text .= ",trim_span_elements: true\n";
$text .= ",inline_styles: true\n"; <- ??
$text .= ",debug: false\n";
$text .= ",force_br_newlines: true\n";
$text .= ",force_p_newlines: false\n";
$text .= ",entity_encoding: \"raw\" \n"; <- ??
$text .= ",convert_fonts_to_styles: true\n"; <- set it to false, cause we like what we already know.

Here it is again in full to copy:

$text .= ",invalid_elements: ''\n";
$text .= ",auto_cleanup_word: false\n";
$text .= ",convert_fonts_to_spans : false\n";
$text .= ",trim_span_elements: true\n";
$text .= ",inline_styles: true\n";
$text .= ",debug: false\n";
$text .= ",force_br_newlines: true\n";
$text .= ",force_p_newlines: false\n";
$text .= ",entity_encoding: \"raw\" \n";
$text .= ",convert_fonts_to_styles: false\n";


BUT we still need to implement the full XHTML rule set and according to the manual: [link] it should be in the line:
tinyMCE.init({
...
valid_elements : "a[href|target=_blank],strong/b,div[align],br"
});


But where is it? the var valid_elements are both in the files: tiny_mce_src.js & tiny_mce.js and with even more settings but not like described in manual.
Back to top
Website
bugrain
Thu Mar 29 2007, 11:11PM

Registered Member #22953
Joined: Fri Mar 25 2005, 11:21AM
Location:
Posts: 1031
mygoogie at e107.org - not sure how you failed to find him or any of his posts on TinyMCE - they are mostly very recent.

So server type determines if gzip is available? Depends how you check - Apache 2 does not support it in the same way as earlier versions. Mostly, how this is done is beyond my knowledge, I've never needed to do it but could probably look it up for Apache. How many other servers must I look it up for? Plus, it has been know to cause problems with certain server/browser/page combinations. So best left off by default IMO.

Also, gzipping large text files might be beneficial, but gzipping small text files (and unzipping on client) may not - who decides? Probably only the admin can for any site if they really want to fine tune things. Again, e107 provides the capability but requires some input from the site admin.

The e107 cache is not a server issue, it's an e107 cache. There are pros and cons for having it on and it has to be coded in to each page/plugin/section/etc. for it to work. If pages change may degregade performance. Again, I think this is a nice feature in the right circumstances but there is no definite answer to defaulting it on or off.

As for the TinyMCE stuff - sounds like you've done a fair amount of work on this. As per a different thread here, please talk to mygoogie about this. You are both doing similar stuff AFAICS and you should be able to help each other.
Back to top
Butcher.
Fri Mar 30 2007, 04:34AM

Registered Member #76943
Joined: Fri Mar 23 2007, 12:57PM
Location: Virtual Reality
Posts: 118
:) Oh bugrain, there's a tiny bug in your posting: it's the name mygoogie, look :> [link]
Back to top
Website
bugrain
Fri Mar 30 2007, 05:53AM

Registered Member #22953
Joined: Fri Mar 25 2005, 11:21AM
Location:
Posts: 1031
hehe, sorry about that - had always been reading it wrong too. At least you found him/her.
Back to top
Butcher.
Fri Mar 30 2007, 06:37AM

Registered Member #76943
Joined: Fri Mar 23 2007, 12:57PM
Location: Virtual Reality
Posts: 118
Okay, we will now implement the full XHTML rule.
The tinyMCE rule set is defined in the file: 'tiny_mce_src.js'
The other file 'tiny_mce.js' is a trimmed copy of 'tiny_mce_src.js'. And if u download the tinyMCE development zip u will find the lines:

<!-- Trim core script use default mode from root element -->
<trim src="jscripts/tiny_mce/tiny_mce_src.js" dest="jscripts/tiny_mce/tiny_mce.js" />


in the config. I guess the purpose with the development tools just are to trim all the scripts. So make our changes to the 'tiny_mce.js' since the other one is just a dummy for viewing.

5.2 Open the file 'tiny_mce_src.js' and find this:

_setupRules : function() {
var s = this.settings;

// Setup default rule
if (!this.rulesDone) {
this.addRuleStr(s.valid_elements);
this.addRuleStr(s.extended_valid_elements);
this.addChildRemoveRuleStr(s.valid_child_elements);

this.rulesDone = true;
}
},


This function setup the default rule of valid_elements in tinyMCE. We must therefore change the constant for valid_elements to get the full rule set.
Now find the line:

this._def("valid_elements", "+a[id|style|rel|rev|cha

It's very long and we must change the content with the full specified in the manual: [link]

Be SURE not to corrupt signs at start and end. And make your changes in 'tiny_mce_src.js' first. Then 'tiny_mce.js' either by trimming or manually. Or perhaps just by deleting the trimming crap and renaming 'tiny_mce_src.js' to 'tiny_mce.js'.

5.3 If u need to allow further elements: modify the string extended_valid_elements. But rememeber: there should not be any code cleanup unless we press that button...
So find this line:
this._def("cleanup", true);
and set it false!

5.4 U may also want to change its:
// Force strict loading mode to false on non Gecko browsers
at this line:
this._def("browsers", "msie,safari,gecko,opera", true);

OKAY! Test your new configuration! I got a random picture working on mine with some java script! And the Editor doesn't remove that code with cleanup. I can also copy a normal html page into it without missing any <p>. My emotions doesn't work proberly. But shouldn't images be enough? Boys! !amazed
Back to top
Website
Butcher.
Fri Mar 30 2007, 07:19AM

Registered Member #76943
Joined: Fri Mar 23 2007, 12:57PM
Location: Virtual Reality
Posts: 118
6. security setting?
7. ...


6. So is there any security risk in a full featured editor? !amazed
Well since there's hardly any visitors on my websites, I don't think so! But if the e107 coders want a more simple editor also or different configurations for different users, they can just implement it. Everything is possible.

e107 preferences - security & protection: Enable SSL ? Is it a better connection or what?

I would definitely favour more protection features like identification control by fingerprint, camarascan & soundcontrol - even just for some anonymously posting: profanity is destroying our kids! And alquada terror cells are everywhere! !amazed

On the other hand usually everyone always check their emails, so why not make a direct link into e107 admin from an email link. No username or password (cause u already did that to open your emailposts): just press the link and you're in!

I can't either see a reason to keep both flood protection and Image-code verification enabled in e107 preferences, I guess that with flood protection nothing more is nessecary!

On the other hand most of us got nothing more to do daily than saying hello and bye - doing login and -out! We are comfortable with it! It's a secure procedure! And people need security and problems with it to discuss! Who knows u might even get a hot date, and isn't that what it's all about! !amazed
Back to top
Website
Butcher.
Fri Mar 30 2007, 08:31AM

Registered Member #76943
Joined: Fri Mar 23 2007, 12:57PM
Location: Virtual Reality
Posts: 118
:? Find 5 errors:

Look at this text from above:

$text .= ",invalid_elements: 'p,font,align,script,applet,iframe'\n";
Do we want it? NO! Why? Cause u can't copy a simply doc.html into an editor, that won't accept <p> without trouble! So..

$text .= ",auto_cleanup_word: true\n"; <- set it false, cause we use a cleanup button and a large/complete rule set.

$text .= ",convert_fonts_to_spans : true\n"; <- Are we talking esperanto now? Set it false!
$text .= ",trim_span_elements: true\n";


and compare with this copy of it into the tinyMCE and after 1 update there:

$text .= ",invalid_elements: 'p,font,align,script,applet,if rame'n";
Do we want it? NO! Why? Cause u can't copy a simply doc.html into an editor, that won't accept

without trouble! So..

$text .= ",auto_cleanup_word: truen"; <- set it false, cause we use a cleanup button and a large/complete rule set.

$text .= ",convert_fonts_to_spans : truen"; <- Are we talking esperanto now? Set it false!
$text .= ",trim_span_elements: truen";


What? !amazed
Back to top
Website
Go to page       >>   

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System
Render time: 0.2695 sec, 0.1672 of that for queries. DB queries: 45.