Jump to content

badlhby

Members
  • Content count

    16
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Bob Lusch
  • Gender
    Male
  • Location
    Northern Ohio, USA
  • Interests
    Slot Cars, Golf, Bowling, TV, Movies, Computers
  1. The comment is correct that XML response is being returned in CHUNKED format. Here is a workaround that I've put in. Hopefully it helps you: I run USPS Methods 7.1 and am having no issues after making the following changes: First you will need to define a function for HTTP_CHUNKED_DECODE somewhere within the code: /** * dechunk an http 'transfer-encoding: chunked' message * * @[member='param'] string $chunk the encoded message * @[member='Return'] string the decoded message. If $chunk wasn't encoded properly it will be returned unmodified. */ function http_chunked_decode($chunk) { $pos = 0; $len = strlen($chunk); $dechunk = null; while(($pos < $len) && ($chunkLenHex = substr($chunk,$pos, ($newlineAt = strpos($chunk,"\n",$pos+1))-$pos))) { if (!$this->is_hex($chunkLenHex)) { trigger_error('Value is not properly chunk encoded', E_USER_WARNING); return $chunk; } $pos = $newlineAt + 1; $chunkLen = hexdec(rtrim($chunkLenHex,"\r\n")); $dechunk .= substr($chunk, $pos, $chunkLen); $pos = strpos($chunk, "\n", $pos + $chunkLen) + 1; } return $dechunk; } /** * determine if a string can represent a number in hexadecimal * * @[member='param'] string $hex * @[member='Return'] boolean true if the string is a hex, otherwise false */ function is_hex($hex) { // regex is for weenies $hex = strtolower(trim(ltrim($hex,"0"))); if (empty($hex)) { $hex = 0; }; $dec = hexdec($hex); return ($hex == dechex($dec)); } Find the occurrences of if ($http->Get('/shippingAPI.dll?' . $request)) $body = $http->getBody(); and change to if ($http->Get('/shippingAPI.dll?' . $request)) { $body = preg_replace( array( '{<sup>®</sup>}', /* Registered Trademark symbol - July 2013 update */ '{<sup>™</sup>}', /* Trademark symbol - July 2013 update */ '/<br>/' ), array ( '', '', '' ), htmlspecialchars_decode($this->http_chunked_decode($http->getBody()))); } All of my quotes come up for both domestic and international without issue. If someone can update this post with the correct locations within the module that would be great.
  2. badlhby

    [Contribution] - USPS Methods

    The comment on the other forum is correct that XML response is being returned in CHUNKED format. Here is a workaround that I've put in. Hopefully it helps you: I run USPS Methods 7.1 and am having no issues after making the following changes: After // START RATE REQUEST FUNCTION insert /** * dechunk an http 'transfer-encoding: chunked' message * * @[member='param'] string $chunk the encoded message * @[member='Return'] string the decoded message. If $chunk wasn't encoded properly it will be returned unmodified. */ function http_chunked_decode($chunk) { $pos = 0; $len = strlen($chunk); $dechunk = null; while(($pos < $len) && ($chunkLenHex = substr($chunk,$pos, ($newlineAt = strpos($chunk,"\n",$pos+1))-$pos))) { if (!$this->is_hex($chunkLenHex)) { trigger_error('Value is not properly chunk encoded', E_USER_WARNING); return $chunk; } $pos = $newlineAt + 1; $chunkLen = hexdec(rtrim($chunkLenHex,"\r\n")); $dechunk .= substr($chunk, $pos, $chunkLen); $pos = strpos($chunk, "\n", $pos + $chunkLen) + 1; } return $dechunk; } /** * determine if a string can represent a number in hexadecimal * * @[member='param'] string $hex * @[member='Return'] boolean true if the string is a hex, otherwise false */ function is_hex($hex) { // regex is for weenies $hex = strtolower(trim(ltrim($hex,"0"))); if (empty($hex)) { $hex = 0; }; $dec = hexdec($hex); return ($hex == dechex($dec)); } Find the occurrences of if ($http->Get('/shippingAPI.dll?' . $request)) $body = $http->getBody(); and change to if ($http->Get('/shippingAPI.dll?' . $request)) { $body = preg_replace( array( '{<sup>®</sup>}', /* Registered Trademark symbol - July 2013 update */ '{<sup>™</sup>}', /* Trademark symbol - July 2013 update */ '/<br>/' ), array ( '', '', '' ), htmlspecialchars_decode($this->http_chunked_decode($http->getBody()))); } All of my quotes come up for both domestic and international without issue.
  3. badlhby

    [Contribution] - USPS Methods

    The USPS_methods_utility.php wasn't returning the correct values. I've added the modules to the contribution that needed to be changed. My site only uses Domestic First Class Package, Priority Mail, and Parcel Post without insurance or delivery confirmation along with International Priority Mail and First Class. The error -2147219101 that was occuring was due to no service being passed when selecting Standard Post as a shipping option. The service needed to be "Parcel Post".
  4. badlhby

    [Contribution] - USPS Methods

    Anyone make modifications for the Parcel Post -> Standard Post changes from USPS? Keep getting an error when selecting it and no description on First Class Package when removing it...
  5. badlhby

    SiteMonitor

    Never mind... it appears that I had FILENAME_SITEMONITOR_CONFIGURE set to .PHP instead of .TXT. Everything is working fine. Nice product :)
  6. badlhby

    SiteMonitor

    I just installed the latest version 3.2 on an RC2A instance. The Delete Reference File worked without error. The Execute Sitemonitor had 2 differences which are expected. But when I run the Manually Execute Sitemonitor, the following error occurs: Warning: opendir(/home/username/public_html) [function.opendir]: failed to open dir: No such file or directory in /home/content/l/e/l/xxxxxxx/html/xxxxx/includes/functions/sitemonitor_functions.php on line 364 Not sure why it's not picking up the correct start directory? When I go back into Configure everything appears to be correct. When I open the sitemonitor_configure_0.txt file it still contains the defaults. Where is the configuration information stored?
  7. badlhby

    [contribution] Tracking Module

    I have a base 2.3.1 install that I'm using to test mods before I incorporate them into my site. I have this contribution working and am in the process of updating the FedEx module to utilize webservices. Everything is working fine except when I'm in admin/orders.php displaying the tracking information in the "text_box" div, the customer, products, and order totals information disappear. Then when I click on [x] Close, the box background goes away and everything else stays as is. It is working fine on the customer side within account_history_info.php. I'm not that good at understanding the Javascript and the div structures yet. Anyone else having this issue?
  8. badlhby

    [Addon} Modular Front Page

    This is on a brand new implementation of 2.3.1 without any mods... After installation of Category Images module and setting the Box Style to Float I receive the following error when attempting to view the main page: 1054 - Unknown column 'c.categories_visible' in 'where clause' select c.categories_id, cd.categories_name from categories_description cd join categories c on c.categories_id = cd.categories_id where c.parent_id = 1 and cd.language_id = '1' and c.categories_visible = '1' order by c.sort_order Also when I set the Box Style to Rows the main page alignment is completely messed up and it only shows the 1st category image. After installation of Featured Products module and selecting EDIT from admin I get the following error: Fatal error: Call to undefined function tep_cfg_pull_down_products() in \admin\modules.php(232): eval()'d code on line 1
  9. badlhby

    Register Globals Easy - Issues

    For those of you having issues with this contribution in relation to other contributions I may have come up with a solution. The problem is that when using the tep_session_register function the $_SESSION value is set to null. When this in turn is interrogated with the tep_session_is_registered function it will always return false unless a value has been assigned to it. Instead of setting it to null I have modified it to set it to whatever value exists in the variable at the time of registration. If the variable never had anything set then it would still be null anyway. I have tested this with several contributions including Admin Access Level Accounts 2.2a which started me on this quest in the first place. Everything appears to be working perfectly but that is only on my site. Try it out it may work for you as well. This will work with configure.php - define('STORE_SESSIONS') set to 'mysql' or not. I have tested it both ways. Within /catalog/admin/includes/functions/sessions.php change around line 57 from this: // AGM Register Globals MOD function tep_session_register($variable) { global $session_started; if ($session_started == true) { $_SESSION[$variable] = null; return true; } else { return false; } } to this: // AGM Register Globals MOD function tep_session_register($variable) { global $session_started, $$variable; if ($session_started == true) { $_SESSION[$variable] = $$variable; return true; } else { return false; } } And within /catalog/admin/includes/functions/sessions.php change around line 57 from this: // AGM Register Globals MOD function tep_session_register($variable) { $_SESSION[$variable] = null; } to this: // AGM Register Globals MOD function tep_session_register($variable) { global $$variable; $_SESSION[$variable] = $$variable; } BTW Great contribution!
  10. badlhby

    AJAX Attribute Manager support

    I changed the name to "wprefx" in order to get it to work. If you leave the entire name or any part of the name as "prefix" then it will not function correctly. If you need the exact code that I have let me know and I'll see about posting it. Bob
  11. badlhby

    On The Fly Watermark Enhanced 1.1

    Never mind, I found the problem. It seems that fully qualifying the directory structure in the .htaccess doesn't work properly. It doesn't get an error anywhere that I could find but it doesn't execute. After changing the .htaccess to the root location it works. RewriteEngine on RewriteRule ^(.*)\.jpg /watermark_image.php?%{REQUEST_FILENAME} Hope this helps others with a problem using Apache 2 and WinXp
  12. badlhby

    On The Fly Watermark Enhanced 1.1

    Great simple contribution. But as others have stated as well I can't seem to get it to work. The images come up as blank boxes with the infamous X is the top left corner. Here is my Apache directory configuration information and my .htaccess file: http.conf # # OsCommerce On the Fly Watermark Contribution # # # Enable .htaccess in images directory # <Directory "C:/www/webroot/history/images"> Options FollowSymLinks AllowOverride FileInfo Order allow,deny Allow from all </Directory> .htaccess RewriteEngine on RewriteRule ^(.*)\.jpg C:/www/webroot/watermark_image.php?%{REQUEST_FILENAME} Can someone post their Apache <directory> configuration information or help me out here. Obviously I don't appear to know how to setup Apache properly. Thanks in advance
  13. badlhby

    coolMenu

    I may have found your problem. Located in the coolmenu.php in the boxes directory you will find a couple of lines near the bottom: $info_box_contents[] = array('text' => ' <img src="images/trans.gif" width="150" height="' . $height . '">'); The problem is that in front of the <img line a tab is used. This is confusing the remaining code because it isn't designed to remove the tab. Thus you sometimes get an error when executing the javascript. I copied the generated section to an html editor / preview program and got an error every time. All you need to do is go to the end of the first line => ' and delete the carriage return and tab characters. Then save the file. I no longer have the issue you are trying to solve. It works great on mine now. Line should read: $info_box_contents[] = array('text' => '<img src="images/trans.gif" width="150" height="' . $height . '">'); Hope this helps, Bob
×