Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] HTML WYSIWYG Editor for Product Desc, MS1 2.2


Guest

Recommended Posts

Another little bug:

 

In admin/categories.php there seems to be a misplaced parantheses, which leads to a closing </script> tag without any opening <script> in case htmlArea has been disabled:

 

<?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 } } ?>

     </script>

 

...should be changed to...

 

<?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 } ?>

           </script>

<?php } ?>

 

Differences are in the last 4 lines.

 

I am currently working on a possibility to use the nice image manager addon of htmlArea also for the standard article and categorie images. If I succeed and you like it, you might include it into your contribution ?!?

I will keep you posted.

Jpsy

 

DigiLog multimedia, Saarbr?cken, Germany

Link to comment
Share on other sites

  • Replies 557
  • Created
  • Last Reply

Top Posters In This Topic

Hi Adrenolin and Lee,

For some strange reason I didn't get a notification of new posted messages until today...Wonder why? But I guess I should have known to return to this topic on my own...After all this is a HOT topic!! :D

 

About the secure server. I'm using a hosting company and I have got a secure server for my entire domain.

 

When the HTML area loads it seems like all the images load fine until the very end when I get the pop-up message:

 

This page contains both secure and non-secure items. Do you want to display the non-secure items?

 

I checked the property for every image and they all have the extension https (both when I check the temporary internet folder in my cache and when I right-clicked every single image (button))

 

So for some reason I think it might be the actual HTML area itself that is producing this error. and no, I have no image included in the HTML area itself.

 

Does anyone that is using the HTML editor also have a secured site?

 

The investigation continues...Thanks for giving me some tips so soon. I need to come back here often wheter or not I get a forum notification...

Link to comment
Share on other sites

Lee,

I just checked out your admin demo as you provide a few posts ago. It's very impressive how many contributions you have added! It's also probably the best place I have ever been to in terms of seeing how some contributions work. Thanks a lot for providing that link to all of us!

 

and...I think I will have to install a few more contributions since I saw your admin panel. Thanks a lot! :roll: :lol:

Link to comment
Share on other sites

Finnisher:

 

There is an explanation for this behaviour in the htmlArea website at interactivetools.com:

 

http://www.interactivetools.com/products/h...n.html#bugs_ssl

 

Excerpt:

 

Why do I get "non secure items" warnings when using htmlarea on a secure (SSL) https:// page?  

This is a bug/feature of Internet Explorer. Even if you get unsecure warnings your form contents should still be submitted securely.  

htmlArea uses an <iframe> to contain the editor and because the contents of the iframe isn't being loaded off a secure site, Internet Explorer thinks the iframe is unsecure. The problem is, the iframe doesn't load anything off any site, it's blank, it doesn't even have a src attribute. We just create an empty iframe and then use javascript to update it. We hope to have this fixed in a future release.  

 

Note: There's a clever workaround for this problem posted in the forum http://www.interactivetools.com/iforum/P3686/. The only issue with it is that can cause the back button to not work as intended (it goes back in the iframe first).  

Jpsy

 

DigiLog multimedia, Saarbr?cken, Germany

Link to comment
Share on other sites

Cheers Jpsy

 

Bug noted for update:

 

           </script>

<?php } ?>

 

I am currently working on a possibility to use the nice image manager addon of htmlArea also for the standard article and categorie images. If I succeed and you like it, you might include it into your contribution ?!?  

I will keep you posted.

 

Go for it :thumbsup:

 

what do you mean by standard article ?

 

I decided to updating HTMLArea 2.0 to 3.0Alpha over the next couple of days as it supports more OS and Mozilla Browsers, also has faster loading times, anyone who is using more than 1 language will notice heavy download times when creating or editing product descriptions. this is due to all the HTMLarea downloading each and every button image everytime the page is refreshed for some reason the images dont get cached.

 

problem is the coding is different on categories.php, mail.php, newsletter.php so some instructions will need to be changed along with the above mentioned files. (only for those who installed HTML 2.0 or have other mods installed) new MS2 installs can just drop and paste.

 

New image upload is also available for v3.0, not sure about "insert - links" contribution.

 

anyback to it.. :lol:

 

Cheers Lee

Link to comment
Share on other sites

Lee:

 

what do you mean by standard article ?

 

I meant "standard article images".

The normal images that Osc holds for every article and for every categorie. I want to try to use the htmlArea image maintenance addon to upload, select and manage these images too. The normal upload and selection process in Osc is quite inconvenient.

 

I am currently diving deep into the code of htmlArea, the image upload addon and your contrib. As all of these parts are new for me (as is the whole shop system) and as they are quite evolved this is not a simple task. I have to explore the structure bit by bit. But I will manage... just give me some more hours... :wink:

Jpsy

 

DigiLog multimedia, Saarbr?cken, Germany

Link to comment
Share on other sites

You got me started on a better predifined input solution, should have some progress up here by tommorow. much simpler then before -  

 

Take alook at this:

http://www.maxidvd.com.au/ms1/admin/mail.php

 

[/b]

 

 

Thanks Lee,

 

This will be a great improvment of an already great contribution :)

 

Please let me know if you will upload those changes in the contrib area...

 

 

Thank you again,

Clement

Link to comment
Share on other sites

Yeah sure will, I may included them as on/off options in admin, just back to your original question.

 

editor_basic.js or/and editor_advanced.js

 

 

you can make custom buttons pretty easy just duplicated //Custom 3 create a new under it call it //Custom 4 or alter 1,2,3 then in the top of them files you need to uncomment these or create the new ones

 

this part is the placement on the WYSIWYG toolbars

// ['custom1', 'custom3', custom3','separator'],

 

also this part

 

// Add custom buttons here:

"custom1": ['custom1', ' Purpose of button 1 ', 'editor_action(this.id)', 'ed_custom.gif'],

"custom2": ['custom2', ' Purpose of button 2 ', 'editor_action(this.id)', 'ed_custom.gif'],

"custom3": ['custom3', ' Custom info ', 'editor_action(this.id)', 'ed_custom.gif'],

this part defines the name of the button the mouse-over name and the image to be used for the button

 

Cheers Lee

Link to comment
Share on other sites

Hi, ive just install the 1.7 version and it working great. I just wanna know how come the editor's backgound is white instead of detailed gray?

 

When i refresh the page in Admin Define MainPage the editor window show up fine for a brief moment and then its backgound turns all white again.

 

Problem with this is that you also cant see the outline of the editor's window.

Link to comment
Share on other sites

in the installation instructions it says:

 STEP 1.5 --> OPEN: catalog/default.php (or index.php)

 ===========================================================================

==========

 Look for this around line 32:

 ===========================================================================

==========

 

         <tr>

           <td class="main"><br><?php echo TEXT_MAIN; ?></td>

         </tr>

 

 ===========================================================================

=========

 And replace that line with this:

 ===========================================================================

=========

 

        <tr>

          <td class="main"><?php include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE); ?></td>

        </tr>

 

but my defualt.php looks like this:

 

<?php

/*

 $Id: default.php,v 1.81 2003/02/13 04:23:23 hpdl Exp $



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2003 osCommerce



 Released under the GNU General Public License

*/



 require('includes/application_top.php');



// the following cPath references come from application_top.php

 $category_depth = 'top';

 if (isset($cPath) && tep_not_null($cPath)) {

   $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . $current_category_id . "'");

   $cateqories_products = tep_db_fetch_array($categories_products_query);

   if ($cateqories_products['total'] > 0) {

     $category_depth = 'products'; // display products

   } else {

     $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . $current_category_id . "'");

     $category_parent = tep_db_fetch_array($category_parent_query);

     if ($category_parent['total'] > 0) {

       $category_depth = 'nested'; // navigate through the categories

     } else {

       $category_depth = 'products'; // category has no products, but display the 'no products' message

     }

   }

 }



 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<SCRIPT LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> 

<title><?php echo TITLE; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">



<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->



<!-- body //-->

<table border="0" width="100%" cellspacing="3" cellpadding="3">

 <tr>

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

   </table></td>

<!-- body_text //-->

<?php

 if ($category_depth == 'nested') {

   $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $languages_id . "'");

   $category = tep_db_fetch_array($category_query);

?>

   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <tr>

           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

     </tr>

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">

         <tr>

           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">

             <tr>

<?php

   if (isset($cPath) && ereg('_', $cPath)) {

// check to see if there are deeper categories within the current category

     $category_links = array_reverse($cPath_array);

     for($i=0, $n=sizeof($category_links); $i<$n; $i++) {

       $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by sort_order, cd.categories_name");

       if (tep_db_num_rows($categories_query) < 1) {

         // do nothing, go through the loop

       } else {

         break; // we've found the deepest category the customer is in

       }

     }

   } else {

     $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by sort_order, cd.categories_name");

   }



   $rows = 0;

   while ($categories = tep_db_fetch_array($categories_query)) {

     $rows++;

     $cPath_new = tep_get_path($categories['categories_id']);

     $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

     echo '                <td align="center" class="smallText" style="width: ' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "n";

     if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != tep_db_num_rows($categories_query))) {

       echo '              </tr>' . "n";

       echo '              <tr>' . "n";

     }

   }

?>

             </tr>

           </table></td>

         </tr>

         <tr>

           <td><br><?php $new_products_category_id = $current_category_id; include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>

         </tr>

       </table></td>

     </tr>

   </table></td>

<?php

 } elseif ($category_depth == 'products' || $HTTP_GET_VARS['manufacturers_id']) {

// create column list

   $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,

                        'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,

                        'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER, 

                        'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE, 

                        'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY, 

                        'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT, 

                        'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE, 

                        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

   asort($define_list);



   $column_list = array();

   reset($define_list);

   while (list($column, $value) = each($define_list)) {

     if ($value) $column_list[] = $column;

   }



   $select_column_list = '';



   for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {

     if ( ($column_list[$col] == 'PRODUCT_LIST_BUY_NOW') || ($column_list[$col] == 'PRODUCT_LIST_PRICE') ) {

       continue;

     }



     if (tep_not_null($select_column_list)) {

       $select_column_list .= ', ';

     }



     switch ($column_list[$col]) {

       case 'PRODUCT_LIST_MODEL':

         $select_column_list .= 'p.products_model';

         break;

       case 'PRODUCT_LIST_NAME':

         $select_column_list .= 'pd.products_name';

         break;

       case 'PRODUCT_LIST_MANUFACTURER':

         $select_column_list .= 'm.manufacturers_name';

         break;

       case 'PRODUCT_LIST_QUANTITY':

         $select_column_list .= 'p.products_quantity';

         break;

       case 'PRODUCT_LIST_IMAGE':

         $select_column_list .= 'p.products_image';

         break;

       case 'PRODUCT_LIST_WEIGHT':

         $select_column_list .= 'p.products_weight';

         break;

     }

   }



   if (tep_not_null($select_column_list)) {

     $select_column_list .= ', ';

   }



// show the products of a specified manufacturer

   if (isset($HTTP_GET_VARS['manufacturers_id'])) {

     if (isset($HTTP_GET_VARS['filter_id'])) {

// We are asked to show only a specific category

       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . $HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . $languages_id . "' and p2c.categories_id = '" . $HTTP_GET_VARS['filter_id'] . "'";

     } else {

// We show them all

       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . $HTTP_GET_VARS['manufacturers_id'] . "'";

     }

// We build the categories-dropdown

     $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' and p.manufacturers_id = '" . $HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";

   } else {

// show the products in a given categorie

     if (isset($HTTP_GET_VARS['filter_id'])) {

// We are asked to show only specific catgeory

       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . $HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . $languages_id . "' and p2c.categories_id = '" . $current_category_id . "'";

     } else {

// We show them all

       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . $languages_id . "' and p2c.categories_id = '" . $current_category_id . "'";

     }

// We build the manufacturers Dropdown

     $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by m.manufacturers_name";

   }



   if ( (!$HTTP_GET_VARS['sort']) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'],0,1) > sizeof($column_list)) ) {

     for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {

       if ($column_list[$col] == 'PRODUCT_LIST_NAME') {

         $HTTP_GET_VARS['sort'] = $col+1 . 'a';

         $listing_sql .= " order by pd.products_name";

         break;

       }

     }

   } else {

     $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);

     $sort_order = substr($HTTP_GET_VARS['sort'], 1);

     $listing_sql .= ' order by ';

     switch ($column_list[$sort_col-1]) {

       case 'PRODUCT_LIST_MODEL':

         $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

         break;

       case 'PRODUCT_LIST_NAME':

         $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');

         break;

       case 'PRODUCT_LIST_MANUFACTURER':

         $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

         break;

       case 'PRODUCT_LIST_QUANTITY':

         $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

         break;

       case 'PRODUCT_LIST_IMAGE':

         $listing_sql .= "pd.products_name";

         break;

       case 'PRODUCT_LIST_WEIGHT':

         $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

         break;

       case 'PRODUCT_LIST_PRICE':

         $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

         break;

     }

   }

?>

   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <form>

         <tr>

           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<?php

// optional Product List Filter

   if (PRODUCT_LIST_FILTER > 0) {

     $filterlist_query = tep_db_query($filterlist_sql);

     if (tep_db_num_rows($filterlist_query) > 1) {

       echo '            <td align="center" class="main">' . TEXT_SHOW . '<select size="1" onChange="if(options[selectedIndex].value) window.location.href=(options[selectedIndex].value)">';

       if (isset($HTTP_GET_VARS['manufacturers_id'])) {

         $arguments = 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'];

       } else {

         $arguments = 'cPath=' . $cPath;

       }

       $arguments .= '&sort=' . $HTTP_GET_VARS['sort'];



       $option_url = tep_href_link(FILENAME_DEFAULT, $arguments);



       if (!isset($HTTP_GET_VARS['filter_id'])) {

         echo '<option value="' . $option_url . '" SELECTED>' . TEXT_ALL . '</option>';

       } else {

         echo '<option value="' . $option_url . '">' . TEXT_ALL . '</option>';

       }



       echo '<option value="">---------------</option>';

       while ($filterlist = tep_db_fetch_array($filterlist_query)) {

         $option_url = tep_href_link(FILENAME_DEFAULT, $arguments . '&filter_id=' . $filterlist['id']);

         if (isset($HTTP_GET_VARS['filter_id']) && ($HTTP_GET_VARS['filter_id'] == $filterlist['id'])) {

           echo '<option value="' . $option_url . '" SELECTED>' . $filterlist['name'] . '</option>';

         } else {

           echo '<option value="' . $option_url . '">' . $filterlist['name'] . '</option>';

         }

       }

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

     }

   }



// Get the right image for the top-right

   $image = DIR_WS_IMAGES . 'table_background_list.gif';

   if (isset($HTTP_GET_VARS['manufacturers_id'])) {

     $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . $HTTP_GET_VARS['manufacturers_id'] . "'");

     $image = tep_db_fetch_array($image);

     $image = $image['manufacturers_image'];

   } elseif ($current_category_id) {

     $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . $current_category_id . "'");

     $image = tep_db_fetch_array($image);

     $image = $image['categories_image'];

   }

?>

           <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

         </tr>

         </form>

       </table></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

     </tr>

     <tr>

       <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>

     </tr>

   </table></td>

<?php

 } else { // default page

?>

   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <tr>

           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

         

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

     </tr>

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <tr>

           <td class="main"><?php echo tep_customer_greeting(); ?></td>

         </tr>

         <tr>

           <td class="main"><br><?php echo; ?></td>

         </tr>

         <tr>

           <td><br><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>

         </tr>

<?php

   include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);

?>

       </table></td>

     </tr>

   </table></td>

<?php

 }

?>

<!-- body_text_eof //-->

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

   </table></td>

 </tr>

</table>

<!-- body_eof //-->



<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

i couldn't find

         <tr>

           <td class="main"><br><?php echo TEXT_MAIN; ?></td>

         </tr>

please help me

Link to comment
Share on other sites

J?rg, thanks so much for the link on how to solve the SSL problem I was having! It worked!

 

Lee, that's very nice of you to let people utilize your work on all the contributions!

 

I installed my first MS2 today and I wonder now if I shouldn't update the two stores I have made this spring. But it would be a lot of work since I customized a lot of things. Security updates? How serious lacks in your mind does the MS1 have?

 

psytech, I found the fault in your index or default. Almost at the very bottom of your page. just below tep_customer_greeting you find this:

 

 

 

<?php echo; ?>

 

that should say (what you were looking for):

 

<?php echo TEXT_MAIN; ?>

Link to comment
Share on other sites

Thomas (and to whoever has that problem):

 

For transfering any changes from an older codebase of Osc to the new one I strongly recommend using Beyond Compare (http://www.scootersoftware.com/). For me it's the absolutely best tool for that job. It compares files and complete folder trees, using a wonderful grafical interface.

If you use it to compare your old original code base with your modified one you find out immediatelly what changes you made and what you have to transfer.

I use it for many of my Open Source based installations in that way. Saves me many hours and days of working time!

I also use it to sync my laptop with my workstation, to find out all the differences between two different code snapshots, to......

 

BTW: I don't get any money for promoting this product *lol*

Jpsy

 

DigiLog multimedia, Saarbr?cken, Germany

Link to comment
Share on other sites

i've downloaded and installed maxidvd's store but i get an eror in the admin:

Warning: Missing argument 1 for tep_session_start() in c:program filesapache groupapachehtdocsetechstoreadminincludesfunctionssessions.php on line 66

 

Warning: session_start(): open(C:PHPsessiondatasess_f64debc78d0c23acc5e854f16d2c0d61, O_RDWR) failed: No such file or directory (2) in c:program filesapache groupapachehtdocsetechstoreadminincludesfunctionssessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:program filesapache groupapachehtdocsetechstoreadminincludesfunctionssessions.php:66) in c:program filesapache groupapachehtdocsetechstoreadminincludesfunctionssessions.php on line 67

 

and in the catalog:

Warning: session_start(): open(C:PHPsessiondatasess_1b69780b28485f74c666a6e02adc752a, O_RDWR) failed: No such file or directory (2) in c:program filesapache groupapachehtdocsetechstoreincludesfunctionssessions.php on line 67

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at c:program filesapache groupapachehtdocsetechstoreincludesfunctionssessions.php:67) in c:program filesapache groupapachehtdocsetechstoreincludesfunctionssessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:program filesapache groupapachehtdocsetechstoreincludesfunctionssessions.php:67) in c:program filesapache groupapachehtdocsetechstoreincludesfunctionssessions.php on line 67

 

my sessions.php is:

<?php

/*

 $Id: sessions.php,v 1.7 2002/03/18 16:37:22 dgw_ Exp $



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2002 osCommerce



 Released under the GNU General Public License

*/



 if (STORE_SESSIONS == 'mysql') {

   if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {

     $SESS_LIFE = 1440;

   }



   function _sess_open($save_path, $session_name) {

     return true;

   }



   function _sess_close() {

     return true;

   }



   function _sess_read($key) {

     $qid = tep_db_query("select value from " . TABLE_SESSIONS . " where sesskey = '" . $key . "' and expiry > '" . time() . "'");



     $value = tep_db_fetch_array($qid);

     if ($value['value']) {

       return $value['value'];

     }



     return false;

   }



   function _sess_write($key, $val) {

     global $SESS_LIFE;



     $expiry = time() + $SESS_LIFE;

     $value = addslashes($val);



     $qid = tep_db_query("select count(*) as total from " . TABLE_SESSIONS . " where sesskey = '" . $key . "'");

     $total = tep_db_fetch_array($qid);



     if ($total['total'] > 0) {

       return tep_db_query("update " . TABLE_SESSIONS . " set expiry = '" . $expiry . "', value = '" . $value . "' where sesskey = '" . $key . "'");

     } else {

       return tep_db_query("insert into " . TABLE_SESSIONS . " values ('" . $key . "', '" . $expiry . "', '" . $value . "')");

     }

   }



   function _sess_destroy($key) {

     return tep_db_query("delete from " . TABLE_SESSIONS . " where sesskey = '" . $key . "'");

   }



   function _sess_gc($maxlifetime) {

     tep_db_query("delete from " . TABLE_SESSIONS . " where expiry < '" . time() . "'");



     return true;

   }



   session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');

 }



 function tep_session_start() {

   return session_start();

 }



 function tep_session_register($variable) {

   return session_register($variable);

 }



 function tep_session_is_registered($variable) {

   return session_is_registered($variable);

 }



 function tep_session_unregister($variable) {

   return session_unregister($variable);

 }



 function tep_session_id($sessid = '') {

   if ($sessid != '') {

     return session_id($sessid);

   } else {

     return session_id();

   }

 }



 function tep_session_name($name = '') {

   if ($name != '') {

     return session_name($name);

   } else {

     return session_name();

   }

 }



 function tep_session_close() {

   if (function_exists('session_close')) {

     return session_close();

   }

 }



 function tep_session_destroy() {

   return session_destroy();

 }



 function tep_session_save_path($path = '') {

   if ($path != '') {

     return session_save_path($path);

   } else {

     return session_save_path();

   }

 }

?>

Link to comment
Share on other sites

Hi psytech,

 

I have been informed it is against osCommerce forum rules for me to support this modified store on the osCommerce forums. (understandable)

 

My suggestion is to do a search for that "session error" in the forums as Im sure I have seen that error before.

 

Cheers Lee

Link to comment
Share on other sites

It was too much work for such a little extra, but I wanted it, I needed it, I made it and now you get it:

 

This is the announced extension to Lee's WYSIWYG editor 1.7, which implements the possibility to use the nice image uploading tool not only to add images to WYSIWYG text, but also for managing and selecting the standard images that Osc uses for categories and products.

 

The archive is only a diff to Lee's files, so you will need his contrib first and then install mine right above. Here it is:

http://digilog.de/fremdbilder/osCommerce/C..._1.7_-_DIFF.zip

 

After installation the categories editor looks like this:

 

oscWYSIWYGcategory.gif

 

...and the products editor looks like this:

 

oscWYSIWYGproduct.gif

 

Clicking the little icon above the url line opens Lee's image managing tool

to select a URL and/or to upload and manage new images:

 

oscWYSIWYGinsertimage.gif

 

As you can see, the fields to set layout, spacing, and Alt text are suppressed in this mode.

 

 

This contrib also includes some other minor fixes and changes:

 

- neccessary changes to the path construction in both config.inc.phps that I reported earlier

- the lister.php of htmlArea contained two small bugs that I eliminated

- I widened the image managing dialog a bit to give more room for the directory tree.

 

 

Hope you like it. I think this gives the final polish to the great image managing that came with Lee's contrib.

 

Lee:b

As I said earlier, you are welcome to include these changes into your contrib.

 

 

In case of any bugs or questions I will not be in the office until Tuesday, so don't give up... :)

Jpsy

 

DigiLog multimedia, Saarbr?cken, Germany

Link to comment
Share on other sites

Looks great Jpsy, love the way you implemented into the products image fields, this will allow categorizing images into pre-defined sub or newly created sub folders, such as the "Microsoft, DVD and Matrox Images folders that are already in osCommerce,

 

I noticed that using standard osCommerce image upload button was insufficient (not offence to anyone) but all images uploaded via that feature are limited to having your images placed into the /image root folder, if you wanted to place images in subfolders you would need to do it via FTP or file manger then alter the database path.. (bit annoying really).

 

Just for clarification, HTMLArea is not mine it is Created by http://www.interactivetools.com and its contributors (job well done!)

and based on BSD license, I merly modified some osCommerce files to accomodate it.

 

cheers...Lee

Link to comment
Share on other sites

Just for clarification, HTMLArea is not mine it is Created by http://www.interactivetools.com and its contributors (job well done!) and based on BSD license, I merly modified some osCommerce files to accomodate it.

 

Yes, I know.

And to mention them all: The image manager extension is by David Searles.

 

Interactive Tools did a really great job with their htmlArea! I worked with the MS-HTML editor (the IE extension that htmlArea is based on) myself on several projects. But the work of Interactive Tools is uncompared in completeness and convenience of use. And believe me, that has been no easy going... the MS-HTML editor is a strange beast and quite clumsy!

Jpsy

 

DigiLog multimedia, Saarbr?cken, Germany

Link to comment
Share on other sites

One thing comes to mind, if users of SSL servers (httpS://), use this image upload feature, in both descriptions and products listings and have your product_info.php or default.php on SSL you should be aware that the image uploader assigns a direct path to the image, where-as osCommerce image upload assigns a relative path..(Recommended for SSL)

 

If your product_info.php or default.php are situated on SSL you will get that WARNING about do you wish to display secure and non secure items..

 

if your products_info.php pr default.php is not on a secure server there wont be any problems.

 

Lee

Link to comment
Share on other sites

This should be no problem!

 

My modification scans the path that the image manager returns and if it starts with the Osc image path it is made relative, so Osc can address its images relatively as it did before.

 

Should work for SSL, but I will test it on Tuesday and report.

Jpsy

 

DigiLog multimedia, Saarbr?cken, Germany

Link to comment
Share on other sites

Hei,

 

is there somewhere an installation-instruction for Version 2.2.

I got stuck at point 1.2 becaus the mentioned lines are not in my /admin/categories.php.

 

Hope you can help.

 

Flori

Link to comment
Share on other sites

I need help. I cannot view any images. I have read this entire post and cannot find my problem.

 

When the Insert Image box comes up, it is pointing to the correct folder as I see my directories. In the left box, I get that Red X error box then the directory name. In the right box, I get the standard "Windows Action canceled. Internet Explorer was unable to link to the Web page you requested. The page might be temporarily unavailable. " error message.

 

If I click on one of my directories in the left box, I get the same Windows error in the left box also.

 

Any ideas on my problem?

 

Thanks

Mike

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...