Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

MAX cdn

 
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4
 
Thread Tools
  #1  
Old 07-31-2012, 10:25 AM
  zone1creative's Avatar 
zone1creative zone1creative is offline
 

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

Default MAX cdn

Hi,

I have just configured a site with MAXcdn.com. They provide a guide but it is not designed for xcart 4.4.x.

The guide can be found at http://www.maxcdn.com/features/integrations/x-cart/

Would be worth xcart contacting MAXcdn to give them a more accurate guide.

I will provide my integration for xcart 4.4.x when I get a chance.

Also when I get results of how good this tool is for site performance
__________________
Pinakin Patel
Zone1 Creative Ltd
http://www.zone1creative.co.uk/
Reply With Quote

The following user thanks zone1creative for this useful post:
ambal (07-31-2012)
  #2  
Old 07-31-2012, 10:40 PM
  ambal's Avatar 
ambal ambal is offline
 

X-Cart team
  
Join Date: Sep 2002
Posts: 4,119
 

Default Re: MAX cdn

> I will provide my integration for xcart 4.4.x when I get a chance.

Thank you for sharing this information in advance.
You are welcome to post it here or submit directly at
http://help.x-cart.com/index.php?title=X-Cart:Performance_tips#Use_Content_Delivery_Network s_like_MaxCDN
__________________
Sincerely yours,
Alex Mulin
VP of Business Development for X-Cart
X-Payments product manager
Reply With Quote
  #3  
Old 09-19-2012, 07:10 AM
 
philrisk philrisk is offline
 

X-Adept
  
Join Date: Jul 2009
Location: Newcastle upon Tyne, UK
Posts: 412
 

Default Re: MAX cdn

Code:
Open smarty.php: ************************************************************************************** $smarty->assign('ImagesDir', $xcart_web_dir . $smarty_skin_dir . '/images'); $smarty->assign('SkinDir', $xcart_web_dir . $smarty_skin_dir); ************************************************************************************** Replace with this: ************************************************************************************** / WCM - MaxCDN Implementation if ($_SERVER['HTTPS'] != 'on') { $smarty->assign('ImagesDir', "http://CdnUrl.example.com" . $smarty_skin_dir . '/images'); $smarty->assign('SkinDir', "http://CdnUrl.example.com" . $smarty_skin_dir); } else { $smarty->assign('ImagesDir', $xcart_web_dir . $smarty_skin_dir . '/images'); $smarty->assign('SkinDir', $xcart_web_dir . $smarty_skin_dir); } **************************************************************************************

This only calls the common_files images though. Looking for better integration.
__________________
Live with Gold 4.5.1
Dedicated Linux server
MaxCDN 4 pull zones
Dedicated SSL

Reply With Quote
  #4  
Old 09-19-2012, 07:53 AM
  zone1creative's Avatar 
zone1creative zone1creative is offline
 

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

Default Re: MAX cdn

There were a few files I had to change including smarty plugin functions. The above only covers a few images. The main images such as thumbnails expanded, and category and manufacturer images are not covered here
__________________
Pinakin Patel
Zone1 Creative Ltd
http://www.zone1creative.co.uk/
Reply With Quote
  #5  
Old 09-19-2012, 07:54 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: MAX cdn

I don't have Max CDN but to include the $AltSkinDir and $AltImagesDir it seems that you would need to find:
PHP Code:
if (@file_exists($alt_skin_dir XC_DS 'css' XC_DS 'altskin.css')) {
        
$smarty->assign('AltImagesDir'$alt_skin_info['web_path'] . '/images');
        
$smarty->assign('AltSkinDir',   $alt_skin_info['web_path']);
    } 
and replace with:
PHP Code:
// WCM - MaxCDN Implementation
if (@file_exists($alt_skin_dir XC_DS 'css' XC_DS 'altskin.css')) {
  if (
$_SERVER['HTTPS'] != 'on')
  {
    
$smarty->assign('AltImagesDir'"http://CdnUrl.example.com" $alt_skin_info['web_path'] . '/images');
    
$smarty->assign('AltSkinDir',   "http://CdnUrl.example.com" $alt_skin_info['web_path']);
    
  }
  else
  {
    
$smarty->assign('AltImagesDir'$alt_skin_info['web_path'] . '/images');
    
$smarty->assign('AltSkinDir',   $alt_skin_info['web_path']);
  }

Again, just shooting in the dark. Look correct?
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #6  
Old 09-19-2012, 11:26 PM
 
philrisk philrisk is offline
 

X-Adept
  
Join Date: Jul 2009
Location: Newcastle upon Tyne, UK
Posts: 412
 

Default Re: MAX cdn

Quote:
Originally Posted by totaltec
I don't have Max CDN but to include the $AltSkinDir and $AltImagesDir it seems that you would need to find:
PHP Code:
if (@file_exists($alt_skin_dir XC_DS 'css' XC_DS 'altskin.css')) {
        
$smarty->assign('AltImagesDir'$alt_skin_info['web_path'] . '/images');
        
$smarty->assign('AltSkinDir',   $alt_skin_info['web_path']);
    } 
and replace with:
PHP Code:
// WCM - MaxCDN Implementation
if (@file_exists($alt_skin_dir XC_DS 'css' XC_DS 'altskin.css')) {
  if (
$_SERVER['HTTPS'] != 'on')
  {
    
$smarty->assign('AltImagesDir'"http://CdnUrl.example.com" $alt_skin_info['web_path'] . '/images');
    
$smarty->assign('AltSkinDir',   "http://CdnUrl.example.com" $alt_skin_info['web_path']);
    
  }
  else
  {
    
$smarty->assign('AltImagesDir'$alt_skin_info['web_path'] . '/images');
    
$smarty->assign('AltSkinDir',   $alt_skin_info['web_path']);
  }

Again, just shooting in the dark. Look correct?

I tried similar to this and the urls looked correct but the images were missing as not populated on maxcdn.
__________________
Live with Gold 4.5.1
Dedicated Linux server
MaxCDN 4 pull zones
Dedicated SSL

Reply With Quote
  #7  
Old 09-19-2012, 11:27 PM
 
philrisk philrisk is offline
 

X-Adept
  
Join Date: Jul 2009
Location: Newcastle upon Tyne, UK
Posts: 412
 

Default Re: MAX cdn

Quote:
Originally Posted by zone1creative
There were a few files I had to change including smarty plugin functions. The above only covers a few images. The main images such as thumbnails expanded, and category and manufacturer images are not covered here

Can you give us a clue on the files you changed?
__________________
Live with Gold 4.5.1
Dedicated Linux server
MaxCDN 4 pull zones
Dedicated SSL

Reply With Quote
  #8  
Old 09-21-2012, 01:16 AM
 
philrisk philrisk is offline
 

X-Adept
  
Join Date: Jul 2009
Location: Newcastle upon Tyne, UK
Posts: 412
 

Default Re: MAX cdn

I worked out out how to use the default images folder plus the alt images folder on maxcdn.

In smarty.php

PHP Code:
if ($_SERVER['HTTPS'] != 'on')
{
$smarty->assign('ImagesDir',    "http://collectables.collectablesreta.netdna-cdn.com" $smarty_skin_dir '/images');
$smarty->assign('SkinDir',        "http://collectables.collectablesreta.netdna-cdn.com" $smarty_skin_dir);
$smarty->assign("AltImagesDir",    "http://collectables.collectablesreta.netdna-cdn.com/skin/ideal_comfort/images");
$smarty->assign("AltSkinDir",    "http://collectables.collectablesreta.netdna-cdn.com/skin/ideal_comfort");
}
else
{
$smarty->assign('ImagesDir',        $xcart_web_dir $smarty_skin_dir '/images');
$smarty->assign('SkinDir',          $xcart_web_dir $smarty_skin_dir);

__________________
Live with Gold 4.5.1
Dedicated Linux server
MaxCDN 4 pull zones
Dedicated SSL

Reply With Quote
  #9  
Old 09-21-2012, 01:17 AM
 
philrisk philrisk is offline
 

X-Adept
  
Join Date: Jul 2009
Location: Newcastle upon Tyne, UK
Posts: 412
 

Default Re: MAX cdn

Just have to work out how to do product images as this didn't work.

PHP Code:
// WCM - CDN Images
        
if (($type == 'T' OR $type == 'P') AND $_SERVER['HTTPS'] != 'on')
        {
        
$image_path str_replace('/path/to/images//','http://collectables.collectablesreta.netdna-cdn.com/',$image_path);
        return 
str_replace('$http_location','',$image_path);
        }
        
// / WCM - CDN Images 
__________________
Live with Gold 4.5.1
Dedicated Linux server
MaxCDN 4 pull zones
Dedicated SSL

Reply With Quote
  #10  
Old 09-21-2012, 01:24 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,070
 

Default Re: MAX cdn

Skip to...

http://forum.x-cart.com/showpost.php?p=352228&postcount=57
__________________
xcartmods.co.uk
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:34 AM.

   

 
X-Cart forums © 2001-2020