X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Third Party Add-Ons for X-Cart 4 (https://forum.x-cart.com/forumdisplay.php?f=45)
-   -   Upgrading X-Cart 4.1.9 to 4.1.12 with CDSEO (https://forum.x-cart.com/showthread.php?t=47955)

Jayk 06-05-2009 02:33 PM

Upgrading X-Cart 4.1.9 to 4.1.12 with CDSEO
 
I posted this over at the WebsiteCM forum, but I'm thinking I should have posted here in the first place as it will probably get seen by more sets of eyes.

I am running a version of CDSEO Links from prior to the release of CDSEO Pro. I'm currently upgrading my cart from X-Cart Gold 4.1.9 to 4.1.12.

In merging the auth.php file, I'm having a bit of trouble with one spot of CDSEO code as there has been a bit of a change in the original X-Cart code.

The particular section has moved to using a conditional operator "?:" and I'm not sure how to merge in the CDSEO code. I've looked at the original 4.1.9 code, the 4.1.9 code with CDSEO Links added, and the 4.1.12 code and I definitely need a little help.

Here is the snippet of code from the stock 4.1.9 auth.php file:

Code:

if ($js_enabled == "Y") {
        $qry_string = ereg_replace("(&*)js=y", "", $QUERY_STRING);
        $js_update_link = $PHP_SELF."?".($qry_string?"$qry_string&":"")."js=n";
}
else {
        $qry_string = ereg_replace("(&*)js=n", "", $QUERY_STRING);
        $js_update_link = $PHP_SELF."?".($qry_string?"$qry_string&":"")."js=y";
}


Here is the 4.1.9 snippet (CDSEO code already in) from the auth.php file:

Code:

if ($js_enabled == "Y") {
        $qry_string = ereg_replace("(&*)js=y", "", $QUERY_STRING);
    if ($cat != "" || $productid != "") {
        $js_update_link = $PHP_SELF."?".($qry_string?"$qry_string&":"")."js=n";
    } else {
          // WebsiteCM - CDSEO Compatible
          $wcm_qs = "?" . $QUERY_STRING;
          $wcm_url = str_replace($wcm_qs,"",$_SERVER['REQUEST_URI']);
          $js_update_link = $wcm_url."?".($qry_string?"$qry_string&":"")."js=n";
    }
}
else {
        $qry_string = ereg_replace("(&*)js=n", "", $QUERY_STRING);
    if ($cat != "" || $productid != "") {
        $js_update_link = $PHP_SELF."?".($qry_string?"$qry_string&":"")."js=y";
    } else {
          // WebsiteCM - CDSEO Compatible
          $wcm_qs = "?" . $QUERY_STRING;
          $wcm_url = str_replace($wcm_qs,"",$_SERVER['REQUEST_URI']);
          $js_update_link = $wcm_url."?".($qry_string?"$qry_string&":"")."js=y";
    }
}


Here is the snippet of code from the stock 4.1.12 auth.php file:

Code:

$qry_string = func_qs_remove($QUERY_STRING, "js");
if ($qry_string)
        $qry_string .= "&";

$js_update_link = basename($PHP_SELF) . "?" . $qry_string . "js=" . ($js_enabled == "Y" ? "n" : "y");
unset($qry_string);


Can anyone give me some guidance or post the snippet from their modified 4.1.12 auth.php file? This is the only file I have left to patch and then I can go live with 4.1.12.

Thanks,
Jason

Jon 06-05-2009 10:37 PM

Re: Upgrading X-Cart 4.1.9 to 4.1.12 with CDSEO
 
I'd highly recommend upgrading to CDSEO Pro:
http://www.x-cart-seo.com/cdseo-pro-for-x-cart/cdseo-basic-vs-pro.php

This should work:

Code:

$qry_string = func_qs_remove($QUERY_STRING, "js");
if ($qry_string)
    $qry_string .= "&";

// WebsiteCM - CDSEO Compatible
$wcm_url = str_replace('?' . $QUERY_STRING,'',$_SERVER['REQUEST_URI']);
$js_update_link = $wcm_url . "?" . $qry_string . "js=" . ($js_enabled == "Y" ? "n" : "y");
unset($qry_string);


Jayk 06-09-2009 12:51 PM

Re: Upgrading X-Cart 4.1.9 to 4.1.12 with CDSEO
 
Thanks for the update Jon. I finished my upgrade to 4.1.12 today and all seems to be running smoothly.

Plans are in the works for us to upgrade to CDSEO Pro. The budget is just a little tight right now with the economy being what it is.

Thanks again,
Jason


All times are GMT -8. The time now is 06:31 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.