1

Topic: Replace that bored and tired looking NiceEdit

Tired of the 'NiceEdit' that ships with vldPersonals?

I much prefer TinyMCE, and fortunately, changing from NiceEdit (not so nice I think) to TinyMCE is very easy.

Below: NiceEdit
http://www.fatlizard.com.au/uploads/vld/nice.edit.jpg

Below: TinyMCE
http://www.fatlizard.com.au/uploads/vld/tiny.mce.jpg

Apart from familiarity, it offers more options and functionality, and functions (I believe personally) in a better way than NiceEdit.

Want to give it a try?

First, download the jQuery version of TinyMCE.
Rather than trying to find your way around the TinyMCE download area, to make it easier, you can get it here.

Unpack this archive, into your root/includes directory, so it's installed as follows:
public_html/includes/tiny_mce
(there will be further subdirectories under the tiny_mce directory, but they don't need our attention.)

Now, open the file /includes/templates/header.tpl
Around line 15, find and DELETE the entry
<script type="text/javascript" src="{virtual_path}includes/js/nicedit.js"></script>
That's right, delete it, erase it, cast it into cyber space.

Now, still in /includes/templates/header.tpl paste the following, just about where you deleted the other line.

<script type="text/javascript" src="{virtual_path}includes/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
    mode : "textareas",
    plugins : "inlinepopups",
    dialog_type : "modal",
    theme : "advanced",
    theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",    
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true
});
</script>

You can now save and close /includes/templates/header.tpl

Now, all you need to do is modify two template files:
/includes/templates/pages_edit.tpl
and
/includes/templates/news_edit.tpl

(  if you have my vldArticles mod, then you would also have to change
/includes/templates/articles_edit.tpl  )

Towards the bottom of the files you will find an entry such as this:

<script type="text/javascript">
    $(document).ready(function(){
        new nicEditor({
            iconsPath: '{virtual_path}includes/js/nicicons.gif',
            buttonList: 
        }).panelInstance('field_body');
    });
</script>

Delete this entire selection, close and save your files, and voila, you should now have a much better textarea editor than NiceEdit.

Cheers

Last edited by fatlizard (2009-12-14 01:14:06)

2

Re: Replace that bored and tired looking NiceEdit

is this supported by VLD ?
i mean will al tinyMCE will work 100% all features with VLD ?

3

Re: Replace that bored and tired looking NiceEdit

Yes it will.

Developer

4

Re: Replace that bored and tired looking NiceEdit

Hello jwysocki73, and others,

VLD may choose to replace NiceEdit with something else, whatever that may be, or leave it as is.

It's presented as something to try for those who want it, and like any user mod., it's up to the individual to choose to try it or not.
I personally prefer TinyMCE, but others may not like it at all, and prefer to use the existing NiceEdit.

I find it a more mature product.

To illustrate, I have some screen shots showing what options I get when I want to insert a link.

First with vld2.5.5 NiceEdit
http://www.fatlizard.com.au/uploads/vld/nice.edit.link01.jpg


Next with TinyMCE
http://www.fatlizard.com.au/uploads/vld/tiny.mce.link01.jpg



TinyMCE can be used as a plugin for any html textarea field, as simply as it's presented.

Unless there are conflicting configurations, such as the existing NiceEdit, which also hooks into textarea, and hence needs to be removed, I don't see any immediate issues, other than it won't appear in future releases of vldPersonals, and would need to be done manually by the user who wanted it.

There used to be another html textarea addon called HTMLArea.
Whilst it's still occasionally found, it's no longer actively developed, having been replaced by something called 'xinha'.
In this context I could see little future in using HTMLArea, but xinha is also very large and bloated, and as such I believe unsuited for vldP use.

Having used TinyMCE in another application, it felt like downgrading when using NiceEdit.

Of particular annoyance was the color change, which NiceEdit produces as rgb(nn, nn, nn) values, whilst TinyMCE produces hexidecimal #nnnnnn values.
This makes it very convenient and seamless when using a more advanced CSS editor, which use hex values.

Again, let me show you the differences using screen shots.

Color choice with NiceEdit
http://www.fatlizard.com.au/uploads/vld/nice.edit.color.jpg

Color choice with TinyMCE
http://www.fatlizard.com.au/uploads/vld/tiny.mce.color.jpg


Perhaps NiceEdit can be configured to do this as well, but if I'm going to tweak the html textarea element, then I may as well use what I prefer.

What this little hack/mod. does not do, is use TinyMCE in the member's blog area, although this presents little problem, and there is no NiceEdit there anyway.

It would be very hard to 'break' your vldP installation by trying TinyMCE, and it involves minimal editing.
Alternatively, TinyMCE have some demos at http://tinymce.moxiecode.com/examples/full.php

Whilst preparing this lengthy reply, I've just noticed a reply from vlad regarding one of your questions.

My apologies to any who find this a rambling mess, but I also hope it presents a balanced answer.

Regards,

Last edited by fatlizard (2009-12-14 10:43:16)

5

Re: Replace that bored and tired looking NiceEdit

fatlizard, thanks a lot for this tutorial. I really missed this possibility. I am using this editor on joomla sites, but now it is great to have it with vld as well.
makes things much easier

6

Re: Replace that bored and tired looking NiceEdit

first problem after changing it
when i try to send a message using the communicate link in CP
it doesent loads the messages body at all

7

Re: Replace that bored and tired looking NiceEdit

Hello,

When I go to communicate it loads fine (image attached)

Trying viewing the page source to make sure it's loading the javascript in the <head></head>

You should see

<script type="text/javascript" src="[your_path_information]/includes/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
    mode : "textareas",
  plugins : "inlinepopups",
  dialog_type : "modal",
    theme : "advanced",
    theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",    
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true
});
</script>

http://www.fatlizard.com.au/uploads/vld/communicate.jpg

8

Re: Replace that bored and tired looking NiceEdit

no i think you missunderstood me
i can get to the compose message page
then i select Load template dropdown to add one of the text body that its stored as template
i pick my template and the text doesent gets added to the message field

9

Re: Replace that bored and tired looking NiceEdit

I got the same problem. you can not use templates any more. it does not load

10

Re: Replace that bored and tired looking NiceEdit

Hello socki,

Yes I see what you mean now.

Not sure what's going on, but will look into it and see if I can find out.

11

Re: Replace that bored and tired looking NiceEdit

[solved]

Ok, what needs to be done is simply edit the javascript in newsletters_message.tpl

Old

    if ( id ) {
        document.getElementById('message_subject').value = templates[id][0];
        document.getElementById('message_body').value = templates[id][1];
    }

New

    if ( id > 0 ) {
        document.getElementById('message_subject').value = templates[id][0];
        tinyMCE.get('message_body').setContent(templates[id][1]);
    }
    else
    {
      document.getElementById('message_subject').value = '';
      tinyMCE.get('message_body').setContent('');
    }

tinyMCE.get('message_body').setContent(templates[id][1]) sets the text inside TinyMCE.


Also, when selecting 'None' for thetemplate, there was nothing happening, so I added the other stuff (id > 0) etc so the title and textarea get cleared.

If there are other areas in vldPersonals where loading text into the TinyMCE is an issue, I would expect/hope this is all that is needed in those templates as well.

Last edited by fatlizard (2009-12-19 23:20:44)

12

Re: Replace that bored and tired looking NiceEdit

another issue i just noticed
i replaced the editor with tinyMCE
i go to settings/email templates
load an email template and there is an image in my template
now it sais: ../images/logo.gif for example
i change it to: www.site.com/images/logo.gif
and click submit
it shows that the changes have been changed but in fact it doesent changes them
looked in the database to be sure but no changes are saved

13

Re: Replace that bored and tired looking NiceEdit

Another problem! Damn it!
I'll see if I can find out what's going on.

14

Re: Replace that bored and tired looking NiceEdit

I just tried this on localhost

I went to settings|email templates and chose 'Activation details'

I inserted an image from the /media/uploads directory and it saves and displays fine.

I do see a problem, however, when I view the database record:
It show the images source as
<img src="../media/uploads/yada.jpg" alt="Image Test" width="100" height="100" />
This will show in any email message, as it doesn't have the server address - it should save as
<img src="http://server_address/media/uploads/yada.jpg" .....>
to be viewed in the recipients email client

Don't know if there's a workaround for this or not - will try and find out.

15

Re: Replace that bored and tired looking NiceEdit

Solution.

Open your /includes/templates/header.tpl and find the TinyMCE init code

tinyMCE.init({
:: // other stuff in here
:: // other stuff in here

        theme_advanced_resizing : true
});

and add one more line, at the bottom, so it becomes

tinyMCE.init({
:: // other stuff in here
:: // other stuff in here
        theme_advanced_resizing : true,
        convert_urls : false
});

Don't forget the trailing comma after the preceding line.
theme_advanced_resizing : true,

When adding images via TinyMCE, add the complete URL of your image, eg.,
http://mydomain.com/templates/template_name/media/image_name.jpg

Doing this I have images saved and displaying correctly.

16

Re: Replace that bored and tired looking NiceEdit

Now it would be wonderfull if I could integrate a simple version of this in to the blog and comments fields :-/
I really think this is very much needed in VLD !

17

Re: Replace that bored and tired looking NiceEdit

http://www.webbsupport.eu/image/thumb_up.gif
we need it ... our members need it ... hope someone can help us ...

Give the world the best you have, and the best will come to you.
Tutorials and Mods for VldPersonals   Swedish Dating on Love2u.se   VldCrowd:s Community

18

Re: Replace that bored and tired looking NiceEdit

Hello,

I have VLD 2.5.6 and I don't find this:''<script type="text/javascript" src="{virtual_path}includes/js/nicedit.js"></script>''
in the file /includes/templates/header.tpl


Why ?

19

Re: Replace that bored and tired looking NiceEdit

<script type="text/javascript" src="{virtual_path}includes/js/nicedit.js"></script>

It is line 14 in my header.tpl file.

20

Re: Replace that bored and tired looking NiceEdit

It is not in your look and feel template, but the system template.

The file is /includes/templates/header.tpl

21

Re: Replace that bored and tired looking NiceEdit

An other problem:
If you send a HTML newsletter message (or template) via private messaging, the message is completely HTML encoded.
How to set the PM messages to show HTMl?

22

Re: Replace that bored and tired looking NiceEdit

This tutorial is great and works without issues for the CP functions.  Can someone advise how to use this editor for the member blogs and send message feature for sending mail to other members.

THis will be a nice improvement.

THanks,

23

Re: Replace that bored and tired looking NiceEdit

I have just noticed that i do not have such editor for Email at all,there is no toolbar above text area!
Do you have to install it to have it for emails?

24

Re: Replace that bored and tired looking NiceEdit

Hello

I tried this and am experiencing problems viewing the Editors control icons.

The issue was there with the original editor.

Any idea what may have cause this?

w

25

Re: Replace that bored and tired looking NiceEdit

The icons should be included in the TniyMCE download.

It definitely needs adding to comments and blogs, and I support that wish myself.
Unfortunately I have very little time to answer questions at this time, however TinyHTML has an good presence on the web, with very extensive documentation.

My "to do" list is growing by the day, due to new things I want, plus there have been months of delays due to personal reasons.

I will be looking at this when time permits.