Jump to content
Latest News: (loading..)

BoF

Members
  • Content count

    14
  • Joined

  • Last visited

Profile Information

  • Real Name
    Ulrich Wolf
  1. BoF

    One Page Checkout Support

    Hi everyone, I just have installed OPC and I get into a loop if I check the checkbox "Different from billing address?". I have disabled "State" in customer details, because "State", "Suburb" and "Date of Birth" are useless for my shop. If I set "State" to "true", everthing works fine. Is there a way in the configuration of OPC, to make it work with "State" set to "false"? Kind regards BoF
  2. BoF

    NEW! Complete Order Editing Tool!

    Hello djmonkey1, I get this error from every tooltip. BoF
  3. BoF

    NEW! Complete Order Editing Tool!

    I have installed the latest version of this contribution, and if using IE (6 or 7) I get an javascript error when positioning the mouse cursor over the tooltip icon and no tooltips are shown. With Firefox or Opera everything works fine, bur the store management only uses IE. Would be great, if anyone has a solution to fix this problem. BoF
  4. I have made 4 shops based on osc with admin access level and I never had the problem you described. If a "lessadmin" is able to edit products, the popup also works. I only had problems with popup blocker apps like IE itself or google/yahoo toolbars or similar software. BoF
  5. Hello everyone, in my store I have fixed the sort problem with the imagedirectories in the image-upload-popup. :D This is my code of the lister.php <html> <head> <?php require("config.inc.php"); ?> <style type="text/css"> TD { <?php echo LISTER_STYLE; ?> } TD.delete { <?php echo LISTER_DELETE; ?> } </style> <script language="javascript"> function actionComplete(action, path, error, info) { var manager = findAncestor(window.frameElement, '<?php echo MANAGER_NAME; ?>', '<?php echo MANAGER_TAG; ?>'); var wrapper = findAncestor(window.frameElement, '<?php echo WRAPPER_NAME; ?>', '<?php echo WRAPPER_TAG; ?>'); if(manager) { if(error.length < 1) { manager.all.actions.reset(); <?php // if UPLOAD is supported ... if(SUPPORT_UPLOAD) { // ... emit the JavaScript echo " if(action == 'upload') {\n"; echo " manager.all.actions.image.value = '';\n"; echo " manager.all.actions.name.value = '';\n"; echo " manager.all.actions.width.value = '';\n"; echo " manager.all.actions.height.value = '';\n"; echo " manager.all.actions.aspect.checked = true;\n"; echo " }\n"; // if NETPBM is NOT available ... if(!(file_exists(NETPBM_DIR))) { // ... emit the JavaScript echo " manager.all.actions.width.disabled = true;\n"; echo " manager.all.actions.height.disabled = true;\n"; echo " manager.all.actions.aspect.disabled = true;\n"; } } // if CREATE is supported ... if(SUPPORT_CREATE) { // ... emit the JavaScript echo " if(action == 'create')\n"; echo " manager.all.actions.folder.value = '';\n"; } // if DELETE is supported ... if(SUPPORT_DELETE) { // ... emit the JavaScript echo " if(action == 'delete')\n"; echo " manager.all." . MANAGER_SRC . ".value = '';\n"; } ?> } manager.all.actions.DPI.value = <?php echo AGENT_DPI; ?>; manager.all.actions.path.value = path; } if(wrapper) wrapper.all.viewer.contentWindow.navigate('<?php echo scriptURL("viewer.php?DPI=") . AGENT_DPI; ?>'); if(error.length > 0) alert(error); else if(info.length > 0) alert(info); } </script> </head> <?php /* ** Emits the appropriate HTML for the specified Directory. ** ** Params: $value - Directory name ** $key - Array key (undefined) ** $depth - Indent depth ** $icon - Icon filename ** $link - TRUE if Directory should be linked; FALSE otherwise */ function dirTag($value, $key, $depth, $icon = ICON_CLOSED, $link = TRUE) { global $HTTP_SERVER_VARS, $base; // initialize context $path = basePath($value, ($depth - 1)); // emit the HTML echo "<tr><td align=\"left\" valign=\"bottom\" width=\"100%\">\n"; // indent as required indentTag($depth); // emit the HTML echo "<img align=\"bottom\" src=\"" . scriptURL($icon) . "\" alt=\"$value\">"; if($link) { echo "<a href=\"" . scriptURL(basename($HTTP_SERVER_VARS["PHP_SELF"])) . "?DPI=" . AGENT_DPI; if(strcmp(TEXT_ROOT, $value)) echo "&path=" . urlencode($path); echo "\">"; } echo "<b>$value</b>"; echo "</a>"; echo "</td><td class=\"delete\" align=\"right\" valign=\"bottom\">\n"; if(SUPPORT_DELETE) { if(!(strcmp($icon, ICON_CLOSED)) && isEmpty($path)) echo "<a href=\"javascript:deletePath('" . $path . "')\">" . TEXT_DELETE . "</a>"; } echo "</td></tr>\n"; } /* ** Creates a new Folder. ** ** Params: $folder - Folder to create */ function doCreate($folder) { global $error; // initialize context $path = basePath($folder); // if Folder does NOT already exist ... if(!(file_exists(IMAGE_DIR . $path))) { // ... if Folder does NOT create ... if(!(@mkdir(IMAGE_DIR . $path, 0777))) // ... report the error $error = "Folder \'" . $path . "\' could not be created"; } // ... otherwise, report the error else $error = "Folder \'" . $path . "\' already exists"; } /* ** Deletes a Folder/File. ** ** Params: $file - Folder/file to delete */ function doDelete($file) { global $base, $error; // if Folder/File exists ... if(file_exists(IMAGE_DIR . $file)) { // ... if this is a Folder ... if(is_dir(IMAGE_DIR . $file)) { // ... if Folder does NOT delete ... if(!(@rmdir(IMAGE_DIR . $file))) // ... report the error $error = "Folder \'" . $file . "\' could not be deleted"; } // ... otherwise, if File does NOT delete ... else if(!(@unlink(IMAGE_DIR . $file))) // ... report the error $error = "Image \'" . $file . "\' could not be deleted"; } // ... otherwise, report the error else $error = "Folder or file \'" . $file . "\' not found"; } /* ** Lists a Path. */ function doList() { global $dirs; $exts = array("gif", "jpg", "jpeg", "png"); // initialize context $nodes = 0; $current = (count($dirs) + 1); // emit the HTML echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n"; dirTag(TEXT_ROOT, "", $nodes++, ICON_OPENED); // for ALL Directories in the Path ... foreach($dirs as $dir) { // ... if Directory is exists ... if(strlen($dir) > 0) // ... emit the HTML dirTag($dir, "", $nodes++, ICON_OPENED, ($nodes != $current)); } // list Directories and emit the HTML $list = listDirs(); @array_walk($list, dirTag, $nodes); // if BITMAP support is desired ... if(SUPPORT_BITMAP) // ... include BMP extensions $exts[] = "bmp"; // if METAFILE support is desired ... if(SUPPORT_METAFILE) // ... include WMF extensions $exts[] = "wmf"; // list Image files and emit the HTML $list = listFiles($exts); @array_walk($list, fileTag, $nodes); // emit the HTML echo "</table>\n"; } /* ** Uploads an Image. ** ** Params: $name - Name for uploaded Image ** $width - Width to resize (OR zero) ** $height - Height to resize (OR zero) ** $aspect - TRUE if aspect ration is to be preserved; false otherwise */ function doUpload($name, $width, $height, $aspect) { global $HTTP_POST_FILES, $error, $info; // initialize context $temp = $HTTP_POST_FILES["image"]["tmp_name"]; // if File is a legitimate upload ... if(is_uploaded_file($temp)) { $type = $HTTP_POST_FILES["image"]["type"]; $types = array("image/gif" => "[.]gif$", "image/jpg" => "[.]jp[e]?g$", "image/jpeg" => "[.]jp[e]?g$", "image/pjpeg" => "[.]jp[e]?g$", "image/png" => "[.]png$", "image/x-png" => "[.]png$"); // ... if BITMAP support is desired ... if(SUPPORT_BITMAP) { // ... add BITMAP type $types["image/bmp"] = "[.]bmp$"; $types["image/x-bmp"] = "[.]bmp$"; } // if METAFILE support is desired ... if(SUPPORT_METAFILE) // ... add METAFILE type $types["image/x-wmf"] = "[.]wmf$"; // if File is a valid image ... if(isset($types[$type])) { $search = (isWindows() ? "eregi" : "ereg"); $replace = (isWindows() ? "eregi_replace" : "ereg_replace"); // ... if Name was NOT specified ... if(strlen($name) < 1) // ... use the same Name $name = $HTTP_POST_FILES["image"]["name"]; // if File has NO or an improper extension ... if(!($search($types[$type], $name))) { $exts = array("image/gif" => ".gif", "image/jpg" => ".jpg", "image/jpeg" => ".jpg", "image/pjpeg" => ".jpg", "image/png" => ".png", "image/x-png" => ".png", "image/bmp" => ".bmp", "image/x-bmp" => ".bmp", "image/x-wmf" => ".wmf"); // ... if NO extension exists ... if(!($search("[.].+$", $name))) // ... append the proper extension $name .= $exts[$type]; // ... otherwise, force a proper extension else $name = $replace("[\.].*$", $exts[$type], $name); // notify the user $info = "Proper extension was added to make \'" . $name . "\' valid for this image type"; } // if File has the proper extension now ... if($search($types[$type], $name)) { $path = basePath($name); // ... if File does NOT already exist ... if(!(file_exists(IMAGE_DIR . $path))) { $size = $HTTP_POST_FILES["image"]["size"]; // ... if NO size limit exists OR File is NOT over the limit ... if(UPLOAD_LIMIT == 0 || $size <= UPLOAD_LIMIT) { // ... if File CANNOT be copied ... if(!(@copy($temp, (IMAGE_DIR . $path)))) // ... report the error $error = "File \'" . $path . "\' could not be created"; // ... otherwise, if NETPBM is available ... else if(file_exists(NETPBM_DIR)) { $size = @imageInfo(IMAGE_DIR . $path); $action = "resized"; // ... if Width was NOT specified ... if($width < 1) // ... use the image width $width = $size[0]; // if Width exceeds image constraint ... if(CONSTRAIN_WIDTH > 0 && CONSTRAIN_WIDTH < $width) { // ... use the constrained width $width = CONSTRAIN_WIDTH; $action = "constrained"; } // if Height was NOT specified ... if($height < 1) // ... use the image height $height = $size[1]; // if Height exceeds image constraint ... if(CONSTRAIN_HEIGHT > 0 && CONSTRAIN_HEIGHT < $height) { // ... use the constrained height $height = CONSTRAIN_HEIGHT; $action = "constrained"; } // if image must be scaled ... if($size[0] != $width || $size[1] != $height) { $script = ""; // ... based on type ... switch($size[2]) { case IMAGE_GIF: $script = NETPBM_GIF; break; case IMAGE_JPG: $script = NETPBM_JPG; break; case IMAGE_PNG: $script = NETPBM_PNG; break; case IMAGE_BMP: $script = NETPBM_BMP; break; } // if image can be constrained using NETPBM (WMFs cannot) ... if(strlen($script) > 0) { // ... if aspect ration is to be preserved ... if($aspect) // ... set bounding box $options = "-xysize $width $height"; // ... otherwise, set absolute dimensions else $options = "-xsize=$width -ysize=$height"; // if Windows environment ... if(isWindows()) // ... prepend the command shell $script = "cmd.exe /C $script"; // scale the image $dir = getcwd(); chdir(NETPBM_DIR); shell_exec(sprintf($script, $temp, $options, (IMAGE_DIR . $path))); chdir($dir); // notify the user $size = @imageInfo(IMAGE_DIR . $path); $info = "Image \'" . $name . "\' was $action to $size[0] ? $size[1]"; } } } } // ... otherwise, report the error else $error = "File \'" . $path . "\' exceeds " . round((UPLOAD_LIMIT / 1024)) . " KByte size limit"; } // ... otherwise, report the error else $error = "File \'" . $path . "\' already exists"; } // ... otherwise, report the error else $error = "Files of type \'" . $type . "\' require a matching extension"; } // ... otherwise, report the error else $error = "File \'" . $HTTP_POST_FILES["image"]["name"] . "\' is not a supported type ($type)"; } // ... otherwise, report the error else $error = "Invalid upload environment"; } /* ** Emits the appropriate HTML for the specified File. ** ** Params: $value - File name ** $key - Array key (undefined) ** $depth - Indent depth */ function fileTag($value, $key, $depth) { // initialize context $file = basePath($value); $size = @imageInfo(IMAGE_DIR . $file); // if Image size and type are available ... if($size) { // ... emit the HTML echo "<tr><td align=\"left\" valign=\"bottom\" width=\"100%\">\n"; // indent as required indentTag($depth); // emit the HTML echo "<img align=\"bottom\" src=\""; switch($size[2]) { case IMAGE_GIF: echo scriptURL("gif.gif"); break; case IMAGE_JPG: echo scriptURL("jpg.gif"); break; case IMAGE_PNG: echo scriptURL("png.gif"); break; case IMAGE_BMP: echo scriptURL("bmp.gif"); break; case IMAGE_WMF: echo scriptURL("wmf.gif"); break; } echo "\" alt=\"" . $value . "\">"; echo "<a href=\"" . scriptURL("viewer.php?DPI=" . AGENT_DPI . "&file=" . urlencode($file)) . "\" target=\"" . VIEWER_NAME . "\">"; echo $value; echo "</a>\n"; echo "</td><td class=\"delete\" align=\"right\" valign=\"bottom\">\n"; if(SUPPORT_DELETE) { echo "<a href=\"javascript:deletePath('" . $file . "')\">" . TEXT_DELETE . "</a>"; } echo "</td></tr>\n"; } } /* ** Emits the appropriate HTML for an Indent. ** ** Params: $depth - Indent depth */ function indentTag($depth) { // if Indent is desired ... if($depth > 0) { $size = @getImageSize(SCRIPT_DIR . ICON_INDENT); // ... emit the HTML echo "<img src=\"" . scriptURL(ICON_INDENT) . "\" width=\"" . ($size[0] * $depth) . "\" height=\"" . $size[1] . "\">"; } } /* ** Returns the empty status of the specified Directory. ** ** Params: $path - Path to check ** ** Return: TRUE if Directory is empty; FALSE otherwise */ function isEmpty($path) { // initialize context $empty = TRUE; // if the Directory opens ... if(($dir = @opendir(IMAGE_DIR . $path))) { // ... while Files remain ... while($empty && FALSE !== ($file = readdir($dir))) { // ... if NOT hierarchy entries ... if($file != "." && $file != "..") // ... indicate NOT empty $empty = FALSE; } // close the Directory closedir($dir); } // return the status return $empty; } /* ** Returns an array of the Directories within the specified path. ** ** Return: Array of Directory names */ function listDirs() { global $base; $result = array(); // if the Directory opens ... if(($dir = @opendir(IMAGE_DIR . $base))) { // ... while Files remain ... while(FALSE !== ($file = readdir($dir))) { // ... if NOT hierarchy entries ... if($file != "." && $file != "..") { // ... if File is a Directory ... if(is_dir(IMAGE_DIR . basePath($file))) // ... return the Directory array_push($result, $file); sort($result); } } // close the Directory closedir($dir); } // return the Directories return $result; } /* ** Returns an array of the Files within the specified path. ** ** Params: $filter - Extension filter(s) ** ** Return: Array of File names */ function listFiles($filter = Array()) { global $base; $result = Array(); // if the Directory opens ... if(($dir = @opendir(IMAGE_DIR . $base))) { $filters = count($filter); // ... while Files remain ... while(FALSE !== ($file = readdir($dir))) { // ... if File is NOT a Directory ... if(!(is_dir(IMAGE_DIR . basePath($file)))) { // ... if Filters were specified ... if($filters > 0) { $compare = (isWindows() ? "strcasecmp" : "strcmp"); // ... isolate the Extension $parts = pathinfo(IMAGE_DIR . basePath($file)); $ext = strtolower($parts["extension"]); // for ALL specified Filters ... for($index = 0; $index < $filters; $index++) { // ... if this a Filtered extension ... if(!($compare($ext, $filter[$index]))) // ... get out now! break; } // if File is NOT to be included ... if($index >= $filters) // ... continue listing Files continue; } // return the File $result[] = $file; } } // close the Directory closedir($dir); } natsort($result); // return the Files return $result; /* // return the File $result[] = $file; } } // close the Directory closedir($dir); } // return the Files return $result; */ } // process GET/POST parameters $action = ""; if(isset($HTTP_GET_VARS["action"])) $action = urldecode($HTTP_GET_VARS["action"]); else if(isset($HTTP_POST_VARS["action"])) $action = urldecode($HTTP_POST_VARS["action"]); $aspect = false; if(SUPPORT_UPLOAD) $aspect = isset($HTTP_POST_VARS["aspect"]); $file = ""; if(SUPPORT_DELETE) { if(isset($HTTP_GET_VARS["file"])) $file = urldecode($HTTP_GET_VARS["file"]); else if(isset($HTTP_POST_VARS["file"])) $file = urldecode($HTTP_POST_VARS["file"]); } $folder = ""; if(SUPPORT_CREATE) { if(isset($HTTP_POST_VARS["folder"])) $folder = $HTTP_POST_VARS["folder"]; } $height = 0; if(SUPPORT_UPLOAD) { if(isset($HTTP_POST_VARS["height"]) && is_numeric($HTTP_POST_VARS["height"])) $height = (int) $HTTP_POST_VARS["height"]; } $name = ""; if(SUPPORT_UPLOAD) { if(isset($HTTP_POST_VARS["name"])) $name = $HTTP_POST_VARS["name"]; } $path = ""; if(isset($HTTP_GET_VARS["path"])) $path = urldecode($HTTP_GET_VARS["path"]); else if(isset($HTTP_POST_VARS["path"])) $path = urldecode($HTTP_POST_VARS["path"]); $width = 0; if(SUPPORT_UPLOAD) { if(isset($HTTP_POST_VARS["width"]) && is_numeric($HTTP_POST_VARS["width"])) $width = (int) $HTTP_POST_VARS["width"]; } // parse and clean the Path cleanPath($path); ?> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <?php // if CREATE is supported AND this is CREATE ... if(SUPPORT_CREATE && !(strcasecmp($action, "create"))) // ... create the Folder doCreate($folder); // ... otherwise, if DELETE is supported AND this is DELETE ... else if(SUPPORT_DELETE && !(strcasecmp($action, "delete"))) // ... delete the Folder/File doDelete($file); // ... otherwise, if UPLOAD is supported AND this is UPLOAD ... else if(SUPPORT_UPLOAD && !(strcasecmp($action, "upload"))) // ... upload the Image doUpload(basename($name), $width, $height, $aspect); // list the Path doList(); // emit the HTML echo "<script language=\"javascript\">\n"; // if DELETE is supported ... if(SUPPORT_DELETE) { // ... emit the HTML echo "function deletePath(path) {\n"; echo " var lister = findAncestor(window.frameElement, '" . LISTER_NAME . "', '" . LISTER_TAG . "');\n\n"; echo " if(lister && confirm(\"Delete '\" + path + \"'?\"))\n"; echo " lister.contentWindow.navigate('" . scriptURL("lister.php?DPI=") . AGENT_DPI . "&action=delete&path=" . $base . "&file=" . "' + escape(path));\n"; echo "}\n\n"; } ?> actionComplete("<?php echo $action; ?>", "<?php echo $path; ?>", "<?php echo $error; ?>", "<?php echo $info; ?>"); </script> </body> </html> With this lister.php the sorting works for images and image-directories. Directories are listed at top, pictures below, if a directory contains both - directories and images. BoF
  6. Hello I think, it's a little bit late for the two guys, but I found this thread when is was looking for a solution for specials on default page together with total B2B. Because I found no solution, I figured it out myself. My solution is (just change the code of the default_specials.php): <?php /* $Id: default_specials.php,v 2.0 2003/06/13 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ if (!isset($customer_id)) $customer_id = 0; $customer_group = tep_get_customers_groups_id(); $new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' and ((s.customers_id = '" . $customer_id . "' and s.customers_groups_id = '0') or (s.customers_id = '0' and s.customers_groups_id = '" . $customer_group . "') or (s.customers_id = '0' and s.customers_groups_id = '0')) order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIAL_PRODUCTS); ?> <!-- default_specials //--> <tr> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B'))); new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS)); $info_box_contents = array(); $row = 0; $col = 0; while ($default_specials = tep_db_fetch_array($new)) { $default_specials['products_name'] = tep_get_products_name($default_specials['products_id']); $default_specials['products_price'] = tep_xppp_getproductprice($default_specials['products_id']); $default_specials['specials_new_products_price'] = tep_get_products_special_price($default_specials['products_id']); $query_default_special_prices_hide = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'SPECIAL_PRICES_HIDE'"); $query_default_special_prices_hide_result = tep_db_fetch_array($query_default_special_prices_hide); if ($query_default_special_prices_hide_result['configuration_value'] == 'true') { $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . $default_specials['products_name'] . '</a><br><span class="productSpecialPrice">' . $currencies->display_price_nodiscount($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span>'); } else { $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . $default_specials['products_name'] . '</a><br><s>' . $currencies->display_price($default_specials['products_id'], $default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price_nodiscount($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span>'); } $col ++; if ($col > 2) { $col = 0; $row ++; } } new contentBox($info_box_contents); ?> <!-- default_specials_eof //--> BoF
  7. BoF

    All Customers Report

    Hello everyone I have customized this good contribution, and added customers ID with a link to edit the customer by clicking on the ID number, added the customers e-mail adress with a link to send her/him an e-mail by clicking on the e-mail adress and last, but not least added a table heading. My all_customers.php <?php /* ?$Id: all_customers.php, v1.0 March 21, 2005 18:45:00 ?osCommerce, Open Source E-Commerce Solutions ?http://www.oscommerce.com ?Copyright (c) 2002 - 2004 osCommerce ?written by Jared Call at client' suggestion ?some code nicked and modified from /catalog/admin/customers.php ?Released under the GNU General Public License */ ?require('includes/application_top.php'); ?> <!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> <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"> <!-- 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"><table border="0" width="100%" cellspacing="0" cellpadding="0"> ? ? ?<tr> ? ? ? ?<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="0"> ? ? ? ? ?<tr> ? ? ? ? ? ?<td class="pageHeading"><?php echo HEADING_TITLE; ?></td> ? ? ? ? ?</tr> ? ? ? ?</table></td> ? ? ?</tr> ? ? ?<tr> ? ? ? ?<td colspan="6"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> ? ? ?</tr> ? <tr class="dataTableHeadingRow"> ?<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ID; ?></td> ?<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NAME; ?></td> ?<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONTACT; ?></td> ?<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LOCATION; ?></td> ?<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATE; ?></td> ?<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NEWSLETTER; ?></td> ?</tr> ?<tr> ? ? <td colspan="6"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> ?</tr> <?php ? ? ?$customers_query_raw = "select c.customers_id, c.customers_gender, c.customers_default_address_id, c.customers_email_address, c.customers_telephone, c.customers_fax, c.customers_newsletter, a.address_book_id, a.entry_firstname, a.entry_lastname, a.entry_street_address, a.entry_suburb, a.entry_city, a.entry_state, a.entry_postcode, a.entry_country_id, a.entry_zone_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id order by a.entry_lastname ASC"; ?$customers_query = tep_db_query($customers_query_raw); ? ?while ($customers = tep_db_fetch_array($customers_query)) { ? if ( tep_not_null($customers['customers_id']) ) { ? ?$entry_state = tep_get_zone_name($customers['entry_country_id'], $customers['entry_zone_id'], $customers['entry_state']); ? ?$country = tep_get_country_name($customers['entry_country_id']); ? if ($customers['customers_gender'] == 'm') { ? ?$gender = TEXT_GENDER_MALE; ? ?} ? else { ? ?$gender = TEXT_GENDER_FEMALE; ? ?} ? ? ? if ($customers['customers_newsletter'] < '1') { ? ?$newsletter = TEXT_NEWSLETTER_NO; ? ?} ? else { ? ?$newsletter = TEXT_NEWSLETTER_YES; ? ?} ? ??> ? ? ? ?<tr> ? ? ? ? ? <td class="dataTableContent" valign="top"><?php echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS . '?&cID=' . $customers['customers_id'] . '&action=edit') . '"' . ' target="blank">' . $customers['customers_id'] . '</a>'; ?></td> ? ? ?<td class="dataTableContent" valign="top"><?php echo $gender . '<br>' . $customers['entry_lastname'] . '<br>' . $customers['entry_firstname']?></td> ? ? ? ? ? <td class="dataTableContent" valign="top"><?php echo '<a href="mailto:' . $customers['customers_email_address'] . '">' . $customers['customers_email_address'] . '</a><br>' . $customers['customers_telephone'] . '<br>' . $customers['customers_fax']; ?></td> ? ? ? ? ? <td class="dataTableContent" valign="top"><?php echo $customers['entry_postcode'], " " , $customers['entry_city'] . '<br>' . $customers['entry_street_address']; ?></td> ? ? ?<td class="dataTableContent" valign="top"><?php echo $country . '<br>' . '- ' . $entry_state; ?></td> ? ? ?<td class="dataTableContent" valign="top"><?php echo $newsletter; ?></td> ? ? ? </tr> ? ? ? <tr><td colspan="6"><hr></td></tr> ? ? ? <?php ? ? ? ? ?} else { } ?} ? ? ? ? ? ?> <!-- body_text_eof //--> ?</tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> </body> </html> My admin/includes/languages/english/all_customers.php <?php /* ?$Id: customers.php,v 1.12 2002/01/12 18:46:27 hpdl Exp $ ?osCommerce, Open Source E-Commerce Solutions ?http://www.oscommerce.com ?Copyright (c) 2002 osCommerce ?Released under the GNU General Public License */ define('HEADING_TITLE', 'All Customers'); define('TABLE_HEADING_ID', 'ID'); define('TABLE_HEADING_NAME', 'Name'); define('TABLE_HEADING_CONTACT', 'Contact'); define('TABLE_HEADING_LOCATION', 'Adress'); define('TABLE_HEADING_STATE', 'Country'); define('TABLE_HEADING_NEWSLETTER', 'Newsletter'); define('TEXT_GENDER_MALE', 'Mr'); define('TEXT_GENDER_FEMALE', 'Mrs'); define('TEXT_NEWSLETTER_YES', 'Newsletter'); define('TEXT_NEWSLETTER_NO', 'no Newsletter'); ?> My admin/includes/languages/german/all_customers.php <?php /* ?$Id: customers.php,v 1.12 2002/01/12 18:46:27 hpdl Exp $ ?osCommerce, Open Source E-Commerce Solutions ?http://www.oscommerce.com ?Copyright (c) 2002 osCommerce ?Released under the GNU General Public License */ define('HEADING_TITLE', 'Alle Kunden'); define('TABLE_HEADING_ID', 'ID'); define('TABLE_HEADING_NAME', 'Name'); define('TABLE_HEADING_CONTACT', 'Kontakt'); define('TABLE_HEADING_LOCATION', 'Adresse'); define('TABLE_HEADING_STATE', 'Land'); define('TABLE_HEADING_NEWSLETTER', 'Newsletter'); define('TEXT_GENDER_MALE', 'Herr'); define('TEXT_GENDER_FEMALE', 'Frau'); define('TEXT_NEWSLETTER_YES', 'Newsletter'); define('TEXT_NEWSLETTER_NO', 'kein Newsletter'); ?> If you want it, simply replace the code of the original files with the code posted here. BoF
  8. BoF

    Product Description 1.3

    sorry, I have to correct a mistake in my posting. You must change $listing['products_id'] to $products_new['products_id'] to make the link afer the description text work. BoF
  9. BoF

    Product Description 1.3

    Hi everyone I made some minor changes in the product_new.php, and it works perfectly. The changes are: open products_new.php and find $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name"; In cases, you have allready installed conrtibutions which changed the code of the products_new.php, you might have problems to find the complete code above. In those cases do a partial search. in line find: pd.products_name in line after add: , pd.products_description find around row 89 <td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td> and insert '<br><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="productDesc">' . tep_flatten_product_description($listing['products_description'], ?' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . TEXT_MORE . '</a>' in this line. You can do it by leaving out the leading semicolon of the code above and paste it directly in before one of the <br>' in the original line. In my case, the look of the original products_new.php didn't really satisfy me, so I changed the code a little bit more <tr> ? ? ? ? ? ?<td rowspan="2" width="<?php echo SMALL_IMAGE_WIDTH; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td> ? ? ? ? ? ?<td class="productheadDesc" align="left" valign="top"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><font color="#680000"><b>' . $products_new['products_name'] . '</b></font></a>'; ?></td> ? <td class="productpriceDesc" align="right" valign="top"><?php echo '<b>' . $products_price . '</b> '; ?></td> ?</tr> ?<tr> ? <td class="productsDesc" align="left" valign="top" class="main" colspan="2"><?php echo tep_flatten_product_description($products_new['products_description'], ?' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . TEXT_MORE . '</a>') . '<br><b>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '</b>'; ?></td> ? ? ? ? ?</tr> ? ? ? ? ?<tr> ? ? ? ? ? ?<td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> ? ? ? ? ?</tr> replaces the lines 87 to 94 of the original code. Along with two additional entries in the stylesheet.css TD.productsDesc { ?font-family: Verdana, Arial, sans-serif; ?font-size: 10px; ?color: #808080; ?padding: 6px 4px 6px 10px; } TD.productheadDesc { ?font-family: Verdana, Arial, sans-serif; ?font-size: 11px; ?color: #680000; ?padding: 4px 0px 0px 10px; } TD.productpriceDesc { ?font-family: Verdana, Arial, sans-serif; ?font-size: 11px; ?color: #000000; ?padding: 4px 0px 0px 4px; } I got this result BoF
×