Thread: MAX cdn
View Single Post
  #101  
Old 04-16-2014, 02:35 AM
 
kevinrm kevinrm is offline
 

X-Wizard
  
Join Date: Aug 2003
Posts: 1,003
 

Default Re: MAX cdn

Figured this out finally. If you are running 4.6.x, for FOR IMAGES (W, D, P, T images in file system) skip step 4 in post #57, then vary step 7 as follows:

file: /include/func/func.files.php

FIND:
Code:
// image_path is an locally placed image return $current_location . str_replace(XC_DS, '/', substr($image_path, strlen(preg_replace('/' . preg_quote(XC_DS, '/') . '$/S', '', $xcart_dir))));

REPLACE WITH:

Code:
/** MaxCDN support */ if ($_SERVER['HTTPS'] != 'on') { return 'http://cdn.domain.com' . str_replace(XC_DS, '/', substr($image_path, strlen(preg_replace('/' . preg_quote(XC_DS, '/') . '$/S', '', $xcart_dir)))); $current_location = $current_location; } else { return $current_location . str_replace(XC_DS, '/', substr($image_path, strlen(preg_replace('/' . preg_quote(XC_DS, '/') . '$/S', '', $xcart_dir)))); } /* END MaxCDN support */
__________________
X-Cart 5.4.1.39 Live
PHP 7.4.33
5.5.5-10.3.38-MariaDB MariaDB
Apache 2.4
CENTOS 7.8 64Bit Single Quad-Core E3-1241v3 3.4Ghz 8M 1600 w/ HT
32GB RAM 2x 512GB Samsung 850 Pro SSD RAID 1
Reply With Quote