Jump to content
Sign in to follow this  
MaxiDVD

[SUPPORT] HTML Editor and UltraPics by MaxiDVD

Recommended Posts

Hi,

 

Sorry I mean the  image 'inline'. I have had a look at PHPmailer, and I'm trying to work it out. If someone has some ideas, I am prepared to code and test.

 

Yes, having the image inline is what I mentioned here, a few posts back, in fact this:

 

http://phpmailer.sourceforge.net/tutorial.html#3

 

explains using the:

 

<img src="cid:CID" />

 

etc, to do it. PM me if you want, to let me know what you need to do, using PHPMailer.

 

Peter

 

PS It is Christmas Eve though, so I may not get to helping much for a day or so.

Edited by peterr

Share this post


Link to post
Share on other sites

Hi Raj,

 

I noticed someone was having trouble with PHPMailer and attachments, and a script they mentioned, which uses the (normal) PHP mail() function is here.

 

(Not that using PHPMailer implies problems with attachments though)

 

Peter

Share this post


Link to post
Share on other sites

I am new to the forum and to osCommerce. I am a novice/newbie to all things web design. I just spent the last two hours installing the contirbution and I am very excited to use it. I did everything (to the best of my knowledge) correctly, but, aparently I missed something somewhere. On my product page I am receving the following:

 

Table 'xtremep_Main.information' doesn't exist

 

and when I go to products in my admin I have this"

 

1054 - Unknown column 'p.products_image_med' in 'field list'

 

select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from products p, products_description pd where p.products_id = '57' and p.products_id = pd.products_id and pd.language_id = '1'

 

[TEP STOP]

 

 

Any help will be greatly appreciated.

 

I thank you in advance.

A guy just trying to figure it out.

Nate

Share this post


Link to post
Share on other sites

Hi,

 

I'm not familar with all th exact files included/needed for the installation, but it would appear you have left out the SQL part of the installation ?

 

Peter

Share this post


Link to post
Share on other sites
Hi,

 

I'm not familar with all th exact files included/needed for the installation, but it would appear you have left out the SQL part of the installation ?

 

Peter

 

I copied and pasted the SQL code into the categories table. Any where else you might direct me?

Share this post


Link to post
Share on other sites

Hi to ALL!

I wanna ask about compatibility Image Resize and WYSIWYG HTMLArea MS2 v1.7.

Does any work with two this contrib? I have one problem with it - I couldn't upload an image using Image Resize if WYSIWIG enable in Admin. And it's work perfectly when WYSIWIG is disable. Any suggestions to fix it?

Share this post


Link to post
Share on other sites

I fix it by deleting function Upload products image in WYSIWYG. WYSIWYG PRODUCTS DESCRIPTION should be set Enable in Admin always. So I just modified respected to image upload conditions HTML_AREA_WYSIWYG_DISABLE in /admin/categories.php (Disable go to Enable) and removed command

 

editor_generate('products_image',config);

 

In result I place here my modified install instruction about changes in /admin/categories.php only for uploading product image by Image Resize. All other functions of WYSIWYG are work perfectly. I hope it help someone. :) All other instructions for other modified files must be performed to the original isntructions! Don't forget this! ;)

 

  STEP 1.1a --> OPEN: /admin/categories.php
 ===========================================================================
=========
 Look/search for this around line 80:
 ===========================================================================
=========


       if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {
         tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");
       }


 ===========================================================================
=========
   And REPLACE that line with this::
 ===========================================================================
=========



       if (HTML_AREA_WYSIWYG_DISABLE == 'Disable') {
         if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {
           tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");
         }
       } else {
         if (isset($HTTP_POST_VARS['categories_image']) && tep_not_null($HTTP_POST_VARS['categories_image']) && ($HTTP_POST_VARS['categories_image'] != 'none')) {
           tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($HTTP_POST_VARS['categories_image']) . "' where categories_id = '" . (int)$categories_id . "'");
         }
       }





 STEP 1.1b --> FIND: /admin/categories.php
 ===========================================================================
=========
 Look/search for this around line 313:
 ===========================================================================
=========


     case 'new_product_preview':
// copy image only if modified
       $products_image = new upload('products_image');
       $products_image->set_destination(DIR_FS_CATALOG_IMAGES);
       if ($products_image->parse() && $products_image->save()) {
         $products_image_name = $products_image->filename;
       } else {
         $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
       }
       break;
   }
 }


 ===========================================================================
=========
   And REPLACE with this:
 ===========================================================================
=========


     case 'new_product_preview':
       if (HTML_AREA_WYSIWYG_DISABLE == 'Enable') {
         // copy image only if modified
         $products_image = new upload('products_image');
         $products_image->set_destination(DIR_FS_CATALOG_IMAGES);

//BOF Image Resize
  $products_image->set_resize(true);
//EOF Image Resize

         if ($products_image->parse() && $products_image->save()) {
           $products_image_name = $products_image->filename;
         } else {
           $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
         }
       } else {
         if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {
           $products_image_name = $HTTP_POST_VARS['products_image'];
         } else {
           $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
         }
       }
       break;
   }
 }






 STEP 1.1c --> FIND: /admin/categories.php
 ===========================================================================
=========
 Look/search for this around line 337:
 ===========================================================================
=========

 <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
 <script language="javascript" src="includes/general.js"></script>
 </head>

 ===========================================================================
=========
   And directly ABOVE IT add this:
 ===========================================================================
=========


       <script language="Javascript1.2"><!-- // load htmlarea
// MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 - 2.2 MS2 Products Description HTML - Head
       _editor_url = "<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN; ?>htmlarea/";  // URL to htmlarea files
         var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
          if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
           if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
            if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
        <?php if (HTML_AREA_WYSIWYG_BASIC_PD == 'Basic'){ ?>  if (win_ie_ver >= 5.5) {
        document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_basic.js"');
        document.write(' language="Javascript1.2"></scr' + 'ipt>');
           } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
        <?php } else{ ?> if (win_ie_ver >= 5.5) {
        document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_advanced.js"');
        document.write(' language="Javascript1.2"></scr' + 'ipt>');
           } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
        <?php }?>
// --></script>






 STEP 1.1d --> FIND: /admin/categories.php
 ===========================================================================
=========
 Look/search for this around line 596:
 ===========================================================================
=========


         <tr>
           <td class="main"><?php echo TEXT_PRODUCTS_IMAGE; ?></td>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('products_image') . '<br>' . tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $pInfo->products_image . tep_draw_hidden_field('products_previous_image', $pInfo->products_image); ?></td>
         </tr>


 ===========================================================================
=========
   And REPLACE with this:
 ===========================================================================
=========


         <tr>
           <td class="main"><?php echo TEXT_PRODUCTS_IMAGE; ?></td>
       <?php if (HTML_AREA_WYSIWYG_DISABLE == 'Enable') { ?>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('products_image') . '<br>' . tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $pInfo->products_image . tep_draw_hidden_field('products_previous_image', $pInfo->products_image); ?></td>
       <?php }else{ ?>
           <td class="main"><?php echo '<table border="0" cellspacing="0" cellpadding="0"><tr><td class="main">' . tep_draw_separator('pixel_trans.gif', '24', '15') . '  </td><td class="main">' . tep_draw_textarea_field('products_image', 'soft', '70', '2', $pInfo->products_image) . tep_draw_hidden_field('products_previous_image', $pInfo->products_image) . '</td></tr></table>'; ?></td>
       <?php } ?>
         </tr>







 STEP 1.1e --> FIND: /admin/categories.php
 ===========================================================================
=========
 Look/search for this around line 631:
 ===========================================================================
=========


 </table></form>


 ===========================================================================
=========
 And directly UNDERNEATH IT add this:
 ===========================================================================
=========



<?php
//MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 - 2.2 MS2 Products Description HTML - </form>
  if (HTML_AREA_WYSIWYG_DISABLE == 'Disable') {} else { ?>
           <script language="JavaScript1.2" defer>
            var config = new Object();  // create new config object
            config.width = "<?php echo HTML_AREA_WYSIWYG_WIDTH; ?>px";
            config.height = "<?php echo HTML_AREA_WYSIWYG_HEIGHT; ?>px";
            config.bodyStyle = 'background-color: <?php echo HTML_AREA_WYSIWYG_BG_COLOUR; ?>; font-family: "<?php echo HTML_AREA_WYSIWYG_FONT_TYPE; ?>"; color: <?php echo HTML_AREA_WYSIWYG_FONT_COLOUR; ?>; font-size: <?php echo HTML_AREA_WYSIWYG_FONT_SIZE; ?>pt;';
            config.debug = <?php echo HTML_AREA_WYSIWYG_DEBUG; ?>;
         <?php for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { ?>
            editor_generate('products_description[<?php echo $languages[$i]['id']; ?>]',config);
         <?php } ?>
            config.height = "35px";
            config.bodyStyle = 'background-color: white; font-family: Arial; color: black; font-size: 12px;';
            config.toolbar = [ ['InsertImageURL'] ];
            config.OscImageRoot = '<?= trim(HTTP_SERVER . DIR_WS_CATALOG_IMAGES) ?>';
            </script>
<?php } ?>








 STEP 1.1f --> FIND: /admin/categories.php
 ===========================================================================
=========
 Look/search for this around line 962:
 ===========================================================================
=========


       $contents[] = array('text' => '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $cInfo->categories_image, $cInfo->categories_name) . '<br>' . DIR_WS_CATALOG_IMAGES . '<br><b>' . $cInfo->categories_image . '</b>');


 ===========================================================================
=========
 And REPLACE with this:
 ===========================================================================
=========



       $contents[] = array('text' => '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $cInfo->categories_image, $cInfo->categories_name) . '<br>' . DIR_WS_CATALOG_IMAGES . '<br><b>' . $cInfo->categories_image . '</b>');
       if (HTML_AREA_WYSIWYG_DISABLE == 'Disable') {
         $contents[] = array('text' => '<br>' . TEXT_EDIT_CATEGORIES_IMAGE . '<br>' . tep_draw_file_field('categories_image'));
       }else{
         $contents[] = array('text' => '<br>' . TEXT_EDIT_CATEGORIES_IMAGE . '<br>' . tep_draw_textarea_field('categories_image', 'soft', '30', '1', $cInfo->categories_image));
       }





 STEP 1.1g --> FIND: /admin/categories.php
 ===========================================================================
=========
 Look/search for this around line 1051:
 ===========================================================================
=========


       } else { // create category/product info
         $heading[] = array('text' => '<b>' . EMPTY_CATEGORY . '</b>');

         $contents[] = array('text' => TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS);
       }
       break;
   }

   if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
     echo '            <td width="25%" valign="top">' . "\n";

     $box = new box;
     echo $box->infoBox($heading, $contents);

     echo '            </td>' . "\n";
   }
?>


 ===========================================================================
=========
 And REPLACE with:
 ===========================================================================
=========



       } else { // create category/product info
         $heading[] = array('text' => '<b>' . EMPTY_CATEGORY . '</b>');

         $contents[] = array('text' => TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS);
       }
       break;
   }

   if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
     echo '            <td width="25%" valign="top">' . "\n";

     $box = new box;
     echo $box->infoBox($heading, $contents);

     echo '            </td>' . "\n";

     // Add neccessary JS for WYSIWYG editor of category image
     if($action=='edit_category'){
       if (HTML_AREA_WYSIWYG_DISABLE != 'Disable'){
         echo '
                 <script language="JavaScript1.2" defer>
                 var config = new Object();  // create new config object
                 config.width  = "250px";
                 config.height = "35px";
                 config.bodyStyle = "background-color: white; font-family: Arial; color: black; font-size: 12px;";
                 config.debug = ' . HTML_AREA_WYSIWYG_DEBUG . ';
                 config.toolbar = [ ["InsertImageURL"] ];
                 config.OscImageRoot = "' . trim(HTTP_SERVER . DIR_WS_CATALOG_IMAGES) . '";
                 editor_generate("categories_image",config);
                </script>
              ';
       }
     }

   }
?>


 @  END /ADMIN/CATEGORIES.PHP - SAVE AND CLOSE FILE @

Share this post


Link to post
Share on other sites

Hi,

 

I am really stuck. Everything seems to have gone well with my installation, but (there's always a but isn't there) popups!

 

The image popups are working just fine in the admin area, and in preview mode etc, but as soon as you look at the actual listings I get a javascript error. I can't figure out where I'm going wrong.

 

Possibly best to show the error? Have a look at example product page

 

Neither of the images generate a popup, yet both work perfectly in preview mode.

 

Thanks

Share this post


Link to post
Share on other sites

Happy New Year!

 

As I've finally got rid of my PC and got a shiny new iMac, I'm feeling pretty smug. Until I discovered it breaks the HTML Editor part of this superb contribution.

 

As I understand it, it uses HTML Area V2 which uses nasty sneaky Internet Explorer 5.5 - only stuff. Since the only IE available on Mac is 5.2 (thank you SO MUCH, Microsoft!), I started digging.

 

There is a good rule - when in hole, stop digging. Shame I didn't listen to myself.

 

As most people in here have spotted, there is HTML Area V3 which works fine on Firefox/Mozilla (but not on Safari, the default Mac browser).

 

Unfortunately, V3 is miles different than V2. Some people have started or tried to move this contribution to V3. I've got the HTMLArea working fine, except that the bodyStyle attribute does not exist, and the height and width attributes are no longer required.

 

I'd be pleased to share my first stabs at getting this working with anyone who is interested, especially Lee.

 

BUT - the Php Image Manager part is really broken. It wants to use InsertImageURL, which brings up the nice point/click image selector with upload/download. This doesn't exist in V3, there is only insertimage.

 

Am I right in thinking that InsertImageURL was a serious bit of surgery done to V2 for the benefit of osC?

 

Also, the insertImage function of V3 seems really primitive - just type in a URL. No point and click.

 

I'd be happy to spend hours going down this route, but if someone is further along the path, it would be better to work together instead of blindly duplicating what's already been done.

 

Anyone?

 

Martin

Share this post


Link to post
Share on other sites
Hi,

 

I am really stuck.  Everything seems to have gone well with my installation, but (there's always a but isn't there) popups!

 

The image popups are working just fine in the admin area, and in preview mode etc, but as soon as you look at the actual listings I get a javascript error.  I can't figure out where I'm going wrong.

 

Possibly best to show the error?  Have a look at example product page

 

Neither of the images generate a popup, yet both work perfectly in preview mode.

 

Thanks

Dave - I'm sure I saw something similar.

 

The real gotcha is that vast amounts of stuff (like, alomst everything) is duplicated under admin. What happened to me was some changes to configure.php so it all worked well, until I went into admin. There's ALSO a configure.php under admin/includes as well as /includes..

 

You have the opposite problem - it works from admin but not from 'normal'. I'd check the filenames.php in both locations and popup_image.php in both locations. I'm not getting Javascript errors, but there's definitely no pop-up occurring!

 

It's also unusual that you haven't installed stuff under /catalog/ on your site. You might just regret that later, as most contributions make that assumption.

 

Martin

Share this post


Link to post
Share on other sites

Hi,

 

Checked all of that, and they all seem to be correct. The problem seems to be that the script used for popup_image.php in the main catalogue cannot find the related images. I've tried replacing with the admin version of popup_image.php and still the same problem occurs. Thought there might be a conflict with the STS template mod I am using in conjunction, but again I can't see any conflict in files and/or coding for that.

 

This is the final thing I need to get fixed in order to set the site live, so I would REALLY appreciate any help.

 

Thanks

Share this post


Link to post
Share on other sites

Hmm, strange, It's not rocket science. I have made some changes to popup_image.php, so that any click closes the window.

 

But the key part is this:

 tep_image(DIR_WS_IMAGES . $products['products_image_lrg'],

 

So in includes/configure.php I have:

  define('DIR_WS_IMAGES', 'images/');

Note that is a relative reference as it doesn't start with a /. It assumes that images directory exists relative to popup_image.php.

 

Due to a large number of stock images, I created a directory below images called stock. Therefore the entries in column products_image_lrg look like 'stock/item1.jpg'.

 

It wouldn't hurt to change the title part to this for debugging purposes:

 

<title> 
<?php echo DIR_WS_IMAGES . "${products['products_image_lrg']}"; ?>
</title>

So this will show the path it is looking for in the title bar of the popup window.

Good luck

Share this post


Link to post
Share on other sites

Hi,

 

I'm not getting as far as a popup window though, so perhaps my analysis of the problem has been misleading.

 

When you click the image, all you get is a javascript error (assuming all pop-up protection is disabled, otherwise nothing happens).

Share this post


Link to post
Share on other sites

Hi,

 

Just remembered that I customised the product_info.php slightly. Is there some sort of declaration or somehting I may have lost that allows the popup script to work?

Share this post


Link to post
Share on other sites

Hi, I had various errors particularly the one about entry existing 112/1 etc (sorry it's late and I can't remember the exact sql error).

 

2 things fixed several sql errors for me and then it imported smoothly and the whole thing works,

 

1) I removed the sql entry as described previously in this thread

2) I used the script edited by someone else, it's in the download section - the guy had a problem with it and edited it, posted above the original versions.

 

This then worked. Took me 2 hours to get it working, but then I don't know what I'm doing ;-)

 

Greg.

 

PS if anyone knows how to get the image to browse further up the online 'tree' rather than just in the images folder, that would be good. As all my images are stored elsewhere on the server.

Share this post


Link to post
Share on other sites

Sorry if I missed this somewhere.. but does the 'unspecific' popup size actually work? I want my images to popup to their actual size, and all images are different sizes so I assumed 'set to 0 for unspecific' would do this.

 

So question.. should it work and if not how can I modify the code so that the image popups at it's uploaded size?

 

Thanks. :blink:

Share this post


Link to post
Share on other sites

On the popup front, popup to full size would seem sensible. I upload images full size. What would be REALLY good is if the small images could be 'thumb' on the fly, so I don't have to make a seperate set of thumbs. As it is I have the small images loading from the full size file, just resized. Which causes bad page load times.

 

Any suggestions as to fixing this apprecaited.

 

Greg.

Share this post


Link to post
Share on other sites

OK, had some sleep and stopped being lazy.

 

Popup Images Display at Uploaded Size:

 

This worked for me, backup first if you feel the need:

 

in catalog/popup_image.php, starting at about line 40

 

Find:

} elseif ($HTTP_GET_VARS['image'] ==1) {
    echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_1'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);

 

 

Change to:

} elseif ($HTTP_GET_VARS['image'] ==1) {
    echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_1'], $products['products_name']);

 

Do this for as many lines as you want to change the size. The numbers represent your 6 options for uploading extra images.

:thumbsup:

Share this post


Link to post
Share on other sites

Hi Folks!

 

I'm just building a new store, and I've swapped Mopix against Ultrapics. I like UP a lot better!! Thanks a lot.

Buuuut (...you knew that would come), with Mopix, I had hacked-in two features:

a. If I wanted, it was sufficient to upload one big image, which was automatically resampled into a large and a small version (at predefined dimensions). If required, I was able to choose individual images as well.

 

I know, the Ultrapics Image Uploader has a resize feature, but I loathe uploading essentially the same image 2 or three times, always having to remember the standard image dimensions for the respective image type.

(Sorry, if I'm too lazy... ;) )

 

Does anyone know an add-on/fix for this or has anyone done this or something similar?

Comment, ideas and approaches would be very welcome!

Thanks!!!

 

German

Share this post


Link to post
Share on other sites

Hi,

I seem to have lost the large image settings in the Admin/Configuration/Images, I still have all the others like the small and medium etc but just lost the large.

 

Could anyone tell me what file I should be looking at so that I can try and reinstall the right bit of code

 

Thanks in advance

Share this post


Link to post
Share on other sites

Hello there, I'm an osC newbie also and I'm having the same problem as Nate did earlier:

 

When I go to products in my admin I have this"

 

1054 - Unknown column 'p.products_image_med' in 'field list'

 

select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.

 

etc.

 

I copied the sql just the way it was in the original file but something happened when I ran the query because I qot a error message that said there was something wrong with the script (and it marked with red words now() in the script). I'm not familiar with sql so I didn't know what to do and now product pages in catalog or admin isn't working at all.

 

I'd be thrilled if anyone could tell me what to do :huh: !

 

Thank you in advance,

 

Jenna

Share this post


Link to post
Share on other sites

PLEASE PLEASE PLEASE PLEASE PLEASE!!!!

 

Can someone help with the pop-up issue I have raised above. For some reason it appears that it is failing to call the popup function correctly, so looks more likely to be an issue with product_info.php than anything else.

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  

×