Hi.
I have this script with a series of functions to insert different css files when a certain urls are in the site map of the site:
<?php
$DomDocument = new DOMDocument();
$DomDocument->preserveWhiteSpace = false;
$DomDocument->load('http://www. website .com/index.php?option=com_xmap&view=xml&tmpl=component&id=1');
$DomNodeList = $DomDocument->getElementsByTagName('loc');
foreach($DomNodeList as $url) {
$urls[] = $url->nodeValue;
}
// Sections;
[B]if(in_array("http://www.sitio .com/en/category/category-a",$urls)){
$css= '<style type="text/css">ul#areas li#ZAF, path#jvectormap1_ZAF {display: inherit;}</style>';
}
echo $css;
if(in_array("http://www.sitio .com/en/category/category-b",$urls)){
$css= '<style type="text/css">ul#areas li#ZAG, path#jvectormap1_ZAG {display: inherit;}</style>';
}
echo $css;
if(in_array("http://www.sitio .com/en/category/category-c",$urls)){
$css= '<style type="text/css">ul#areas li#ZAX, path#jvectormap1_ZAX {display: inherit;}</style>';
}
echo $css; [/B]
.......
The problem is that there are too many functions for Internet Explorer 8, which support up to a number of stylesheets.
Well, too many of them, not just the three in the example.
The question is if there is a way to combine, for instance, the three in bolds.