Jump to content
Sign in to follow this  
Sputnik77

[Contribution] *TinyMCE WYSIWYG HTML EDITOR

Recommended Posts

TinyMCE WYSIWYG HTML Editor V1.0

 

*TinyMCE WYSIWYG EDITOR

 

This contribution is an extremly easy mod that turns any TEXTAREA into a full flegged WYSIWYG HTML EDITOR.

 

Best of all, its compatible with FireFox!!!!!!!!!!!!!!!!!!!!!!!!!

 

It uses the TinyMCE Editor by Moxycode.

 

None of the other HTML editors would work with FireFox. I use Firefox religiously and have seen a few requests in the forums for this mod so I set out to do it myself

 

This contrib can be used in product description, newsletters, emails or any other page in admin that uses a TEXTAREA field

 

The editor is fully configurable to include the features you want, or exclude the feature you will not use. Its also Themeable!!!!!

 

 

Pleas post any question you may have in this thread.

Share this post


Link to post
Share on other sites
FCK Editor should work with Firefox/Mozilla. Interesting contrib though, I might give it a try.

 

 

Yes, I it does "work" but I had limited success with it and have found no problems with TinyMCE yet.

Share this post


Link to post
Share on other sites

Perhaps instead of saying 'None of the other HTML editors would work with FireFox' you should have said 'I haven't been able to get any of the other HTML editors to work with FireFox.' ;)

 

 

 

[/hijack]

 

 

I'ld be tempted to try it but for two things that strike me initialy. I can't see a way of uploading images from your local machine to the server to use them in the text. Also is it possible for it to use <br> instead of <p>.....</p> - /slashes/ throw my version of easypopulate into a fit. Actualy after a second look at the demo's output there are a lot of slashes. I expect these are issues with TinyMCE though.

Share this post


Link to post
Share on other sites
Perhaps instead of saying 'None of the other HTML editors would work with FireFox' you should have said 'I haven't been able to get any of the other HTML editors to work with FireFox.' ;)

[/hijack]

I'ld be tempted to try it but for two things that strike me initialy. I can't see a way of uploading images from your local machine to the server to use them in the text. Also is it possible for it to use <br> instead of <p>.....</p> - /slashes/ throw my version of easypopulate into a fit. Actualy after a second look at the demo's output there are a lot of slashes. I expect these are issues with TinyMCE though.

 

Yes, your right I probably should have said that, but what I did say is still valid as it suggests just what you said.

 

I think the added slashes are an issue with Magic Quotes, not TinyMCE, but I could be wrong.

 

This is a common issue with the texareas anyway, especially if you go "back" to the page in the browser.

 

Look into the TinyMCE documentation to see if you can change <p> to <br>

 

Yes, anything that acts strange will be an issue with TinyMCE, not the actual contrib as it is basically self contained.

 

I cannot provide full support for TinyMCE as it is not my code. However this thread is intended to support the addition of it to your pages and TinyMCE's configuration within the pages.

 

I will help where I can though.

Share this post


Link to post
Share on other sites

Thank you for this great contribution..Quick and easy installation..

 

But I am not able to send html letters from it?

 

Is there some extra configuring to be done apart from what is explained in the downloaded instalation instructions

 

Thank you

Ian

Share this post


Link to post
Share on other sites
Yes, your right I probably should have said that, but what I did say is still valid as it suggests just what you said.

 

Well, if we're going to play pedant here, I could point out that what you said didn't sugest it at all but did imply that it was the only editor contrib that worked with Firefox. But I won't. :rolleyes:

 

 

I'll bear all the things you mentioned in mind if I use this contrib, and go and have a look at the developers home page.

Share this post


Link to post
Share on other sites
Well, if we're going to play pedant here, I could point out that what you said didn't sugest it at all but did imply that it was the only editor contrib that worked with Firefox. But I won't. :rolleyes:

I'll bear all the things you mentioned in mind if I use this contrib, and go and have a look at the developers home page.

 

 

Well, since YOU are playing pedant, I will play pedant and point out why you would be incorrect. :rolleyes:

 

In my statement I used the word "WOULD" not "WILL". In the context it was written it implies that I tried the others and they did not work for ME. It does not suggest that no other contribution will work. If the statement was made using the word "WILL" in place of "WOULD" , you "WOULD" be correct.

Share this post


Link to post
Share on other sites

I just followed the very simple instructions, yet I ran into trouble. Although this is my first time installing an extra feature, I'm not new to coding. I downloaded the tiny_mce folder into the admin folder. I also backed up the three files to modify...but when I modified them--by just copying and pasting the extra code--I got this error when trying to go to the admin catalog:

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /homepages/37/d158578319/htdocs/lab/catalog/admin/categories.php on line 1600

 

So, what am I missing? I verified that all of the quotes have endquotes. Does the one zip file have anything necessary besides the instructions? None of the example files work.

 

Thanks!

 

this is what I pasted, just before the </head>--straight from the installation file:

 

<script language="javascript" type="text/javascript" src="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN; ?>tiny_mce/tiny_mce.js"></script>

<script language="javascript" type="text/javascript">

tinyMCE.init({

mode : "textareas",

theme : "advanced",

plugins : "table,advhr,advimage,advlink,emotions,preview,flash,print,contextmenu",

theme_advanced_buttons1_add : "fontselect,fontsizeselect",

theme_advanced_buttons2_add : "separator,preview,separator,forecolor,backcolor",

theme_advanced_buttons2_add_before: "cut,copy,paste,separator",

theme_advanced_buttons3_add_before : "tablecontrols,separator",

theme_advanced_buttons3_add : "emotions,flash,advhr,separator,print",

theme_advanced_toolbar_location : "top",

theme_advanced_toolbar_align : "left",

theme_advanced_path_location : "bottom",

extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|v

space|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade

],font[face|size|color|style],span[class|align|style]",

external_link_list_url : "example_data/example_link_list.js",

external_image_list_url : "example_data/example_image_list.js",

flash_external_list_url : "example_data/example_flash_list.js"

});

</script>

Share this post


Link to post
Share on other sites
I just followed the very simple instructions, yet I ran into trouble. Although this is my first time installing an extra feature, I'm not new to coding. I downloaded the tiny_mce folder into the admin folder. I also backed up the three files to modify...but when I modified them--by just copying and pasting the extra code--I got this error when trying to go to the admin catalog:

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /homepages/37/d158578319/htdocs/lab/catalog/admin/categories.php on line 1600

 

So, what am I missing? I verified that all of the quotes have endquotes. Does the one zip file have anything necessary besides the instructions? None of the example files work.

 

Thanks!

 

this is what I pasted, just before the </head>--straight from the installation file:

 

<script language="javascript" type="text/javascript" src="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN; ?>tiny_mce/tiny_mce.js"></script>

<script language="javascript" type="text/javascript">

tinyMCE.init({

mode : "textareas",

theme : "advanced",

plugins : "table,advhr,advimage,advlink,emotions,preview,flash,print,contextmenu",

theme_advanced_buttons1_add : "fontselect,fontsizeselect",

theme_advanced_buttons2_add : "separator,preview,separator,forecolor,backcolor",

theme_advanced_buttons2_add_before: "cut,copy,paste,separator",

theme_advanced_buttons3_add_before : "tablecontrols,separator",

theme_advanced_buttons3_add : "emotions,flash,advhr,separator,print",

theme_advanced_toolbar_location : "top",

theme_advanced_toolbar_align : "left",

theme_advanced_path_location : "bottom",

extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|v

space|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade

],font[face|size|color|style],span[class|align|style]",

external_link_list_url : "example_data/example_link_list.js",

external_image_list_url : "example_data/example_image_list.js",

flash_external_list_url : "example_data/example_flash_list.js"

});

</script>

 

 

That error should not be related to the pasted code. Restore your backup and try again.

 

 

You are right, it is missing something for the examples to work.

 

***FIX***

 

Create a folder in the same directory as examples called "jscripts" and copy the tiny_mce folder into the "jscripts" folder. The examples will now work.

Share this post


Link to post
Share on other sites

Nice contrib! Simple setup instructions. You really shouldn't upload the tinyMCE app in the osC contribs though. You should just point to the Moxycode site so everyone can get the latest version themselves.

 

There are a couple other contributions that offer additional tips, tricks, and code to accompany tinyMCE. I like it better then FCKeditor. TinyMCE in Products desc Define Content

 

Yes, the one drawback is uploading images. Moxycode offers a "for pay" module to upload. An image upload form would be easy to add to the page surrounding the tinyMCE instance.

 

There are things tinyMCE will do that FCKeditor won't. One example is tinyMCE can be configured to use the osCommerce stylesheet as "easy picks" while editing the page. FCKeditor's "easy picks" must be configured into an XML file. tinyMCE can be setup to validate your code, FCKeditor doesn't do that. tinyMCE can be used to ignore PHP tags, FCKeditor may be able to do that, but I haven't found how. With tinyMCE, we can use a compressor script that will load tinyMCE faster then FCKeditor. tinyMCE can be pre-configured to provide a multi-directory list of images to pick while editing (like in Define Content contrib), with FCKeditor, we have to do a hands-on code change with every installation to make that part work. FCKeditor's package directory structure requires you to pick out documents and other garbage to limit your upload. With tinyMCE, the package structure isolates just the necessary scripts so you can just upload the core app. tinyMCE is also allows an easy config that will draw images from one directory and can be set to save your editing using another home directory structure. That's very useful in the case where your admin is not in the same root directory tree as the catalog. And lastly, tinyMCE has more options for picking specific textareas to switch. Oh yeah, did I mention tinyMCE can also be switched on and off convieniently with a javascrit switch? I think it's a top notch app!

 

Well that's my experience with the two editors

Edited by surfalot

Share this post


Link to post
Share on other sites
Thank you for this great contribution..Quick and easy installation..

 

But I am not able to send html letters from it?

 

Is there some extra configuring to be done apart from what is explained in the downloaded instalation instructions

 

Thank you

Ian

 

A default install of osCommerce is not set up to send HTML emails and newsletters.

 

To modify osCommerce to send HTML emails and newsletters, perform the following steps:

 

In admin/mail.php find

$mimemessage->add_text($message);

and change it to

$mimemessage->add_html($message);

 

In admin/includes/modules/newsletters/newsletter.php and admin/includes/modules/newsletters/product_notification.php find

$mimemessage->add_text($this->content);

and change it to

$mimemessage->add_html($this->content);


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites
A default install of osCommerce is not set up to send HTML emails and newsletters.

 

To modify osCommerce to send HTML emails and newsletters, perform the following steps:

 

In admin/mail.php find

$mimemessage->add_text($message);

and change it to

$mimemessage->add_html($message);

 

In admin/includes/modules/newsletters/newsletter.php and admin/includes/modules/newsletters/product_notification.php find

$mimemessage->add_text($this->content);

and change it to

$mimemessage->add_html($this->content);

 

 

Thanks DJ. I forgot to mention that. I will add that to the package, credit to you of course.

 

SufAlot

ABout adding Tiny_MCE to the package, I did that just so peeps could be on their way with just my download without grabbing anything else.

 

But yes, if any of you want to keep up with the lastest versions of TinyMCE. You can download it from their site and simply replace the tiny_mce folder with theirs. New versions MAY require the java script pasted in the head to be updated as well.

 

However the TinyMCE in the package is the latest version as of this post.

 

 

And thanks for pointing out all the nice things about TinyMCE.

Share this post


Link to post
Share on other sites
A default install of osCommerce is not set up to send HTML emails and newsletters.

 

To modify osCommerce to send HTML emails and newsletters, perform the following steps:

 

In admin/mail.php find

$mimemessage->add_text($message);

and change it to

$mimemessage->add_html($message);

 

In admin/includes/modules/newsletters/newsletter.php and admin/includes/modules/newsletters/product_notification.php find

$mimemessage->add_text($this->content);

and change it to

$mimemessage->add_html($this->content);

 

Thanks..thats better...

The mail is going html now ok, but I still am unable to see the finished letter before pushing 'Send Mail' in /admin/mail.php?action=preview

 

also..how is this contribution in sending to 1,000 plus subscribers?

your help is appreciated

Ian

Share this post


Link to post
Share on other sites
Thanks..thats better...

The mail is going html now ok, but I still am unable to see the finished letter before pushing 'Send Mail' in /admin/mail.php?action=preview

 

also..how is this contribution in sending to 1,000 plus subscribers?

your help is appreciated

Ian

 

The fact that you want to send to 1000 plus subscribers will not rely on this contrib.

 

It would rely on the email system which I do not really know about.

 

It should work just the same as if they were plain text.

Share this post


Link to post
Share on other sites

Take a look at these:

 

TinyFCK

 

and

 

TinyMCPUK

 

I have installed both, but still has some minor adjustments to make them run perfectly. Maybe someone else would give it a try and we could manage to put a installation guide together?

 

Vidar

Edited by kortshop

Share this post


Link to post
Share on other sites
Thanks..thats better...

The mail is going html now ok, but I still am unable to see the finished letter before pushing 'Send Mail' in /admin/mail.php?action=preview

 

also..how is this contribution in sending to 1,000 plus subscribers?

your help is appreciated

Ian

 

In admin/mail.php find

<?php echo nl2br(htmlspecialchars(stripslashes($HTTP_POST_VARS['message']))); ?>

and change it to

<?php echo stripslashes($HTTP_POST_VARS['message']); ?>

 

That will take care of the preview.

 

For the 1,000 plus subscribers, as Eric said that's the osCommerce email system itself (outside the scope of this contribution).


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites

For those of you sending out emails on a regular basis, you may find you want to send HTML emails sometimes and text emails other times.

 

This contribution gives you that option:

http://www.oscommerce.com/community/contributions,2859/

 

Looks like a pretty easy install.


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites

hello.

 

I've added this contribution and to "Extra Pages w/ admin" too. But in this last one I'm receiving this error:

Error: Page title required.

 

I have 3 languages... so I receive 3 errors with the same thing.

 

Is something wrong with php in extra_info_pages.php?

<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "table,advhr,advimage,advlink,emotions,preview,flash,print,contextmenu",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,preview,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,flash,advhr,separator,print",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|on
mouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
external_link_list_url : "example_data/example_link_list.js",
external_image_list_url : "example_data/example_image_list.js",
flash_external_list_url : "example_data/example_flash_list.js"
});
</script>

 

and...

 

<?
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>

	  <tr>
	   <td valign="top" class="main"><br>
<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']). ' '.tep_draw_textarea_field('pages_html_text_'.$languages[$i]['id'],'100','100', $pages_html_text[$languages[$i]['id']]); ?>
</td>
</tr>

<?
}
?>

 

Thank you in advance.

Share this post


Link to post
Share on other sites
hello.

 

I've added this contribution and to "Extra Pages w/ admin" too. But in this last one I'm receiving this error:

Error: Page title required.

 

I have 3 languages... so I receive 3 errors with the same thing.

 

Is something wrong with php in extra_info_pages.php?

 

 

and...

 

 

 

Thank you in advance.

Is register_globals set to ON or OFF ?

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites
OFF

 

Try this: in admin/extra_info_pages.php find

if (empty($$title_field_name)) {
	  $messageStack->add(ERROR_PAGE_TITLE_REQUIRED, 'error');

and change it to

if (empty($_POST['title_field_name'])) {
	  $messageStack->add(ERROR_PAGE_TITLE_REQUIRED, 'error');


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites

Hi... Did not worked... still appearing the error message "Error: Page title required." Any other help here?

 

Thank you for your help djmonkey1

Share this post


Link to post
Share on other sites
Hi... Did not worked... still appearing the error message "Error: Page title required." Any other help here?

 

Thank you for your help djmonkey1

 

Try

if (empty($_POST[$title_field_name])) {
	  $messageStack->add(ERROR_PAGE_TITLE_REQUIRED, 'error');

instead.


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites

Hi! Thank you... this has solve the error message but it is not working correctly because no data is saved: no title and no description in the page. Only the order is saved. In frontpage it shows nothing in infobox too.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×