meg Posted May 22, 2006 Posted May 22, 2006 Hello I have been searching for download catalog, but I can not find it. Have I overlooked something or has?nt anyone made that ??? :blush: If anyone knows where I can get a downoad catalog for my site, I would be greatfull :thumbsup: Thanks Anita
Trout69 Posted May 22, 2006 Posted May 22, 2006 Would any of these help? http://www.oscommerce.com/community?contri...og&category=all Regards Donna
♥Vger Posted May 22, 2006 Posted May 22, 2006 There's also Thumbnail PDF Catalogue (link below my name). Vger
Trout69 Posted May 23, 2006 Posted May 23, 2006 There's also Thumbnail PDF Catalogue (link below my name). Vger Hey Rhea, Is that Thumbnail PDF catalog compatible with the image magic contribution? It seems to do the same thing (as well as export the catalog). Regards Donna
derk.d Posted August 5, 2006 Posted August 5, 2006 Hey Rhea, Is that Thumbnail PDF catalog compatible with the image magic contribution? It seems to do the same thing (as well as export the catalog). Regards Donna here is a fix for image magic, I also made a contrib but it hasn't showed up yet in the contributions: imagemagic_fix.txt Install both contrib following it's install guide and then the last part of this file! When upgrading or when you have one of the contrib already installed: find in both catalog\pdf_catalogue_info2.php and admin\pdf_catalogue.php near line 648: for($j=0; $j<$taille; $j++ ) { // NH si pas d'image definie, image par default if (strlen($print_catalog_array[$j]['image']) > 0 && file_exists(DIR_FS_CATALOG.DIR_WS_IMAGES.$print_catalog_array[$j]['image'])) { $imagepath=DIR_FS_CATALOG.DIR_WS_IMAGES.$print_catalog_array[$j]['image']; } else { $imagepath=DIR_FS_CATALOG.DIR_WS_IMAGES.DEFAULT_IMAGE; echo 'The product "'.$print_catalog_array[$j]['name'].'" has no picture. I use the generic picture: '.DEFAULT_IMAGE.'<br>'; } replace it with this one: // hash start $server=DB_SERVER; # host name of server running MySQL $user=DB_SERVER_USERNAME; # existing login username for mysql $password=DB_SERVER_PASSWORD; # login password for mysql username $dbname=DB_DATABASE; # name of existing database to use $config_values=""; $dbconn=@mysql_connect($server,$user,$password) or http_headers('','Error,Database Connection'); @mysql_select_db($dbname,$dbconn) or http_headers('','Error,Database Connection'); $sql="select configuration_key as cfgKey, configuration_value as cfgValue from configuration where configuration_group_id='333' or configuration_group_id='4'"; $result=@mysql_query($sql,$dbconn) or http_headers('','Error,Database Connection'); while ($row = @mysql_fetch_array($result)) { if ($row['cfgKey'] != "LAST_HASH") $config_values.=$row['cfgKey'].'='.$row['cfgValue']; //to be fed to hashing function define($row['cfgKey'], $row['cfgValue']); } //compute a hash of all the thumbnail config variables, so that if they change new cache files are created $append_hash=md5($config_values); ///hash end for($j=0; $j<$taille; $j++ ) { // NH si pas d'image definie, image par default $path=DIR_FS_CATALOG.DIR_WS_IMAGES.$print_catalog_array[$j]['image']; $parts = explode(".",$path); // If there is no extension function returns false if (count($parts) <= 1) { return false; } // Returns the extension if there is one else { $type = strtolower($parts[count($parts)-1]); } if (strlen($print_catalog_array[$j]['image']) > 0 && file_exists($path)) { $size=getimagesize($path); $old_aspect_ratio = $size[0]/$size[1]; if(PRODUCT_INFO_IMAGE_WIDTH==null){ $new_width = round(PRODUCT_INFO_IMAGE_HEIGHT * $old_aspect_ratio); $imagepath=DIR_FS_CATALOG.DIR_WS_CACHE.$print_catalog_array[$j]['image'].".thumb_prod_infoprod_info_".$new_width."x".PRODUCT_INFO_IMAGE_HEIGHT."_".$append_hash.".".$type; } if(PRODUCT_INFO_IMAGE_HEIGHT==null){ $new_height = round(PRODUCT_INFO_IMAGE_WIDTH / $old_aspect_ratio); $imagepath=DIR_FS_CATALOG.DIR_WS_CACHE.$print_catalog_array[$j]['image'].".thumb_prod_infoprod_info_".$PRODUCT_INFO_IMAGE_WIDTH."x".$new_height."_".$append_hash.".".$type; } if(PRODUCT_INFO_IMAGE_HEIGHT!=null && PRODUCT_INFO_IMAGE_WIDTH!=null){ $new_height = round(PRODUCT_INFO_IMAGE_WIDTH / $old_aspect_ratio); $imagepath=DIR_FS_CATALOG.DIR_WS_CACHE.$print_catalog_array[$j]['image'].".thumb_prod_infoprod_info_".$PRODUCT_INFO_IMAGE_WIDTH."x".$new_height."_".$append_hash.".".$type; } } else { $imagepath=DIR_FS_CATALOG.DIR_WS_IMAGES.DEFAULT_IMAGE; echo 'The product "'.$print_catalog_array[$j]['name'].'" has no picture. I use the generic picture: '.DEFAULT_IMAGE.'<br>'; } ############################################################### and replace the function tep_image() in catalog\includes\functions\html_output.php with this one: // BOF Image Magic function tep_image($src, $alt = '', $width = '', $height = '', $params = '') { global $product_info; //Allow for a new intermediate sized thumbnail size to be set //without any changes having to be made to the product_info page itself. //(see the lengths I go to to make your life easier :-) if (strstr($_SERVER['PHP_SELF'],"product_info.php")) { if (isset($product_info['products_image']) && $src == DIR_WS_IMAGES . $product_info['products_image'] && $product_info[products_id]==$_GET['products_id']) { //final check just to make sure that we don't interfere with other contribs $width = PRODUCT_INFO_IMAGE_WIDTH == 0?'':PRODUCT_INFO_IMAGE_WIDTH; $height = PRODUCT_INFO_IMAGE_HEIGHT == 0?'':PRODUCT_INFO_IMAGE_HEIGHT; $product_info_image=true; $page="prod_info"; } } //Detect whether this is a pop-up image if (strstr($_SERVER['PHP_SELF'],"popup_image.php")) $page="popup"; //do we apply the IE PNG alpha transparency fix? if (strstr(strtolower($src),".png") && CFG_PNG_BUG=="True") $fix_png = true; //send the image for processing unless told otherwise $image = '<img src="' . $src . '"'; //set up the image tag just in case we don't want to process if (CFG_MASTER_SWITCH=="On") $calculate = true; else $calculate=false; // Don't calculate if the image is set to a "%" width if (strstr($width,'%') == true || strstr($height,'%') == true) $calculate = false; // Dont calculate if a pixel image is being passed (hope you dont have pixels for sale) if (strstr($image, 'pixel')) $calculate = false; $image_size = @getimagesize($src); // Decide whether or not we want to process this image if (($width == '' && $height == '' && $page != 'popup' ) || ($width == $image_size[0] && $height == $image_size[0] && $page != 'popup')) { if (CFG_PROCESS_GRAPHICS=="False") $calculate = false; //looks like this is a store graphic rather than product image } // Is this image good to go? if (CONFIG_CALCULATE_IMAGE_SIZE && $calculate) { if ($image_size) { $ratio = $image_size[1] / $image_size[0]; // Set the width and height to the proper ratio if (!$width && $height) { $ratio = $height / $image_size[1]; $width = round($image_size[0] * $ratio); } elseif ($width && !$height) { $ratio = $width / $image_size[0]; $height = round($image_size[1] * $ratio); } elseif (!$width && !$height && !$over_ride) { $width = $image_size[0]; $height = $image_size[1]; } //Encrypt the image filename if switched on if (CFG_ENCRYPT_FILENAMES == "True" && CFG_ENCRYPTION_KEY !="") { $result = ''; $key=CFG_ENCRYPTION_KEY; for($i=0; $i<strlen($src); $i++) { $char = substr($src, $i, 1); $keychar = substr($key, ($i % strlen($key))-1, 1); $char = chr(ord($char)+ord($keychar)); $result.=$char; } $src=urlencode(base64_encode($result)); } //Return the html $image = '<img src="imagemagic.php?img='.$src.'&w='. tep_output_string($width).'&h='.tep_output_string($height).'&page='.$page.'"'; } elseif (IMAGE_REQUIRED == 'false') { return ''; } } //If the size asked for is greater than the image itself, we check the configs to see if this is allowed and if not over-ride if ($width > $image_size[0] || $height > $image_size[1]) { if (CFG_ALLOW_LARGER != 'True'){ $width=$image_size[0]; $height=$image_size[1]; $over_ride = true; } } // Add remaining image parameters if they exist if ($width) { $image .= ' width="' . tep_output_string($width) . '"'; } if ($height) { $image .= ' height="' . tep_output_string($height) . '"'; } if (tep_not_null($params)) $image .= ' ' . $params; $image .= ' border="0" alt="' . tep_output_string($alt) . '"'; if (tep_not_null($alt)) { $image .= ' title="' . tep_output_string($alt) . '"'; } if ($fix_png && CFG_MASTER_SWITCH=="On") { $image .= ' onload="fixPNG(this)"'; } $image .= '>'; return $image; } //EOF Image Magic ############################################################## add in admin\configure.php this: define('DEFAULT_IMAGE', 'no_picture.jpg'); ############################################################## Make sure the thumbs of prod_info page are in the thumbs directory, they will be made automaticly but when the don't exists (yet) the script returns an error. Also don't forget to add no_picture.jpg in the admin\images\ Remember that this contrib has not yet been fully tested because I still get an maximum_execution_timeout so I can't check it(in admin) haven't tested at all in catalog section!!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.