thedarkwizard
Member
Any way to get the banners that members upload to be served from a CDN?
I suppose that involves editing the coding of the software or a plugin.
I suppose that involves editing the coding of the software or a plugin.
Yeah we just need to be able to change the URL. We have the CDN and stuff working, we just need the software to know to serve it from the new URL.Banners are saved as http://yoursite.come/pathtobanner.
Got myself not much experience there, but all you need to do is change the url correct?
If so maybe a simple cron once a day which grabs all member banners who not start with cdn and let cron update the path maybe
Banners are saved as http://yoursite.come/pathtobanner.
Got myself not much experience there, but all you need to do is change the url correct?
If so maybe a simple cron once a day which grabs all member banners who not start with cdn and let cron update the path maybe
$CDN_url = 'http://cdn.site.com'; // NO Ending slash
Ok here is a plugin. It might need a small adjustment, but we will see.
How it works
This plugin will check daily ( together with list reset ) all nomal and premium banners where the url starts with our list url
- We split the url into 2 segments
1. its your list url, e.g site.com or cdn.site.com
2. its the img path, e.g /images/default_button.png or /banners/user.png
- Now we construct a new url by merging the img path with a previously set cdn url. But only if the first segment ( above #1 ) match your list url
- update the path in db
Install
1) First off make a db backup.
2) open the plugin file new_day.php
Update the cdn path and make sure no ending slash is therePHP:$CDN_url = 'http://cdn.site.com'; // NO Ending slash
3) Upload through plugin manager
Now your normal and premium banners would be http://cdn.site.com/images/default_banner.png , http://cdn.site.com/banners/user.png etc
When the list resets after you applied the plugin.
When the list resets after you applied the plugin.