Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] TinyMCE Anywhere


Guest

Recommended Posts

You are including twice the same file: admin/includes/functions/compatibility.php . This file should be included only from application_top.php, so try to find where else you are making an include of this file.

 

- Chris

Link to comment
Share on other sites

  • Replies 163
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 weeks later...

Hi Chris and others,

 

I need to install TinyMCE + iBrowser for Article Manager. TinyMCE works just fine, but I can upload no image, since in the insert/edit image pop-up there is no image upload button. Am I missing a configuration or something ?

 

Any help would be GREATLY appreciated,

 

newrenderzone

Link to comment
Share on other sites

  • 2 weeks later...

Hello everyone!

 

I have a question:

 

I installed TinyMCE, now I can edit text... BUT - how can I secure my correction. I mean when someone open page password from OSC admin panel apperars. When he click "Cancel" tinyMCE text appears and button "Save".

What I should do in this case?

 

I'm not experience in scripting...

 

Please suggest!

Link to comment
Share on other sites

I'm not sure to understand your problem. On which page are you editing your text? categories.php, newsletter.php, email.php? Do you mean that everybody can access your admin? By default all persons having access to your admin can do everything you can do. You have to secure the access of your admin using htpasswd/htaccess.

 

- Chris

Link to comment
Share on other sites

The following packages have to be downloaded:

- 1 feb 2007, full package

- 17 apr 2007, update for mail and newsletter

- 9 may 2007, image init file update

- 17 sep 2007, iBrowser updates

Link to comment
Share on other sites

I'm not sure to understand your problem. On which page are you editing your text? categories.php, newsletter.php, email.php? Do you mean that everybody can access your admin? By default all persons having access to your admin can do everything you can do. You have to secure the access of your admin using htpasswd/htaccess.

 

- Chris

 

 

Chris,

 

I created partners.php file and put there TinyMCE code - so I can work with html in this file. BUT when user wants to see "Our partners" he transferd to partners.php and he is asked for password. If he is not admin he can only read, but at the bottom of these box there is a button "Save", and clicking on it you'll be redirect to tinyMCE site. If user is a admin - he can make correction on pages with TinyMCE.

 

Just in case my web-site: www.motozap4asti.ru

 

What is htpasswd/htaccess?

 

Thanks in advance!

Link to comment
Share on other sites

Your file partners.php is in catalog and is not supposed to use tinyMCE!

 

It should be done like this:

on the admin side, you should have a page to edit text where you put partners names, logo and whatever text. This page uses tinyMCE and only admin can edit it. You have to place a "save" button there and when pressing it, you save the text in a file or in database.

Then, from catalog/partners.php, you only read the text from file or database and display it.

 

If you want that your partners edit the page themselves, that's another story. Is it what you want?

 

Regards from Russia,

 

- Chris

Link to comment
Share on other sites

Your file partners.php is in catalog and is not supposed to use tinyMCE!

 

It should be done like this:

on the admin side, you should have a page to edit text where you put partners names, logo and whatever text. This page uses tinyMCE and only admin can edit it. You have to place a "save" button there and when pressing it, you save the text in a file or in database.

Then, from catalog/partners.php, you only read the text from file or database and display it.

 

If you want that your partners edit the page themselves, that's another story. Is it what you want?

 

Regards from Russia,

 

- Chris

Chris!

 

You are abcolutely right - your explanation is what I really need! But in admin panel there is no Partners page...

Can you suggest me how to make everythin working?

 

Regards from Russia ;-)

Link to comment
Share on other sites

So you have to create this admin/partners.php page yourself.

 

The first step is to create a page with a form, a textarea within the form and a save button.

The second step is to add tinyMCE code in the <head> section to turn the textarea into a tinyMCE editor.

The third step is to save the text somewhere when the save button is pressed.

The fourth step is to display this saved text on a page on the catalog side.

 

I have not done it, so I can't give any code for that. There is a contribution to edit the main page text, maybe it can be used as an example.

 

- Chris

Link to comment
Share on other sites

So you have to create this admin/partners.php page yourself.

 

The first step is to create a page with a form, a textarea within the form and a save button.

The second step is to add tinyMCE code in the <head> section to turn the textarea into a tinyMCE editor.

The third step is to save the text somewhere when the save button is pressed.

The fourth step is to display this saved text on a page on the catalog side.

 

I have not done it, so I can't give any code for that. There is a contribution to edit the main page text, maybe it can be used as an example.

 

- Chris

 

Chris,

 

If you have example text for main page - can you provide me it?

How can I make 3 and 4 steps? I'm not good at scripting, you know)

 

Konstantin

Link to comment
Share on other sites

  • 2 weeks later...

Hi there,

 

I still don't understand where the hell am I supposed to include the function _filter_save_image?!?!?

I see questions regarding this since the first page of the thread and nobody bothered to answer, does anyone has this thing working?

Could I please have a COMPLETE and DETAILED explanation on where to perform the 3rd and 4th steps of the 3.5 Product Image installation?

Thanks in advance.

Link to comment
Share on other sites

You are in a forum where free help is provided about free contributions for free osCommerce code, others are not working for you.

 

I'm using ACA and it makes the installation of tinyMCE Anywhere as easy as copying one file and enabling it from admin, so I won't spend time to code something that I don't need, except if paid for it.

 

This said, the points 1 and 2 of installation chapter 3.5 have been successfuly coded (see 1st page of this thread). You should now have tinyMCE to edit the product image.

 

As tinyMCE is sending a full html image tag to the next page (the preview page), we have to filter it. The filter function provided can be placed for example in general.php

 

The preview code starts here in categories.php:

} elseif ($action == 'new_product_preview') {

Few lines down, you can see:

$products_image_name = $pInfo->products_image;

instead of this, call the filter filter function to filter $pInfo->products_image. The preview is now displaying correctly the image, and it should also be saved correctly in the database.

 

In case of success, please provide feedback to the community.

 

- Chris

Link to comment
Share on other sites

Hi,

 

I didn't mean to be rude, and I know you are not working for me, but it's extremely frustrating to install a contribution and on the last two steps you notice that there is no explanation of how to finish it... maybe it should be specifically stated that if one doesn't have the ACA contribution than this is an incomplete contribution, remember that not everyone is a programmer and knows where to add new functions and filter name tags... and it seamed pretty lame that the other users that had the exact same problem, and made the same question than me, were just being ignored.

 

Again, I know you don't work for us and probably didn't had the availability for it, so I sincerely apologise and hope we can start over again.

 

I'll try to do the changes later in the evening and if it works I'll let everyone know, but I don't have much hope since you explanation is for step 3, step 4 still sounds Chinese for me... :blush:

 

4) When loading the image name from the DB or from the HTTP_POST_VARS (when back from preview to editor), the img tag must be added again, something like that:

 

$products_image = '<img src="'.$products_image.'" />';

 

 

Thanks again for everything, this certainly sounds like an excellent contribution.

 

 

You are in a forum where free help is provided about free contributions for free osCommerce code, others are not working for you.

 

I'm using ACA and it makes the installation of tinyMCE Anywhere as easy as copying one file and enabling it from admin, so I won't spend time to code something that I don't need, except if paid for it.

 

This said, the points 1 and 2 of installation chapter 3.5 have been successfuly coded (see 1st page of this thread). You should now have tinyMCE to edit the product image.

 

As tinyMCE is sending a full html image tag to the next page (the preview page), we have to filter it. The filter function provided can be placed for example in general.php

 

The preview code starts here in categories.php:

} elseif ($action == 'new_product_preview') {

Few lines down, you can see:

$products_image_name = $pInfo->products_image;

instead of this, call the filter filter function to filter $pInfo->products_image. The preview is now displaying correctly the image, and it should also be saved correctly in the database.

 

In case of success, please provide feedback to the community.

 

- Chris

Link to comment
Share on other sites

No problem. I hope you'll succeed this part because tinyMCE is really great.

 

For step4, it's still in categories.php. Find this:

 

if ($action == 'new_product') {

It's the start of the part where products are loaded from database or back from the preview page.

Little bit more down, before

$manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));

 

You can place this line:

$pInfo->products_image = '<img src="'.$pInfo->products_image.'" />';

 

It should now work.

 

- Chris

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

I was install osC in subdirectory eg. www.domain.com/shop, install TinyMCE (ACA) and everything works great. But when I redirect my domain to subdirectory 'shop', in iBrowser show pictures only from directory 'images'. When I choose subdir eg. 'microsoft' (images/microsoft) I don't see pictures but only "Error building image list!" :'(

 

I'm sure that in my configure.php something is wrong. I'm trying change path in this file but nothing help. Help me please.

 

My admin configure.php:

  define('HTTP_SERVER', 'http://domain.com');
 define('HTTP_CATALOG_SERVER', 'http://domain.com');
 define('HTTPS_CATALOG_SERVER', 'http://domain.com');
 define('ENABLE_SSL_CATALOG', 'false');
 define('DIR_FS_DOCUMENT_ROOT', '/');
 define('DIR_WS_ADMIN', '/admin/');
 define('DIR_FS_ADMIN', '/admin/');
 define('DIR_WS_CATALOG', '/');
 define('DIR_FS_CATALOG', '/');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_CATALOG_IMAGES', '../images/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
 define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
 define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
 define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
 define('DIR_FS_PRODUCTS_IMAGES', ''); 
 define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
 define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

Thanks for your any help

Link to comment
Share on other sites

Hi have no problem running the ibrowser features except for the "Create a directory".

 

If I use FireFox, when I hit the "Create a directory" icon and try to make a new image directory under the current image folder,

For example, I want to create a new image folder named 'test' under the 'images' folder,

the ibrowser can create the directory correctly but it also popup an alert box with message:

 

"The page you are trying to view contains POSTDATA. If you resend the data, any action the form carried out (such as a search or online purchase) will be repeated. To resend the data, click OK. Otherwise, click Cancel."

 

If I click 'OK', ibrowser will create a new image folder named 'test_1', then the alert box popup again, if I continue to click 'OK', ibrower will keep creating new folders like 'test_2', 'test_3', 'test_4' ....., seems like an endless loop if I don't click 'Cancel'.

 

 

If I use IE7.0, the "Create a directory" function actually not working, it won't create any folder.

 

Please advise.

 

Thank you,

Jimpoo

Link to comment
Share on other sites

Hi,

 

I was install osC in subdirectory eg. www.domain.com/shop, install TinyMCE (ACA) and everything works great. But when I redirect my domain to subdirectory 'shop', in iBrowser show pictures only from directory 'images'. When I choose subdir eg. 'microsoft' (images/microsoft) I don't see pictures but only "Error building image list!" :'(

 

I'm sure that in my configure.php something is wrong. I'm trying change path in this file but nothing help. Help me please.

 

My admin configure.php:

  define('HTTP_SERVER', 'http://domain.com');
 define('HTTP_CATALOG_SERVER', 'http://domain.com');
 define('HTTPS_CATALOG_SERVER', 'http://domain.com');
 define('ENABLE_SSL_CATALOG', 'false');
 define('DIR_FS_DOCUMENT_ROOT', '/');
 define('DIR_WS_ADMIN', '/admin/');
 define('DIR_FS_ADMIN', '/admin/');
 define('DIR_WS_CATALOG', '/');
 define('DIR_FS_CATALOG', '/');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_CATALOG_IMAGES', '../images/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
 define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
 define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
 define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
 define('DIR_FS_PRODUCTS_IMAGES', ''); 
 define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
 define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

Thanks for your any help

 

You say you store in is directory /shop but there is nothing like this in your configure.php, so can't work. Also, your DIR_FS_DOCUMENT_ROOT is strange. The best way to move a store and have both configure.php files up-to-date is to re-install the store: make a backup of your database, with the file created, replace install/oscommerce.sql and run the install again. After that you'll have a good database and good configure.php.

 

- Chris

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

My thanks go out first to Chris and everyone who has helped make this a great contrib for osCommerece. I've installed this and all is well with one small exception and I most likely missed something. I have gone over the install process twice now from start to finish.

 

The site I'm working with has ACA installed and like I said all is fine and TinyMCE not really the issue it's iBrowser. On the products add/edit function in the admin area when using ibrowser to upload or edit an image to the product image are it will not allow us to do anything with the properties. When you finally switch to the properties section everything is grayed out.

 

I would appreciate any input I've gone through most of the things I could think of, but this one still is a mystery and the site owner is looking to edit the alt tags of the product images.

 

 

Thanks,

Steve - Techtroll

Link to comment
Share on other sites

Hi, I am totally lost here. I don't understand the instructions on how to add the TinyMCE to other pages. I am using a page creator contrib, and the textareas that I want to have converted to use TinyMCE are called: pages_title with an ID number for the lanugages, i.e, pages_title[1].

 

I don't understand how to convert this block of code:

   $mce_str = YOURCODEHERE // Comma separated list of textarea names
// You can add more textareas to convert in the $mce_str, be careful that they are all separated by a comma.
 echo '<script language="javascript" type="text/javascript" src="includes/javascript/tiny_mce/tiny_mce.js"></script>';
 include "includes/javascript/tiny_mce/general.php";

 

so that it works on that page. Can anyone help me? Thanks!

Link to comment
Share on other sites

I got it fixed. For anyone who does not understand how to make it work on other page. You have to surround that section of code with PHP tags. It should like like this when your done:

 

<?php
$mce_str = 'replace_this_with_textarea_name';
echo '<script language="javascript" type="text/javascript" src="includes/javascript/tiny_mce/tiny_mce.js"></script>';
include "includes/javascript/tiny_mce/general.php";
?>

 

Great Contrib! Thanks again. Good luck to anyone else using it!

Link to comment
Share on other sites

This contrib is dangerous. Whatever can access ibrowser without login:

 

http://oscommerce/admin/includes/javascrip...er/ibrowser.php

It will open iBrowser!

 

TinyMCE runs on the secure admin section. You can't use it without a previous login. Therefore, I do not wish to allow people direct access to iBrowser by just going directly to the iBrowser URL. I want to restrict them by making sure it was opened from within TinyMCE by clicking the iBrowser button and not directly.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...