
01-14-2013, 12:48 PM
|
|
|
|
 X-Guru
|
|
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
|
|
|
Re: MAX cdn
Still trying to solve this -- anyone have any ideas?
Quote:
Originally Posted by carpeperdiem
Slight problem here that hopefully someone can help solve...
This code works -- until you go https at checkout, and then it's a mess (css disappears).
I tried the following, but this cased a server error:
PHP Code:
/* MaxCDN edit - comment out next two lines
? '<script type="text/javascript" src="' . $cacheWebFile . '"></script>'
: '<link rel="stylesheet" type="text/css" href="' . $cacheWebFile . '" />';
*/
// Then insert the following:
if ($_SERVER['HTTPS'] != 'on') {
? '<script type="text/javascript" src="' . str_replace("www.domain.com","cdn.domain.com",$cacheWebFile) . '"></script>'
: '<link rel="stylesheet" type="text/css" href="' . str_replace("www.domain.com","cdn.domain.com",$cacheWebFile) . '" />';
}
else
{
? '<script type="text/javascript" src="' . $cacheWebFile . '"></script>'
: '<link rel="stylesheet" type="text/css" href="' . $cacheWebFile . '" />';
}
Hmm... must be my php syntax, right? Isn't this how to do an if? What am I missing? Thanks!
Jeremy
|
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
|
|