Thread: MAX cdn
View Single Post
  #27  
Old 12-06-2012, 08:56 AM
  zone1creative's Avatar 
zone1creative zone1creative is offline
 

eXpert
  
Join Date: Jan 2009
Location: Hove, UK
Posts: 341
 

Default Re: MAX cdn

Hi

Sorry I have not been following the thread but here are the files I edit to implement maxcdn.

Along with smarty.php do the following

To get xcart to use css and js files from maxcdn edit
include/templater/plugins/function.load_defer_code.php

find
Code:
$result = ('js' == $type) ? '<script type="text/javascript" src="' . $cacheWebFile . '"></script>' : '<link rel="stylesheet" type="text/css" href="' . $cacheWebFile . '" />';

replace with
Code:
$result = ('js' == $type) ? '<script type="text/javascript" src="' . str_replace("www.yoursiteurl.co.uk","yourcdnurl.com",$cacheWebFile) . '"></script>' : '<link rel="stylesheet" type="text/css" href="' . str_replace("www.yoursiteurl.co.uk","yourcdnurl.com",$cacheWebFile) . '" />';

This will cover a lot of your background images and all javascript calls.

Then to make all your category images use cdn

edit include/templater/plugins/function.get_category_image_url.php
find

Code:
return func_convert_amp(func_get_image_url($category['categoryid'], 'C', $category['image_path']));

replace with

Code:
return str_replace("www.yoursiteurl.co.uk","yourcdnurl.com",func_convert_amp(func_get_image_url($category['categoryid'], 'C', $category['image_path'])));
__________________
Pinakin Patel
Zone1 Creative Ltd
http://www.zone1creative.co.uk/
Reply With Quote