Guest Posted September 6, 2005 Share Posted September 6, 2005 Hello all. I am having a problem with adding images using the viewer for HTML Area. Any link I click in the viewer is dead, and comes back with the following error: "An error has occurred in the script on this page: Line: 35 Char: 4 Error: Access is denied Code: 0 URL: http://MY DOMAIN/catalog/admin/htmlarea/popups/lister.php?DPI=96 Do you want to continue running scripts on this page? Yes/No" The images folder permission is set at 777. Anyone else have this problem? Also, I tried to go to the link provided for the netpbm, but it's dead. Where can I download this? Quote Link to comment Share on other sites More sharing options...
jsinp Posted September 15, 2005 Share Posted September 15, 2005 (edited) After searching this thread and others I have found a solution to the following problems For those of you that are having this error --------------------------------------------------- "An error has occurred in the script on this page: Line: 35 Char: 4 Error: Access is denied Code: 0 URL: http://MY DOMAIN/catalog/admin/htmlarea/popups/lister.php?DPI=96 Do you want to continue running scripts on this page? ------------------------------------------------------- And get this error when resizing resulting in a 0kb file "Image YOURIMAGE resized to x" -------------------------------------------------------- I used code from two different posts to modify my original /catalog/admin/htmlarea/popups/config.inc.php from the maxidvd upload one piece helped me overcome the access is denied by adjusting the // return the URL piece of code seems to be a problem with shared hosting and or shared ssl This allowed me to select the correct pic as it properly inserted the correct image url But I was still unable to resize my jpg s To fix this a modification was done to the path of netpbm and the code that selected the proper script to run to change the pics Now everytHing works GREAT! The parts I modified are enclosed by // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 so you can see what was changed ********************************************************************** IMPORTANT DONT TRY TO ADD THIS CHANGE IF YOU ARE NOT HAVING PROBLEMS TRY THE NORMAL INSTALL FIRST AND IF YOU HAVE THESE SPECIFIC PROBLEMS USE THIS CONFIG.INC.PHP OR YOU WILL CAUSE YOURSELF PROBLEMS. ******************************************************************** Thanks to jim d and goring gap for the solutions also for those of you looking for the netpbm files here is the link to sourceforge.net http://sourceforge.net/project/showfiles.php?group_id=7130 I am using the netpbm_gallery-1.4-pl2-linux-intel version way down at the bottom. just unzip and upload this files into your netpbm directory and remember to change the permision to 755 or 777 Hope this helps some one here is the conifg.inc.php <?php require('../../includes/configure.php'); /* ** Change ONLY the following lines to match your server setup */ // CONSTRAIN_* indicates the image constraints used to scale uploads (0 = none) define("CONSTRAIN_HEIGHT", 0); define("CONSTRAIN_WIDTH", 0); // IMAGE_DIR and IMAGE_URL identify the Image directory "root" (MUST end in "/") // Do NOT include "http://my.hostname.com" in IMAGE_URL; just the path from the // DocumentRoot of your webserver. define("IMAGE_DIR", trim(DIR_FS_CATALOG . DIR_WS_IMAGES)); define("IMAGE_URL", trim(DIR_WS_CATALOG_IMAGES)); // NETPBM_DIR identifies the directory where NETPBM is located (MUST end in "/") // Not used if either CONSTRAIN_HEIGHT or CONSTRAIN_WIDTH (above) is specified as "0". // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 //define("NETPBM_DIR", trim(DIR_FS_CATALOG)); define("NETPBM_DIR", trim(DIR_FS_CATALOG . "/netpbm/")); // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 // SCRIPT_DIR and SCRIPT_URL identify where these scripts reside (MUST end in "/") // Do NOT include "http://my.hostname.com" in SCRIPT_URL; just the path from the // DocumentRoot of your webserver. define("SCRIPT_DIR", trim(DIR_FS_ADMIN . "htmlarea/popups/")); define("SCRIPT_URL", trim(DIR_WS_ADMIN . "htmlarea/popups/")); // SUPPORT_* identify optional features define("SUPPORT_BITMAP", TRUE); // supported by Internet Explorer ONLY! define("SUPPORT_CREATE", TRUE); define("SUPPORT_DELETE", TRUE); define("SUPPORT_METAFILE", TRUE);// supported by Internet Explorer ONLY! define("SUPPORT_UPLOAD", TRUE); // UPLOAD_LIMIT indicates the maximum file size (in BYTES!) which can be uploaded (0 = unlimited) define("UPLOAD_LIMIT", 0); /* ** Change ONLY the preceeding lines to match your server setup */ /* ** DO NOT CHANGE beyond this point UNLESS you have ** modified 'insert_image.html' OR any of the scripts */ $dpi = 0; if(isset($HTTP_GET_VARS["DPI"])) { $dpi = $HTTP_GET_VARS["DPI"]; } else if(isset($HTTP_POST_VARS["DPI"])) { $dpi = $HTTP_POST_VARS["DPI"]; } if($dpi < 72 || $dpi > 150) $dpi = 96; // AGENT_DPI identifies the DPI setting being used by the web browser define("AGENT_DPI", $dpi); // ICON_* identify the icons to be used by the "tree" pane define("ICON_CLOSED", "closed.gif"); define("ICON_INDENT", "indent.gif"); define("ICON_OPENED", "opened.gif"); define("ICON_BMP", "bmp.gif"); define("ICON_GIF", "gif.gif"); define("ICON_JPG", "jpg.gif"); define("ICON_PNG", "png.gif"); define("ICON_WMF", "wmf.gif"); // IMAGE_* identify the image type values (most returned by PHP's getImageSize) define("IMAGE_BMP", 6); define("IMAGE_GIF", 1); define("IMAGE_JPG", 2); define("IMAGE_PNG", 3); define("IMAGE_WMF", 42); // LISTER_* identify elements used by the "tree" pane define("LISTER_DELETE", "font: italic 7pt 'MS Shell Dlg', Helvetica, sans-serif;"); define("LISTER_NAME", "lister"); define("LISTER_PADDING", "4"); define("LISTER_SPACING", "0"); define("LISTER_STYLE", "font: 8pt 'MS Shell Dlg', Helvetica, sans-serif;"); define("LISTER_TAG", "IFRAME"); // MANAGER_* identify elements used to connect the panes to the "action" form define("MANAGER_NAME", "manager"); define("MANAGER_SRC", "txtFileName"); define("MANAGER_TAG", "TABLE"); // METAFILE_* indentify constants used in decoding Placeable Metafile Headers define("METAFILE_DPI", 96); define("METAFILE_KEY", "9ac6cdd7"); // NETPBM_* indentify commands used in image constraining (WMFs cannot be constrained!) // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 start //define("NETPBM_BMP", "bmptopnm \"%s\" | pnmscale %s | ppmtobmp >\"%s\""); //define("NETPBM_GIF", "giftopnm \"%s\" | pnmscale %s | ppmtogif >\"%s\""); //define("NETPBM_JPG", "jpegtopnm \"%s\" | pnmscale %s | pnmtojpeg >\"%s\""); //define("NETPBM_PNG", "pngtopnm \"%s\" | pnmscale %s | pnmtopng >\"%s\""); define("NETPBM_BMP", NETPBM_DIR . "bmptopnm \"%s\" | " . NETPBM_DIR . "pnmscale %s | " . NETPBM_DIR . "ppmtobmp > \"%s\""); define("NETPBM_GIF", NETPBM_DIR . "giftopnm \"%s\" | " . NETPBM_DIR . "pnmscale %s | " . NETPBM_DIR . "ppmtogif > \"%s\""); define("NETPBM_JPG", NETPBM_DIR . "jpegtopnm \"%s\" | " . NETPBM_DIR . "pnmscale %s | " . NETPBM_DIR . "pnmtojpeg > \"%s\""); define("NETPBM_PNG", NETPBM_DIR . "pngtopnm \"%s\" | " . NETPBM_DIR . "pnmscale %s | " . NETPBM_DIR . "pnmtopng > \"%s\""); // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 end // PANE_* identify the geometry and conversion factors used by the panes define("PANE_XFACTOR", ((AGENT_DPI == 96) ? 1 : (AGENT_DPI / ((AGENT_DPI < 96) ? 95 : 97.5)))); define("PANE_YFACTOR", ((AGENT_DPI == 96) ? 1 : (AGENT_DPI / ((AGENT_DPI < 96) ? 95 : 99.5)))); define("PANE_HEIGHT", floor((115 * PANE_YFACTOR))); define("PANE_LABEL", ceil((35 * PANE_YFACTOR))); define("PANE_WIDTH", floor((200 * PANE_XFACTOR))); // TEXT_* identify literal text used by the "tree" and "preview" panes define("TEXT_DELETE", "[delete]"); define("TEXT_ROOT", "Images Root"); define("TEXT_SELECT", "<i>No<br>Image<br>Selected<br>for<br>Preview</i>"); // VIEWER_* identify elements used by the "preview" pane define("VIEWER_NAME", "viewer"); define("VIEWER_NONE", "font: italic 12pt 'MS Shell Dlg', Helvetica, sans-serif;"); define("VIEWER_PADDING", "2"); define("VIEWER_SPACING", "0"); define("VIEWER_STYLE", "font: 8pt 'MS Shell Dlg', Helvetica, sans-serif; background-color: #c0c0c0;"); define("VIEWER_TAG", "IFRAME"); // WRAPPER_* identify elements used to connect the "tree" and "preview" panes define("WRAPPER_NAME", "wrapper"); define("WRAPPER_TAG", "TABLE"); /* ** Globals */ $base = ""; $dirs = array(); $error = ""; $info = ""; /* ** Returns a complete Path from the Base. ** ** Params: $path - Path to complete ** $nodes - Count of Nodes to include */ function basePath($path, $nodes = 999) { global $base, $dirs; // initialize context $result = ""; $count = count($dirs); // for ALL desired Nodes ... for($index = 0; $nodes > 0 && $index < $nodes && $index < $count; $index++) // ... if Node is NOT null ... if(strlen($dirs[$index]) > 0) // ... append the Node and separator $result .= $dirs[$index] . "/"; // append the Path $result .= $path; // return the Path return $result; } /* ** Parses, cleans and sets the Base path. ** ** Params: $path - Path to parse and clean */ function cleanPath($path) { global $dirs, $base; // initialize context $nodes = 0; $clean = ""; // parse the Path $dirs = split('[/\\]', "$path"); // for ALL Directories in the Path ... foreach($dirs as $dir) { // ... if this is a Relative path ... if(!(strcmp($dir, ".."))) { // ... if NOT at the ROOT ... if($nodes > 1) // ... decrement Node depth $nodes--; } // ... otherwise, if Directory is NOT null ... else if(strlen($dir) > 0) { // ... based on Node depth ... switch($nodes++) { default: // ... append a Path separator $clean .= "/"; // // fall-thru is intentional // case 0: // ... append the Directory $clean .= $dir; break; } } } // re-parse the Path (w/o any relative nodes!) $dirs = split('[/\\]', "$clean"); $base = implode("/", $dirs); // return the Path return $dirs; } /* ** Returns a fully-qualified URL for the specified Image file ** ** Params: $path - Path to Image ** $encode - TRUE if URL is to be encoded; FALSE otherwise ** ** Returns: Fully-qualified URL */ function imageInfo($path) { // if Image info is NOT available ... if(!($size = @getImageSize($path))) { // ... if Metafile support is desired AND File opens ... if(SUPPORT_METAFILE && ($fp = fopen($path, "rb"))) { // ... read the File $key = readDWORD($fp); // if File is a Windows Metafile (WMF) ... if(!(strcasecmp(dechex($key), METAFILE_KEY))) { // ... read remainder of WMF header readWORD($fp); $x2 = readSHORT($fp); $y2 = readSHORT($fp); $x = readSHORT($fp); $y = readSHORT($fp); $inch = readWORD($fp); // calculate the size $width = abs(($x2 - $x)); $height = abs(($y2 - $y)); $width = round((($width * METAFILE_DPI) / $inch)); $height = round((($height * METAFILE_DPI) / $inch)); // return the Info $size = array($width, $height, IMAGE_WMF, "width=\"$width\" height=\"$height\""); } // close the File fclose($fp); } } // return the Info return $size; } /* ** Returns a fully-qualified URL for the specified Image file ** ** Params: $path - Path to Image ** $encode - TRUE if URL is to be encoded; FALSE otherwise ** ** Returns: Fully-qualified URL */ function imageURL($path, $encode = FALSE) { global $HTTP_SERVER_VARS; // initialize context $url = (IMAGE_URL . $path); // if URL is to be encoded ... if($encode) { // ... encode the URL $url = rawurlencode($url); $url = str_replace("%2F", "/", $url); } // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 // return the URL //return ("http://" . $HTTP_SERVER_VARS["HTTP_HOST"] . $url); return ( ((getenv('HTTPS') == 'on' or getenv('SERVER_PORT') == 443) ? "https://" : "http://") . $HTTP_SERVER_VARS["HTTP_HOST"] . $url); // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 } /* ** Returns the Windows status. ** ** Returns: TRUE if server is Windows hosted; FALSE otherwise */ function isWindows() { global $HTTP_SERVER_VARS; // return the Windows status return isset($HTTP_SERVER_VARS["WINDIR"]); } /* ** Reads a BYTE from the specified file. ** ** Params: $fp - File to read ** ** Returns: BYTE read */ function readBYTE($fp) { // return the BYTE return ord(@fread($fp, 1)); } /* ** Reads a DWORD from the specified file. ** ** Params: $fp - File to read ** ** Returns: DWORD read */ function readDWORD($fp) { // create the DWORD $lo = readWORD($fp); $hi = readWORD($fp); $dword = (($hi << 16) | $lo); // return the DWORD return $dword; } /* ** Reads a SHORT from the specified file. ** ** Params: $fp - File to read ** ** Returns: SHORT read */ function readSHORT($fp) { // create the SHORT $short = readWORD($fp); // if SHORT is signed ... if($short & 0x8000) // ... make it negative $short |= 0xffff0000; // return the SHORT return $short; } /* ** Reads a WORD from the specified file. ** ** Params: $fp - File to read ** ** Returns: WORD read */ function readWORD($fp) { // create the WORD $lo = readBYTE($fp); $hi = readBYTE($fp); $word = (($hi << 8) | $lo); // return the WORD return $word; } /* ** Returns a fully-qualified URL for the specified Script ** ** Params: $path - Path to Script ** $encode - TRUE if URL is to be encoded; FALSE otherwise ** ** Returns: Fully-qualified URL */ function scriptURL($path, $encode = FALSE) { global $HTTP_SERVER_VARS; // initialize context $url = (SCRIPT_URL . $path); // if URL is to be encoded ... if($encode) { // ... encode the URL $url = rawurlencode($url); $url = str_replace("%2F", "/", $url); } // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 // return the URL //return ("http://" . $HTTP_SERVER_VARS["HTTP_HOST"] . $url); return ( ((getenv('HTTPS') == 'on' or getenv('SERVER_PORT') == 443) ? "https://" : "http://") . $HTTP_SERVER_VARS["HTTP_HOST"] . $url); // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 } ?> <meta http-equiv="expires" content="0"> <meta http-equiv="Pragma" content="no-cache"> <script language="javascript"> function findAncestor(element, name, type) { while(element != null && (element.name != name || element.tagName != type)) element = element.parentElement; return element; } </script> Edited September 15, 2005 by jsinp Quote Link to comment Share on other sites More sharing options...
Tato Posted September 17, 2005 Share Posted September 17, 2005 HI All, I know this is really simple but need you help as i am not sure how to do it. So far all is well with this contribution.. the problem i am having is when i add new images to my folder and then go to the browse button to select that new image it will show at the bottom of the list, as the latest image. but i would like to show it in either accending or decending order as i have them in alaphnumeric names for the images. eg MV00001.jpg, MV00002.jpg, MV00003.jpg etc... at the moment i am getting like MV00001.jpg, MV00258.jpg, MV00002.jpg etc... So i have to scroll up or down to look for the image and sometimes it's there but i have missed it cos of so many numbers. Thanks for any help.. <{POST_SNAPBACK}> Hi all, I have the same problem, anyone can help us ? Thanks Quote Link to comment Share on other sites More sharing options...
day2 Posted September 28, 2005 Share Posted September 28, 2005 i just installed version 2.1. got some problem: http://www.mmo.net.my/store/ 1) This appear in my index.php: Warning: main(includes/languages/english/FILENAME_define_mainpage): failed to open stream: No such file or directory in /home/mmonet/public_html/store/index.php on line 310 Warning: main(includes/languages/english/FILENAME_define_mainpage): failed to open stream: No such file or directory in /home/mmonet/public_html/store/index.php on line 310 Warning: main(): Failed opening 'includes/languages/english/FILENAME_define_mainpage' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mmonet/public_html/store/index.php on line 310 i donno what happened. 2) My information box have repeative text. Can anyone help? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 1, 2005 Share Posted October 1, 2005 I need help m8's, I am installing this contribution, But i get problems when i does this explained in the read me file: 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 directly UNDERNEATH IT add this: ================================================================================ ==== } 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 @@@@@@@@@@@@@@@@@@@@@@ After uploaded this file back with ftp i get alot of text in the admin/categories.php Something is wrong, but cant figur it out. This is the code after edited everything in the categories.php file: <?php/* $Id: categories.php,v 1.146 2003/07/11 14:40:27 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'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'setflag': if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) { if (isset($HTTP_GET_VARS['pID'])) { tep_set_product_status($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['flag']); } if (USE_CACHE == 'true') { tep_reset_cache_block('categories'); tep_reset_cache_block('also_purchased'); } } tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID'])); break; case 'insert_category': case 'update_category': if (isset($HTTP_POST_VARS['categories_id'])) $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']); $sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']); $sql_data_array = array('sort_order' => $sort_order); if ($action == 'insert_category') { $insert_sql_data = array('parent_id' => $current_category_id, 'date_added' => 'now()'); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); tep_db_perform(TABLE_CATEGORIES, $sql_data_array); $categories_id = tep_db_insert_id(); } elseif ($action == 'update_category') { $update_sql_data = array('last_modified' => 'now()'); $sql_data_array = array_merge($sql_data_array, $update_sql_data); tep_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "'"); } $languages = tep_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $categories_name_array = $HTTP_POST_VARS['categories_name']; $language_id = $languages[$i]['id']; $sql_data_array = array('categories_name' => tep_db_prepare_input($categories_name_array[$language_id])); if ($action == 'insert_category') { $insert_sql_data = array('categories_id' => $categories_id, 'language_id' => $languages[$i]['id']); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array); } elseif ($action == 'update_category') { tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'"); } } 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 . "'"); } } if (USE_CACHE == 'true') { tep_reset_cache_block('categories'); tep_reset_cache_block('also_purchased'); } tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id)); break; case 'delete_category_confirm': if (isset($HTTP_POST_VARS['categories_id'])) { $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']); $categories = tep_get_category_tree($categories_id, '', '0', '', true); $products = array(); $products_delete = array(); for ($i=0, $n=sizeof($categories); $i<$n; $i++) { $product_ids_query = tep_db_query("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$categories[$i]['id'] . "'"); while ($product_ids = tep_db_fetch_array($product_ids_query)) { $products[$product_ids['products_id']]['categories'][] = $categories[$i]['id']; } } reset($products); while (list($key, $value) = each($products)) { $category_ids = ''; for ($i=0, $n=sizeof($value['categories']); $i<$n; $i++) { $category_ids .= "'" . (int)$value['categories'][$i] . "', "; } $category_ids = substr($category_ids, 0, -2); $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$key . "' and categories_id not in (" . $category_ids . ")"); $check = tep_db_fetch_array($check_query); if ($check['total'] < '1') { $products_delete[$key] = $key; } } // removing categories can be a lengthy process tep_set_time_limit(0); for ($i=0, $n=sizeof($categories); $i<$n; $i++) { tep_remove_category($categories[$i]['id']); } reset($products_delete); while (list($key) = each($products_delete)) { tep_remove_product($key); } } if (USE_CACHE == 'true') { tep_reset_cache_block('categories'); tep_reset_cache_block('also_purchased'); } tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath)); break; case 'delete_product_confirm': if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['product_categories']) && is_array($HTTP_POST_VARS['product_categories'])) { $product_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); $product_categories = $HTTP_POST_VARS['product_categories']; for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) { tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "' and categories_id = '" . (int)$product_categories[$i] . "'"); } $product_categories_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "'"); $product_categories = tep_db_fetch_array($product_categories_query); if ($product_categories['total'] == '0') { tep_remove_product($product_id); } } if (USE_CACHE == 'true') { tep_reset_cache_block('categories'); tep_reset_cache_block('also_purchased'); } tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath)); break; case 'move_category_confirm': if (isset($HTTP_POST_VARS['categories_id']) && ($HTTP_POST_VARS['categories_id'] != $HTTP_POST_VARS['move_to_category_id'])) { $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']); $new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']); $path = explode('_', tep_get_generated_category_path_ids($new_parent_id)); if (in_array($categories_id, $path)) { $messageStack->add_session(ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT, 'error'); tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id)); } else { tep_db_query("update " . TABLE_CATEGORIES . " set parent_id = '" . (int)$new_parent_id . "', last_modified = now() where categories_id = '" . (int)$categories_id . "'"); if (USE_CACHE == 'true') { tep_reset_cache_block('categories'); tep_reset_cache_block('also_purchased'); } tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id . '&cID=' . $categories_id)); } } break; case 'move_product_confirm': $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); $new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']); $duplicate_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$new_parent_id . "'"); $duplicate_check = tep_db_fetch_array($duplicate_check_query); if ($duplicate_check['total'] < 1) tep_db_query("update " . TABLE_PRODUCTS_TO_CATEGORIES . " set categories_id = '" . (int)$new_parent_id . "' where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$current_category_id . "'"); if (USE_CACHE == 'true') { tep_reset_cache_block('categories'); tep_reset_cache_block('also_purchased'); } tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id . '&pID=' . $products_id)); break; case 'insert_product': case 'update_product': if (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) { $action = 'new_product'; } else { if (isset($HTTP_GET_VARS['pID'])) $products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']); $products_date_available = tep_db_prepare_input($HTTP_POST_VARS['products_date_available']); $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null'; $sql_data_array = array('products_quantity' => tep_db_prepare_input($HTTP_POST_VARS['products_quantity']), 'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']), 'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']), 'products_date_available' => $products_date_available, 'products_weight' => tep_db_prepare_input($HTTP_POST_VARS['products_weight']), 'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']), 'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']), 'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id'])); if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) { $sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['products_image']); } if ($action == 'insert_product') { $insert_sql_data = array('products_date_added' => 'now()'); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); tep_db_perform(TABLE_PRODUCTS, $sql_data_array); $products_id = tep_db_insert_id(); tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$current_category_id . "')"); } elseif ($action == 'update_product') { $update_sql_data = array('products_last_modified' => 'now()'); $sql_data_array = array_merge($sql_data_array, $update_sql_data); tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'"); } $languages = tep_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $language_id = $languages[$i]['id']; $sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]), 'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]), 'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id])); if ($action == 'insert_product') { $insert_sql_data = array('products_id' => $products_id, 'language_id' => $language_id); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array); } elseif ($action == 'update_product') { tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'"); } } if (USE_CACHE == 'true') { tep_reset_cache_block('categories'); tep_reset_cache_block('also_purchased'); } tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id)); } break; case 'copy_to_confirm': if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['categories_id'])) { $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']); if ($HTTP_POST_VARS['copy_as'] == 'link') { if ($categories_id != $current_category_id) { $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$categories_id . "'"); $check = tep_db_fetch_array($check_query); if ($check['total'] < '1') { tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$categories_id . "')"); } } else { $messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error'); } } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') { $product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); $product = tep_db_fetch_array($product_query); tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')"); $dup_products_id = tep_db_insert_id(); $description_query = tep_db_query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'"); while ($description = tep_db_fetch_array($description_query)) { tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0')"); } tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')"); $products_id = $dup_products_id; } if (USE_CACHE == 'true') { tep_reset_cache_block('categories'); tep_reset_cache_block('also_purchased'); } } tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $categories_id . '&pID=' . $products_id)); break; case 'new_product_preview': if (HTML_AREA_WYSIWYG_DISABLE == 'Disable') { // 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'] : ''); } } 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; } } // check if the catalog image directory exists if (is_dir(DIR_FS_CATALOG_IMAGES)) { if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error'); } else { $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error'); }?><!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"><html <?php echo HTML_PARAMS; ?>><head><meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"><title><?php echo TITLE; ?></title> <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><link rel="stylesheet" type="text/css" href="includes/stylesheet.css"><script language="javascript" src="includes/general.js"></script></head><body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="SetFocus();"><div id="spiffycalendar" class="text"></div><!-- header //--><?php require(DIR_WS_INCLUDES . 'header.php'); ?><!-- header_eof //--> <!-- body //--><table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"><!-- left_navigation //--><?php require(DIR_WS_INCLUDES . 'column_left.php'); ?><!-- left_navigation_eof //--> </table></td><!-- body_text //--> <td width="100%" valign="top"><?php if ($action == 'new_product') { $parameters = array('products_name' => '', 'products_description' => '', 'products_url' => '', 'products_id' => '', 'products_quantity' => '', 'products_model' => '', 'products_image' => '', 'products_price' => '', 'products_weight' => '', 'products_date_added' => '', 'products_last_modified' => '', 'products_date_available' => '', 'products_status' => '', 'products_tax_class_id' => '', 'manufacturers_id' => ''); $pInfo = new objectInfo($parameters); if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) { $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, 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 " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product = tep_db_fetch_array($product_query); $pInfo->objectInfo($product); } elseif (tep_not_null($HTTP_POST_VARS)) { $pInfo->objectInfo($HTTP_POST_VARS); $products_name = $HTTP_POST_VARS['products_name']; $products_description = $HTTP_POST_VARS['products_description']; $products_url = $HTTP_POST_VARS['products_url']; } $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE)); $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']); } $tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE)); $tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title"); while ($tax_class = tep_db_fetch_array($tax_class_query)) { $tax_class_array[] = array('id' => $tax_class['tax_class_id'], 'text' => $tax_class['tax_class_title']); } $languages = tep_get_languages(); if (!isset($pInfo->products_status)) $pInfo->products_status = '1'; switch ($pInfo->products_status) { case '0': $in_status = false; $out_status = true; break; case '1': default: $in_status = true; $out_status = false; }?><link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css"><script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script><script language="javascript"><!-- var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);//--></script><script language="javascript"><!--var tax_rates = new Array();<?php for ($i=0, $n=sizeof($tax_class_array); $i<$n; $i++) { if ($tax_class_array[$i]['id'] > 0) { echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . tep_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n"; } }?> function doRound(x, places) { return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);} function getTaxRate() { var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex; var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value; if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) { return tax_rates[parameterVal]; } else { return 0; }} function updateGross() { var taxRate = getTaxRate(); var grossValue = document.forms["new_product"].products_price.value; if (taxRate > 0) { grossValue = grossValue * ((taxRate / 100) + 1); } document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);} function updateNet() { var taxRate = getTaxRate(); var netValue = document.forms["new_product"].products_price_gross.value; if (taxRate > 0) { netValue = netValue / ((taxRate / 100) + 1); } document.forms["new_product"].products_price.value = doRound(netValue, 4);}//--></script> <?php echo tep_draw_form('new_product', FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=new_product_preview', 'post', 'enctype="multipart/form-data"'); ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo sprintf(TEXT_NEW_PRODUCT, tep_output_generated_category_path($current_category_id)); ?></td> <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main"><?php echo TEXT_PRODUCTS_STATUS; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_radio_field('products_status', '1', $in_status) . ' ' . TEXT_PRODUCT_AVAILABLE . ' ' . tep_draw_radio_field('products_status', '0', $out_status) . ' ' . TEXT_PRODUCT_NOT_AVAILABLE; ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br><small>(YYYY-MM-DD)</small></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' '; ?><script language="javascript">dateAvailable.writeControl(); dateAvailable.dateFormat="yyyy-MM-dd";</script></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr><?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) {?> <tr> <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?></td> <td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? $products_name[$languages[$i]['id']] : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr><?php }?> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr bgcolor="#ebebff"> <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td> </tr> <tr bgcolor="#ebebff"> <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td> </tr> <tr bgcolor="#ebebff"> <td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp="updateNet()"'); ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr><script language="javascript"><!--updateGross();//--></script><?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) {?> <tr> <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td> <td><table border="0" cellspacing="0" cellpadding="0"> <tr> <td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td> <td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? $products_description[$languages[$i]['id']] : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr> </table></td> </tr><?php }?> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_quantity', $pInfo->products_quantity); ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_PRODUCTS_MODEL; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_model', $pInfo->products_model); ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_PRODUCTS_IMAGE; ?></td> <?php if (HTML_AREA_WYSIWYG_DISABLE == 'Disable') { ?> <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> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr><?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) {?> <tr> <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_URL . '<br><small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?></td> <td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('products_url[' . $languages[$i]['id'] . ']', (isset($products_url[$languages[$i]['id']]) ? $products_url[$languages[$i]['id']] : tep_get_products_url($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr><?php }?> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_weight', $pInfo->products_weight); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main" align="right"><?php echo tep_draw_hidden_field('products_date_added', (tep_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td> </tr> </table></form> <?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) ?>'; editor_generate('products_image',config); </script><?php } ?> <?php } elseif ($action == 'new_product_preview') { if (tep_not_null($HTTP_POST_VARS)) { $pInfo = new objectInfo($HTTP_POST_VARS); $products_name = $HTTP_POST_VARS['products_name']; $products_description = $HTTP_POST_VARS['products_description']; $products_url = $HTTP_POST_VARS['products_url']; } else { $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'"); $product = tep_db_fetch_array($product_query); $pInfo = new objectInfo($product); $products_image_name = $pInfo->products_image; } $form_action = (isset($HTTP_GET_VARS['pID'])) ? 'update_product' : 'insert_product'; echo tep_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"'); $languages = tep_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { if (isset($HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) { $pInfo->products_name = tep_get_products_name($pInfo->products_id, $languages[$i]['id']); $pInfo->products_description = tep_get_products_description($pInfo->products_id, $languages[$i]['id']); $pInfo->products_url = tep_get_products_url($pInfo->products_id, $languages[$i]['id']); } else { $pInfo->products_name = tep_db_prepare_input($products_name[$languages[$i]['id']]); $pInfo->products_description = tep_db_prepare_input($products_description[$languages[$i]['id']]); $pInfo->products_url = tep_db_prepare_input($products_url[$languages[$i]['id']]); }?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $pInfo->products_name; ?></td> <td class="pageHeading" align="right"><?php echo $currencies->format($pInfo->products_price); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->products_description; ?></td> </tr><?php if ($pInfo->products_url) {?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo sprintf(TEXT_PRODUCT_MORE_INFORMATION, $pInfo->products_url); ?></td> </tr><?php }?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr><?php if ($pInfo->products_date_available > date('Y-m-d')) {< Quote Link to comment Share on other sites More sharing options...
Guest Posted October 3, 2005 Share Posted October 3, 2005 jsinp :thumbsup: , great fix... I cant tell you how many hours I spent trying to debug.... i dont see why the thing isnt built on relative URL's (unless specifed as otherwise) to begin with..... thnks!... as soon as I saw the code you wrote, I knew it would work.... still kicking myself, but clicking heels too :D Quote Link to comment Share on other sites More sharing options...
Guest Posted October 3, 2005 Share Posted October 3, 2005 jsinp :thumbsup: , great fix... I cant tell you how many hours I spent trying to debug.... i dont see why the thing isnt built on relative URL's (unless specifed as otherwise) to begin with..... thnks!... as soon as I saw the code you wrote, I knew it would work.... still kicking myself, but clicking heels too :D PS -- THE SSL IS NOT A SHARED CERT... ITS A DEDICATED ONE SPECIFICALLY FOR THE DOMAIN..... I ENCONTER THE SAME PROBLEM ON CLIENT'S SITES THAT USE OUR SHARED SSL TOO... I believe the code can be re-written so that is uses relative paths, instead of caring whether it's http or https... who cares.... just put the image path :rolleyes: Quote Link to comment Share on other sites More sharing options...
Guest Posted November 9, 2005 Share Posted November 9, 2005 Hi All, I have the same problem as ASA100 and Satnor: eg in admin/categories I see the text that is suposed to be inserted as per the installation instructions. This has as a result that I cannot ad images to categories. I tried the already offered solutions ( ading and removing '<?' without results. Does any one have an idea what the cause can be? Many thanks Best regards Geeraard :'( Quote Link to comment Share on other sites More sharing options...
primadude Posted November 10, 2005 Share Posted November 10, 2005 I am interested in this contribution for my site. Can someone point me to a working site that has this contribution installed so I can take a look see?? Thanks, Joe Quote Link to comment Share on other sites More sharing options...
Guest Posted November 10, 2005 Share Posted November 10, 2005 MaxiDVD and UltraPics Sample - Bad Boy Buggy Quote Link to comment Share on other sites More sharing options...
Guest Posted November 14, 2005 Share Posted November 14, 2005 Hi All, I have the same problem as ASA100 and Satnor: eg in admin/categories I see the text that is suposed to be inserted as per the installation instructions. This has as a result that I cannot ad images to categories. I tried the already offered solutions ( ading and removing '<?' without results. Does any one have an idea what the cause can be? Many thanks Best regards Geeraard :'( Hi all, I have 1 solution for the above problem: It solves the appearance of html text in te admin/catalog area. The instructions from this contribution on how to ad the necessary html code are faulty on this part, so I compared the code with the code of the categories.php page that is in the package. This should be the result: } 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> '; } } } ?> </tr> </table></td> </tr> </table> <?php =================================================================== The only problem I still have is that when I upload a category image, the program always says: no image found. If some-one has a solution for that, please let me know :) =================================================================== !!!PLEASE BE ADVISED THAT THE USE OF THE ABOVE CODE IS AT YOUR OWN RISK!!! !!! ALWAYS FIRST CREATE A BACKUP OF YOUR ORIGINAL FILE !!! =================================================================== Grtz, Geeraard Quote Link to comment Share on other sites More sharing options...
Guest Posted November 14, 2005 Share Posted November 14, 2005 Hi all, I have 1 solution for the above problem: It solves the appearance of html text in te admin/catalog area. The instructions from this contribution on how to ad the necessary html code are faulty on this part, so I compared the code with the code of the categories.php page that is in the package. This should be the result: } 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> '; } } } ?> </tr> </table></td> </tr> </table> <?php =================================================================== The only problem I still have is that when I upload a category image, the program always says: no image found. If some-one has a solution for that, please let me know :) =================================================================== !!!PLEASE BE ADVISED THAT THE USE OF THE ABOVE CODE IS AT YOUR OWN RISK!!! !!! ALWAYS FIRST CREATE A BACKUP OF YOUR ORIGINAL FILE !!! =================================================================== Grtz, Geeraard Me again :D The problem about the uploading of an image is already solved on the contrybutionpage. Please go to: http://www.oscommerce.com/community/contri.../search,wysiwyg and upload wysiwygfix from Richard Sue. It works fine for me :) Many thanks for this great contrib! Grtz, Geeraard Quote Link to comment Share on other sites More sharing options...
primadude Posted November 15, 2005 Share Posted November 15, 2005 I wanted to start off here with saying that this is an AWESOME contribution. It is exactly what I need and I believe it is one of the premier contributions for osCommerce. I implemented the matest consolidated UltraPics into my local development site on my Windows workstation with absolutely no problems. After a day of testing I went for the upload to my hosted site. Everything is functional on my hosted site except for the fact that I am using a shared SSL cert and this is causing me issues in the admin area when adding an image to products. I have scoured this thread and have read closely the post from user JSINP but am still having a problem. When I select an image, everything looks normal in the two Image Manager fields except the "Image URL" field at the bottom contains the SSL path to the file. It needs to be the non-SSL path to the image. Also, the link is broken when you preview it so I end up manually editing the path to make it work for non-ssl on the site. Here is how I have configured my hosted site /admin/includes/configure.php to SSL encrypt my osCommerce Admin pages: // Define the webserver and path parameters // * DIR_FS_* = Filesystem directories (local/physical) // * DIR_WS_* = Webserver directories (virtual/URL) define('HTTP_SERVER', 'https://host123.ipowerweb.com'); define('HTTP_CATALOG_SERVER', 'https://host123.ipowerweb.com'); define('HTTPS_CATALOG_SERVER', 'https://host123.ipowerweb.com'); define('ENABLE_SSL_CATALOG', true); // secure webserver for catalog module define('DIR_FS_DOCUMENT_ROOT', '/home/mysite/public_html/'); // where the pages are located on the server define('DIR_WS_ADMIN', '/~mysite/admin/'); // absolute path required define('DIR_FS_ADMIN', '/home/mysite/public_html/admin/'); // absolute path required define('DIR_WS_CATALOG', '/~mysite/'); // absolute path required define('DIR_FS_CATALOG', '/home/mysite/public_html/'); // absolute path required define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . '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_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/'); define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/'); ---------------------------- Here is my /admin/htmlarea/popups/config.inc.php <?php require('../../includes/configure.php'); /* ** Change ONLY the following lines to match your server setup */ // CONSTRAIN_* indicates the image constraints used to scale uploads (0 = none) define("CONSTRAIN_HEIGHT", 0); define("CONSTRAIN_WIDTH", 0); // IMAGE_DIR and IMAGE_URL identify the Image directory "root" (MUST end in "/") // Do NOT include "http://my.hostname.com" in IMAGE_URL; just the path from the // DocumentRoot of your webserver. define("IMAGE_DIR", trim(DIR_FS_CATALOG . DIR_WS_IMAGES)); define("IMAGE_URL", trim(DIR_WS_CATALOG_IMAGES)); // NETPBM_DIR identifies the directory where NETPBM is located (MUST end in "/") // Not used if either CONSTRAIN_HEIGHT or CONSTRAIN_WIDTH (above) is specified as "0". // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 define("NETPBM_DIR", trim(DIR_FS_CATALOG . "netpbm/")); // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 // SCRIPT_DIR and SCRIPT_URL identify where these scripts reside (MUST end in "/") // Do NOT include "http://my.hostname.com" in SCRIPT_URL; just the path from the // DocumentRoot of your webserver. define("SCRIPT_DIR", trim(DIR_FS_ADMIN . "htmlarea/popups/")); define("SCRIPT_URL", trim(DIR_WS_ADMIN . "htmlarea/popups/")); // SUPPORT_* identify optional features define("SUPPORT_BITMAP", TRUE); // supported by Internet Explorer ONLY! define("SUPPORT_CREATE", TRUE); define("SUPPORT_DELETE", TRUE); define("SUPPORT_METAFILE", TRUE);// supported by Internet Explorer ONLY! define("SUPPORT_UPLOAD", TRUE); // UPLOAD_LIMIT indicates the maximum file size (in BYTES!) which can be uploaded (0 = unlimited) define("UPLOAD_LIMIT", 0); ... and further down below: return ( ((getenv('HTTPS') == 'on' or getenv('SERVER_PORT') == 443) ? "https://" : "http://") . $HTTP_SERVER_VARS["HTTP_HOST"] . $url); // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 ... and further down below: return ( ((getenv('HTTPS') == 'on' or getenv('SERVER_PORT') == 443) ? "https://" : "http://") . $HTTP_SERVER_VARS["HTTP_HOST"] . $url); } // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 ---------------------------------------------- So what am I missing here with my shared SSL site that I have configured my osCommerce Admin area for shared SSL also...I feel I am very close but the issue escapes me. Any help here would be greatly appreciated. Thanks, Joe Quote Link to comment Share on other sites More sharing options...
Macfionn Posted November 17, 2005 Share Posted November 17, 2005 (edited) Has this mod become so overly supported that its not 'fun' to support any longer? My having an 'Add image' problem, I read through all 19 pages of this thread and have found more and more problems being left unanswered. I also read that the original creator (MaxiDVD) has not been seen on this board in quite a while. I hate to use another wysiwyg seeing all the otherwise positive feedback on this one, but if I run into problems, its good to have a support group. Well on the off chance someone with knowledge of this small prob is parusing this thread, and wouldnt mind providing feedback, after browsing for an image ('any' image for newsletter, product, doesnt matter) i proceed to upload and get the below pop-up: Im running on an NT box, A clean install of 2.2 with proper permissions set on image folder, but im inclined to think its not pointing to the correct image folder, or I failed to find & follow instructions regarding the creation of a new image folder specificly for the wysiwyg. Any thoughts or suggestions would be quite welcomed. Stay warm.. Mac Edited November 17, 2005 by Macfionn Quote Link to comment Share on other sites More sharing options...
primadude Posted November 17, 2005 Share Posted November 17, 2005 Mac, I am definately no expert here but am willing to try to help. My development site is on my local Windows XP SP2 workstation and it is working. If you could post the top section of your /admin/htmlarea/popups/config.inc.php file, I could compare it to mine and see if something is obvious. Do you see the Images folder and files in the left pane and the file image selected in the right pane when loading an image? Joe Quote Link to comment Share on other sites More sharing options...
Macfionn Posted November 17, 2005 Share Posted November 17, 2005 Joe, I'm pleasantly surprised by the responce, and so fast even.. HIGHLY appreciated whether we get this fixed or not. ok, heres a larger screenshot. Please note the lack of any images what-so-ever: Unsure how much of the top section in the /admin/htmlarea/popups/config.inc.php file you wanted, so I will copy all until the globals portion. Also please note that this config.inc.ph is unchanged from the downloaded .zip file. I made no tweaks or modifications anywhere in this script, nor in osCommerce as a whole (fresh install for troubleshooting purposes) Thank you again, Joe. Mac -------------- <insert> <?php require('../../includes/configure.php'); /* ** Change ONLY the following lines to match your server setup */ // CONSTRAIN_* indicates the image constraints used to scale uploads (0 = none) define("CONSTRAIN_HEIGHT", 0); define("CONSTRAIN_WIDTH", 0); // IMAGE_DIR and IMAGE_URL identify the Image directory "root" (MUST end in "/") // Do NOT include "http://my.hostname.com" in IMAGE_URL; just the path from the // DocumentRoot of your webserver. define("IMAGE_DIR", trim(DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG_IMAGES)); define("IMAGE_URL", trim(DIR_WS_CATALOG_IMAGES)); // NETPBM_DIR identifies the directory where NETPBM is located (MUST end in "/") // Not used if either CONSTRAIN_HEIGHT or CONSTRAIN_WIDTH (above) is specified as "0". define("NETPBM_DIR", trim(DIR_FS_CATALOG)); // SCRIPT_DIR and SCRIPT_URL identify where these scripts reside (MUST end in "/") // Do NOT include "http://my.hostname.com" in SCRIPT_URL; just the path from the // DocumentRoot of your webserver. define("SCRIPT_DIR", trim(DIR_FS_ADMIN . "htmlarea/popups/")); define("SCRIPT_URL", trim(DIR_WS_ADMIN . "htmlarea/popups/")); // SUPPORT_* identify optional features define("SUPPORT_BITMAP", TRUE); // supported by Internet Explorer ONLY! define("SUPPORT_CREATE", TRUE); define("SUPPORT_DELETE", TRUE); define("SUPPORT_METAFILE", TRUE);// supported by Internet Explorer ONLY! define("SUPPORT_UPLOAD", TRUE); // UPLOAD_LIMIT indicates the maximum file size (in BYTES!) which can be uploaded (0 = unlimited) define("UPLOAD_LIMIT", 0); /* ** Change ONLY the preceeding lines to match your server setup */ /* ** DO NOT CHANGE beyond this point UNLESS you have ** modified 'insert_image.html' OR any of the scripts */ $dpi = 0; if(isset($HTTP_GET_VARS["DPI"])) { $dpi = $HTTP_GET_VARS["DPI"]; } else if(isset($HTTP_POST_VARS["DPI"])) { $dpi = $HTTP_POST_VARS["DPI"]; } if($dpi < 72 || $dpi > 150) $dpi = 96; // AGENT_DPI identifies the DPI setting being used by the web browser define("AGENT_DPI", $dpi); // ICON_* identify the icons to be used by the "tree" pane define("ICON_CLOSED", "closed.gif"); define("ICON_INDENT", "indent.gif"); define("ICON_OPENED", "opened.gif"); define("ICON_BMP", "bmp.gif"); define("ICON_GIF", "gif.gif"); define("ICON_JPG", "jpg.gif"); define("ICON_PNG", "png.gif"); define("ICON_WMF", "wmf.gif"); // IMAGE_* identify the image type values (most returned by PHP's getImageSize) define("IMAGE_BMP", 6); define("IMAGE_GIF", 1); define("IMAGE_JPG", 2); define("IMAGE_PNG", 3); define("IMAGE_WMF", 42); // LISTER_* identify elements used by the "tree" pane define("LISTER_DELETE", "font: italic 7pt 'MS Shell Dlg', Helvetica, sans-serif;"); define("LISTER_NAME", "lister"); define("LISTER_PADDING", "4"); define("LISTER_SPACING", "0"); define("LISTER_STYLE", "font: 8pt 'MS Shell Dlg', Helvetica, sans-serif;"); define("LISTER_TAG", "IFRAME"); // MANAGER_* identify elements used to connect the panes to the "action" form define("MANAGER_NAME", "manager"); define("MANAGER_SRC", "txtFileName"); define("MANAGER_TAG", "TABLE"); // METAFILE_* indentify constants used in decoding Placeable Metafile Headers define("METAFILE_DPI", 96); define("METAFILE_KEY", "9ac6cdd7"); // NETPBM_* indentify commands used in image constraining (WMFs cannot be constrained!) define("NETPBM_BMP", "bmptopnm \"%s\" | pnmscale %s | ppmtobmp >\"%s\""); define("NETPBM_GIF", "giftopnm \"%s\" | pnmscale %s | ppmtogif >\"%s\""); define("NETPBM_JPG", "jpegtopnm \"%s\" | pnmscale %s | pnmtojpeg >\"%s\""); define("NETPBM_PNG", "pngtopnm \"%s\" | pnmscale %s | pnmtopng >\"%s\""); // PANE_* identify the geometry and conversion factors used by the panes define("PANE_XFACTOR", ((AGENT_DPI == 96) ? 1 : (AGENT_DPI / ((AGENT_DPI < 96) ? 95 : 97.5)))); define("PANE_YFACTOR", ((AGENT_DPI == 96) ? 1 : (AGENT_DPI / ((AGENT_DPI < 96) ? 95 : 99.5)))); define("PANE_HEIGHT", floor((115 * PANE_YFACTOR))); define("PANE_LABEL", ceil((35 * PANE_YFACTOR))); define("PANE_WIDTH", floor((200 * PANE_XFACTOR))); // TEXT_* identify literal text used by the "tree" and "preview" panes define("TEXT_DELETE", "[delete]"); define("TEXT_ROOT", "Images Root"); define("TEXT_SELECT", "<i>No<br>Image<br>Selected<br>for<br>Preview</i>"); // VIEWER_* identify elements used by the "preview" pane define("VIEWER_NAME", "viewer"); define("VIEWER_NONE", "font: italic 12pt 'MS Shell Dlg', Helvetica, sans-serif;"); define("VIEWER_PADDING", "2"); define("VIEWER_SPACING", "0"); define("VIEWER_STYLE", "font: 8pt 'MS Shell Dlg', Helvetica, sans-serif; background-color: #c0c0c0;"); define("VIEWER_TAG", "IFRAME"); // WRAPPER_* identify elements used to connect the "tree" and "preview" panes define("WRAPPER_NAME", "wrapper"); define("WRAPPER_TAG", "TABLE"); /* ** Globals */ An addendum to the above: I am addressing the wysiwyg editor from I.E 6 sp1. My server is 2003, Apache 2.0.54, PHP interpreter is v. 4.4.0. For testing purposes, I have turned of ALL 'read only' attributes throughout the catalog directory Quote Link to comment Share on other sites More sharing options...
Macfionn Posted November 17, 2005 Share Posted November 17, 2005 Ok... nevermind the above request. I just broke down and installed CRE Loaded and it has the wysiwyg included. Works great, so I'm just going to go that route. Joe? thanks anyway. Mac Quote Link to comment Share on other sites More sharing options...
Madinson Posted November 17, 2005 Share Posted November 17, 2005 I'm working a ssl-Server...everything is alright....but the insert-image-part does not work. also the link-genrator.... the pathproblem is it solved somewhere? I can't find the tread for this.. thx anyway Quote just create...and sell..sell...sell..... Link to comment Share on other sites More sharing options...
Guest Posted November 17, 2005 Share Posted November 17, 2005 (edited) I had this same problem that drove me nuts for days. Only problem is that was months ago and I dont recall "exactly" what I did to fix it. I do believe that it is solved in the config file for the wizziewig tho..... /admin/htmlarea/popups/config.inc.php Make sure your image directory is CHMOD 777 (rwxrwxrwx) read/write/exectue. It has to be that, or a path problem... according to your screen capture. Around line 12, make sure you check this section: // IMAGE_DIR and IMAGE_URL identify the Image directory "root" (MUST end in "/") // Do NOT include "http://my.hostname.com" in IMAGE_URL; just the path from the // DocumentRoot of your webserver. define("IMAGE_DIR", trim(DIR_FS_CATALOG . DIR_WS_IMAGES)); define("IMAGE_URL", trim(DIR_WS_CATALOG_IMAGES)); Look for this around line 290 or so: // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 // return the URL //return ("http://" . $HTTP_SERVER_VARS["HTTP_HOST"] . $url); return ( ((getenv('HTTPS') == 'on' or getenv('SERVER_PORT') == 443) ? "https://" : "http://") . $HTTP_SERVER_VARS["HTTP_HOST"] . $url); } Look for this around line 400 or so: // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 // return the URL //return ("http://" . $HTTP_SERVER_VARS["HTTP_HOST"] . $url); return ( ((getenv('HTTPS') == 'on' or getenv('SERVER_PORT') == 443) ? "https://" : "http://") . $HTTP_SERVER_VARS["HTTP_HOST"] . $url); // ------Modified to fix resize and shared ssl problem jsinp 09/15/2005 } ?> I am pretty sure the problem is solved in that file. If not, then it can only be a path tweak in one of your configure files (catalogroot/includes/configure.php or most likely, catalogroot/admin/includes/configure.php. I also had problems with the sizes of the popup windows.... cutting off buttons and input boxes. They can be resized by making the pixels larger for height and width... near the top of each popup. Example insert_image.html: <html style="font: 9 pt 'MS Shell Dlg', Helvetica, sans-serif; width: 585px; height: 520px; "> Hope this helps you, or someone else. PS - try calling the insert_image.html file by itself in a browser.... then view the source code and see exactly what paths are trying to be used.... I think that doing that helped me pinpoint where the bad paths were originating........ so go to http://yourdomaincatalog.com/admin/htmlarea/popups/insert_image.html The source code will enlighten you as to what locaiton the thing is trying to call/use/generate your images.... :thumbsup: Edited November 17, 2005 by DRIVE Quote Link to comment Share on other sites More sharing options...
Madinson Posted November 17, 2005 Share Posted November 17, 2005 Great...it was the part in line 400 which I hadn't fixed. Now it works...so great. It took me hooouuuuursss and I couldn' t find this out. Thanks so much. Now I have one little problem left: The hyperlink-generator (insert_file.php) generates the wrong link: https://mydomain.net/catalog/admin/download//unreal.zip in line 89 I find this: text = escape( "<a href='<?="/".$FILE_ROOT?>" ); text = text + escape( txtFileName.value ); //target=_blank by default text = text + escape( "' target='_blank'>" ); if (txtDescription.value != '') { text = text + escape( txtDescription.value ); } It makes no different if I change something here....because I always have two // infront of the file. thThe generator shows me the two // in the input-field...but I can't find it out which part/file generates the whole link..espacially the two // at the end?? any idea?? Quote just create...and sell..sell...sell..... Link to comment Share on other sites More sharing options...
Guest Posted November 17, 2005 Share Posted November 17, 2005 glad to help... :thumbsup: The two // that appear before the filename must be because in your /includes/config.php (the catalog one, not the admin one), you have may have it like this: define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . '/download/'); where is should be define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); It is adding the extra slash for you. Quote Link to comment Share on other sites More sharing options...
Madinson Posted November 18, 2005 Share Posted November 18, 2005 yes...normally that should work. But I tried nearly everything. But the configure.php is not the cause....: <A href="https://mydomain.net/download//arrow_right.gif" target=_blank>arrow_right.gif (69 btyes)</A> there are always two slashes...and the link is not correct. There is now the catalog missing in my configure.php i have: define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download'); in my insert_file.php i have: { text = escape( "<a href='<?="/".$FILE_ROOT?>" ); text = text + escape( txtFileName.value ); //target=_blank by default text = text + escape( "' target='_blank'>" ); if (txtDescription.value != '') { text = text + escape( txtDescription.value ); } if I change <?="/".$FILE_ROOT?> to <?="catalog/"?> I get such a link: <A href="https://mydomain.net/catalog/admin/catalog///arrow_right.gif" target=_blank>arrow_right.gif (69 btyes)</A> There must be somewhere an order to check and replace something in the generated file. But not in this file or? Quote just create...and sell..sell...sell..... Link to comment Share on other sites More sharing options...
Guest Posted November 18, 2005 Share Posted November 18, 2005 **I get such a link: <A href="https://mydomain.net/catalog/admin/catalog///arrow_right.gif"**'>https://mydomain.net/catalog/admin/catalog///arrow_right.gif"** FORGET about the insert_file.php code... forget it... that ISNT the cause... you made adjustments... now you have /catalog/admin/catalog/// it IS a path problem. PM a snip of the lines in your configs, or do a screen cap... your issues are path issues, which is good... your system isnt the problem . yes...normally that should work. But I tried nearly everything. But the configure.php is not the cause....: <A href="https://mydomain.net/download//arrow_right.gif" target=_blank>arrow_right.gif (69 btyes)</A> there are always two slashes...and the link is not correct. There is now the catalog missing in my configure.php i have: define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download'); in my insert_file.php i have: { text = escape( "<a href='<?="/".$FILE_ROOT?>" ); text = text + escape( txtFileName.value ); //target=_blank by default text = text + escape( "' target='_blank'>" ); if (txtDescription.value != '') { text = text + escape( txtDescription.value ); } if I change <?="/".$FILE_ROOT?> to <?="catalog/"?> I get such a link: <A href="https://mydomain.net/catalog/admin/catalog///arrow_right.gif" target=_blank>arrow_right.gif (69 btyes)</A> There must be somewhere an order to check and replace something in the generated file. But not in this file or? Quote Link to comment Share on other sites More sharing options...
Madinson Posted November 18, 2005 Share Posted November 18, 2005 the htmlarea/popups/file/config.inc.php: --------------------------------------------------------- <? require('../../../includes/configure.php'); //************************** BEGIN CONFIGURATION *****************************// //example, this is the actual file system path //of the web server document root. e.g. // Filesystem == /home/web/www.yourdomain.com $BASE_DIR = DIR_FS_CATALOG; //the path where the browser sees the document root (i.e. http://www.yourdomain.com/) $BASE_URL = HTTP_SERVER; //this is where the files will be stored relative to the $BASE_DIR (and $BASE_URL) //this directory MUST be readable AND writable by the web server. $BASE_ROOT = 'download'; //************************** END CONFIGURATION *****************************// $FILE_ROOT = $BASE_ROOT; if(strrpos($BASE_DIR, '/')!= strlen($BASE_DIR)-1) $BASE_DIR .= '/'; if(strrpos($BASE_URL, '/')!= strlen($BASE_URL)-1) $BASE_URL .= '/'; //Built in function of dirname is faulty //It assumes that the directory name can not contain a . (period) function dir_name($dir) { $lastSlash = intval(strrpos($dir, '/')); if($lastSlash == strlen($dir)-1){ return substr($dir, 0, $lastSlash); } else return dirname($dir); } ?> ----------------------------------------------------- and the beginning of htmlarea/popups/config.inc.php: ------------------------------------------------------- <?php require('../../includes/configure.php'); /* ** Change ONLY the following lines to match your server setup */ // CONSTRAIN_* indicates the image constraints used to scale uploads (0 = none) define("CONSTRAIN_HEIGHT", 0); define("CONSTRAIN_WIDTH", 0); // IMAGE_DIR and IMAGE_URL identify the Image directory "root" (MUST end in "/") // Do NOT include "http://my.hostname.com" in IMAGE_URL; just the path from the // DocumentRoot of your webserver. define("IMAGE_DIR", trim(DIR_FS_CATALOG . DIR_WS_IMAGES)); define("IMAGE_URL", trim(DIR_WS_CATALOG_IMAGES)); // NETPBM_DIR identifies the directory where NETPBM is located (MUST end in "/") // Not used if either CONSTRAIN_HEIGHT or CONSTRAIN_WIDTH (above) is specified as "0". define("NETPBM_DIR", trim(DIR_FS_CATALOG)); // SCRIPT_DIR and SCRIPT_URL identify where these scripts reside (MUST end in "/") // Do NOT include "http://my.hostname.com" in SCRIPT_URL; just the path from the // DocumentRoot of your webserver. define("SCRIPT_DIR", trim(DIR_FS_ADMIN . "htmlarea/popups/")); define("SCRIPT_URL", trim(DIR_WS_ADMIN . "htmlarea/popups/")); // SUPPORT_* identify optional features define("SUPPORT_BITMAP", TRUE); // supported by Internet Explorer ONLY! define("SUPPORT_CREATE", TRUE); define("SUPPORT_DELETE", TRUE); define("SUPPORT_METAFILE", TRUE);// supported by Internet Explorer ONLY! define("SUPPORT_UPLOAD", TRUE); // UPLOAD_LIMIT indicates the maximum file size (in BYTES!) which can be uploaded (0 = unlimited) define("UPLOAD_LIMIT", 0); /* ** Change ONLY the preceeding lines to match your server setup */ .... -------------------------------------------------------------------------- thx Quote just create...and sell..sell...sell..... Link to comment Share on other sites More sharing options...
Guest Posted November 18, 2005 Share Posted November 18, 2005 Not the htmlarea config, the main configs.. mask paths if you need to, but give me a true representation of slashes... this is a path problem... has nothing to do with the files in the maxivd stuff Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.