Thread: MAX cdn
View Single Post
  #11  
Old 09-21-2012, 01:30 AM
 
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 PhilJ
Might help...

PHP Code:
/**
 * Store all compiled templates to the single directory
 */
$smarty->use_sub_dirs false;

if (! empty ( 
$alt_skin_dir )) {
    
    
$smarty->template_dir = array ($alt_skin_dir$xcart_dir $smarty_skin_dir );
    
    
$compileDir $var_dirs ['templates_c'] . XC_DS md5 $alt_skin_dir );
    
    if (! 
is_dir $compileDir )) {
        
        
func_mkdir $compileDir );
    
    }
    
    
$smarty->compile_dir $compileDir;
    
    if (@
file_exists $alt_skin_dir XC_DS 'css' XC_DS 'altskin.css' )) {

/* CDN support for smarty BEGIN */
        
define "CDN_SUPPORT"true );
        
        if (! 
CDN_SUPPORT) {
            
$cdn_web_dir $xcart_web_dir;
        } else {
            if (
$HTTPS) {
                
$__CDN_BASE_URL 'https://www.yourstore.com';
            } else {
                
$__CDN_BASE_URL 'http://yourstore.yourstore.netdna-cdn.com';
            }
            
            
$smarty->assign 'AltImagesDir'$__CDN_BASE_URL $alt_skin_info ['alt_skin_dir'] . '/images' );
            
$smarty->assign 'AltSkinDir'$__CDN_BASE_URL $alt_skin_info ['alt_skin_dir'] );
            
            
$cdn_web_dir $__CDN_BASE_URL;
        }
        
    
//  $smarty->assign('AltImagesDir', $alt_skin_info['web_path'] . '/images');
    //  $smarty->assign('AltSkinDir',   $alt_skin_info['web_path']);;        

/* CDN support for smarty END */
    
}

} else {
    
    
$smarty->template_dir $xcart_dir $smarty_skin_dir;
    
$smarty->compile_dir $var_dirs ['templates_c'];



Is that for the AltImages?
__________________
Live with Gold 4.5.1
Dedicated Linux server
MaxCDN 4 pull zones
Dedicated SSL

Reply With Quote