• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

custom link to serve image via CDN

Sorry About Late i was busy
Add this code to config.php

Code:
/** CDN Support
*Please only change this if you know what you're doing.
*Make sure your CDN is configured correctly BEFORE setting this value
*/
$config['cdn_enabled'] = 'true';  // Values: true | false
$config['cdn_url'] = 'http://cdn.***.com';  //http(s)://cdn.mysite.com/

Editing in Function.php

Code:
/**
* relative_to_url
* Converts relative path to url
*/
function relative_to_url($filepath) {
    return str_replace(__CHV_RELATIVE_ROOT__, __CHV_CDN_URL__, str_replace('\\', '/', $filepath));
}

/**
* absolute_to_url
* Converts absolute path to URL
*/

Code:
function absolute_to_url($filepath) {
  if(__CHV_ROOT_DIR__===__CHV_RELATIVE_ROOT__) {
    return __CHV_BASE_URL__.ltrim($filepath, '/');
  }
  return str_replace(__CHV_ROOT_DIR__, __CHV_CDN_URL__, str_replace('\\', '/', $filepath));
}
 
is not loading statics for website... but from what i see this addon is changing all path for file ?
What I want is to serve from CDN just hosted images.
 
Back
Top