Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

arnoldl

Archived
  • Posts

    6
  • Joined

  • Last visited

Profile Information

  • Real Name
    arnold

arnoldl's Achievements

  1. @rigadin ... Thanks for the recoding , i'm a little new to php so not used to using classes as you can see.. But it works great.... grtx , arnold
  2. and a little update to show buttons from forms also.. again in includes/functions/html_output.php : just after : function tep_image_submit($image, $alt = '', $parameters = '') { global $language; put : //BOF STS MOD TO DISPLAY IMAGES FROM TEMPLATE DIR ONLY IF THEY EXIST // YOU NEED TO PUT THEM IN THE FULL PATH LIKE catalog/includes/sts_templates/test/includes/languages/dutch/images/buttons/button_buy_now.gif if (MODULE_STS_DEFAULT_STATUS=="true") { if ($_GET['sts_template']=="") { if (file_exists('includes/sts_templates/'.MODULE_STS_TEMPLATE_FOLDER.'/'.DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image)) { $image_submit = '<input type="image" src="' . tep_output_string('includes/sts_templates/' . MODULE_STS_TEMPLATE_FOLDER .'/'. DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"'; } } else { if (file_exists('includes/sts_templates/'.$_GET['sts_template'].'/'.DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image)) { $image_submit = '<input type="image" src="' . tep_output_string('includes/sts_templates/' . $_GET['sts_template'] .'/'. DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"'; } } } //EOF STS MOD and add to slashed to the next line so it looks like : // $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"'; grtx
  3. hello all.... I'm using the sts template system and i love it... only thing that i miss (or could not find :-) is a way to change bottons and images for each template. keeping the option to switch the template off reverting to stock osc.. so coded it , and it works great... here it is : in includes/functions/html_output.php put : //BOF STS MOD TO DISPLAY IMAGES FROM TEMPLATE DIR ONLY IF THEY EXIST // YOU NEED TO PUT THEM IN THE FULL PATH LIKE catalog/includes/sts_templates/test/includes/languages/dutch/images/buttons/button_buy_now.gif if (MODULE_STS_DEFAULT_STATUS=="true") { if ($_GET['sts_template']=="") { if (file_exists('includes/sts_templates/'.MODULE_STS_TEMPLATE_FOLDER.'/'.$src)) { $src='includes/sts_templates/'.MODULE_STS_TEMPLATE_FOLDER.'/'.$src; } } else { if (file_exists('includes/sts_templates/'.$_GET['sts_template'].'/'.$src)) { $src='includes/sts_templates/'.$_GET['sts_template'].'/'.$src; } } } //EOF STS MOD directly after : function tep_image($src, $alt = '', $width = '', $height = '', $params = '') { thats it ... if you have a image in the right template dir it uses it , otherwise it picks the origenal. tested in stock osc and imagemagic. Let me know if you found it usefull , maybe post it to the contribution... grtx , arnold
  4. to make this contrib work i had to add two lines in ot_fixed_payment_chg.php it proberly has to do with that i have no tax_class set. but this made it work. just before the line : if (MODULE_FIXED_PAYMENT_CHG_TAX_CLASS > 0) { add $od_amount=$od_am; you need to do this twice (for two functions) grtx , arnold
  5. hello ... The contrib sounds great , but can't get it to work ok. didn't had any previous versions installed. (just a few other contribs) below the normal page i get : if i replace sts_user_code.php with : function testfunction() {;} i also get the error (only with new functionname ofcourse). if i replace it with : echo "file loaded"; i can see sts_user_code.php gets loaded only once. (it's printed one time). i'm kind of stuck here , file is only called once , but it complains about a function being redeclared witch does't excist. So any help is welcome
  6. hello all, love the contrib , only had to change a few things to make it work. thougt to share since i saw some of the same problems on this thread and didn't find a solution. if server doesn't have gif support , you can turn on 'Output GIFs as JPEGs' but that didn't work because the gif was then threated as a jpeg and it's not. so in imagemagic.php original : // Create the image to be scaled: if ($extension=="jpg" && function_exists('imagecreatefromjpeg')) { $src = imagecreatefromjpeg($_GET['img']); } elseif ($extension=="gif" && function_exists('imagecreatefromgif')) { $src = imagecreatefromgif($_GET['img']); } elseif (($extension=="png" || $extension=="gif") && function_exists('imagecreatefrompng')) { changed: // Create the image to be scaled: // Make extra check if jpg is realy jpg and not gif threated as jpg by setting 'Output GIFs as JPEGs' if ($extension=="jpg" && function_exists('imagecreatefromjpeg') && $image[2]==2) { $src = imagecreatefromjpeg($_GET['img']); } // use this function if it's a gif even if 'Output GIFs as JPEGs' is enabled and extension is jpg elseif ($extension=="gif" || ($extension=="jpg" && $image[2]==1) && function_exists('imagecreatefromgif')) { $src = imagecreatefromgif($_GET['img']); } also when auto cleaning cache was on sometimes no image came up. this is beacause if chached dir is empty an error in generated in foreach function original: //clean up the cache if (CFG_CACHE_AUTO_CLEAN=="True" && $check_cache) { $cwd=getcwd(); chdir($create_path); foreach (glob("*.*") as $filename) { if (!is_dir($filename) && !strstr($filename,$append_hash)) { unlink($filename); } } chdir($cwd); } changed: //clean up the cache if (CFG_CACHE_AUTO_CLEAN=="True" && $check_cache) { $cwd=getcwd(); chdir($create_path); //do extra check to prevent error on empty cache dir $filelist=glob("*.*"); if ($filelist) { foreach ($filelist as $filename) { if (!is_dir($filename) && !strstr($filename,$append_hash)) { unlink($filename); } } } chdir($cwd); } This made it work for me , but i'm pretty new to oscommerce and php so maybe it break things for a other one. so BACKUP don't thrust me ;) grtx , arnold
×
×
  • Create New...