Thank you for the code emanuele.
The first one is fine as it intends to change all theme url to the one we need each time the theme is loaded. In the subforum addon case we will be using $_SERVER['SERVER_NAME so that in abc.com subforum it will show abc.com url and in xyz.net it will show xyz.net url.
The second one, though I haven't tested it yet with $_SERVER['SERVER_NAME, I think will be a problem. If I put abc.com url, then in the combined css file, the url will be fixed with abc.com. Similarly if I were to use xyz.net. I am quite sure that they won't be two css file.
The problem will not be on non-ssl domain as it care less about the fixed url (for images) in css file. However, if abc.com is SSL url at https://abc.com while xyz.net is not, then the problem will arise if the combined css is using other domain like xyz.net. For this, I have tested it. https://abc.com will realize that the images aren't coming its domain thus consider the SSL is flawed or has minor security breaches on its images url.
Similarly, font-awesome won't respect cross domain if in the combined css it is referred to as xyz.net while the forum is opened in abc.net. Thus, font awesome won't work as well.
What I did was:
public static function post_css_combine(&$combine_name, $combiner)
{
global $settings;
DEFINE('THEMEDIR', $settings['theme_dir']);
$combine_name = new Site_Combiner(THEMEDIR . '/css', $settings['theme_url'] . '/css');
}
And since (before this) I do not know how to stop fixed url in combined css before, I was using:
$url_old2 = $settings['theme_url'];
$url_new2 = '..';
$filenames = $settings['theme_url'] . '/css/hive-*.css';
if (is_array($filenames) || is_object($filenames)) {
foreach (glob($filenames) as $filename) {
$str = file_get_contents($filename);
$str=str_replace("$url_old2", "$url_new2",$str);
file_put_contents($filename, $str);
}
}
Since now I already have your suggested code, I will simply replace the url with ".." in it. But still, I think, I should find a way to stop the url being inserted in the first place, if possible.
By the way, as I just realized, why this site is not using combined css or js? How can we set that? That will be easier, if we can set it to use default instead of combined css.