View Single Post
  #6  
Old 12-04-2007, 07:36 AM
 
hyratech hyratech is offline
 

Senior Member
  
Join Date: Jul 2005
Posts: 172
 

Default Re: Recent USPS change

Hi.. i'm gettign the follwoing erorr. i got the database patched with no problem. when i went to patch the usps mod i get this:


------------------------------------
Step 1 of 2: Testing patch applicability and generation list of files

Result of the testing phase...

Checking patch.pl permissions: /home/hyratech/public_html/patch.pl ... OK

File Status
shipping/mod_USPS.php could not patch


Status legend:
OK - file ready to patch,
checksum error - patch contents is corrupted,
non-writable - please give those files a write permissions,
not a file - the target is not a file,
not exists - file is missing,
could not patch - patch cannot be applied to this file automatically because it was significantly modified, the patch for this file should be applied manually,
already patched - file was already patched.



Note:
Files which are not exists and already patched will be ignored.


Patch text:
Index: shipping/mod_USPS.php
================================================== =================
@@ -68,6 +87,9 @@

$use_usps_https = false;

+ global $hash;
+ $hash = array();
+
if (empty($USPS_username) || empty($USPS_servername))
$USPS_FOUND = false;

@@ -76,6 +98,9 @@

include_once($xcart_dir."/shipping/mod_USPS_countries.php");

+ if ($userinfo['s_country'] == 'PR') {
+ $userinfo['s_country'] = 'US';
+ }
if (isset($usps_countries[$userinfo['s_country']])) {
$dst_country = $usps_countries[$userinfo['s_country']];
} else {
@@ -121,10 +152,16 @@
function USPS_intl_characterData($parser, $data) {
global $allowed_shipping_methods, $intershipper_rates;
global $mod_USPS_service,$mod_USPS_postage;
+ global $hash;
if($mod_USPS_postage=="*") $mod_USPS_postage=$data;
if($mod_USPS_service=="*") {
foreach ($allowed_shipping_methods as $sk=>$sv) {
- if ($sv["code"]=="USPS" && $sv["destination"]=="I" && stristr($sv["shipping"],$data)) $intershipper_rates[]= array ("methodid"=>$sv["subcode"], "rate"=>$mod_USPS_postage);
+ if ($sv["code"]=="USPS" && $sv["destination"]=="I" && preg_match("/^".preg_quote($sv['shipping'], "/")."$/S", "USPS ".$data)) {
+ if (!in_array($sv["subcode"], $hash)) {
+ $intershipper_rates[]= array ("methodid"=>$sv["subcode"], "rate"=>$mod_USPS_postage);
+ $hash[] = $sv["subcode"];
+ }
+ }
}
$mod_USPS_service=""; $mod_USPS_postage="";
}
@@ -235,11 +276,16 @@
function USPS_dom_characterData($parser, $data) {
global $allowed_shipping_methods, $intershipper_rates;
global $mod_USPS_service,$mod_USPS_postage;
+ global $hash;
if($mod_USPS_service=="*") $mod_USPS_service=$data;
if($mod_USPS_postage=="*") {
foreach ($allowed_shipping_methods as $sk=>$sv) {
- if ($sv["code"]=="USPS" && $sv["destination"]=="L" && preg_match("/^".preg_quote($sv['shipping'], "/")."/S", "USPS ".$mod_USPS_service))
- $intershipper_rates[]= array ("methodid"=>$sv["subcode"], "rate"=>$data);
+ if ($sv["code"]=="USPS" && $sv["destination"]=="L" && preg_match("/^".preg_quote($sv['shipping'], "/")."$/S", "USPS ".$mod_USPS_service)) {
+ if (!in_array($sv["subcode"], $hash)) {
+ $intershipper_rates[]= array ("methodid"=>$sv["subcode"], "rate"=>$data);
+ $hash[] = $sv["subcode"];
+ }
+ }
}
$mod_USPS_service=""; $mod_USPS_postage="";
}

Warning:
Some of files in your instalation got the status "could not patch".

..........................................



to my knowledge. i dotn' think i made any changes to the file. so i think it's got to be somethign else.

Please help... since i dont' have any knowledge of php coding/programing..
My site is up with the help of this forum..


THANKS a MILLION!
__________________
hyratech
X-CART Gold 4.1.10
Hosted - Unix
Reply With Quote