Well, the idea isn't to try to force it to work, we just want to figure out why it's not working. I think we've figured out that it's something in the function construct_style_options that isn't working right.
So now I'd say put the global.php code back to the original and go to includes/functions.php and find construct_style_options, and try to figure out why that isn't working (because it not only figures out what goes in the dropdown, it also sets $stylecount). There's this part:
PHP Code:
// check to see that the current styleid exists
// and workaround a very very odd bug (#2079)
if (is_array($vbulletin->stylecache["$styleid"]))
{
$cache =& $vbulletin->stylecache["$styleid"];
}
else if (is_array($vbulletin->stylecache[$styleid]))
{
$cache =& $vbulletin->stylecache[$styleid];
}
else
{
return;
}
which could return nothing, that's what made me think that it might be the style cache. There's also the possibility that one of the foreach loops under that isn't executing. So I guess either way, there's probably something wrong with $vbulletin->stylecache. (ETA: it's actually a little more complicated than that since the function calls itself to build the lower levels of the style "tree").
Unfortuantely it'll probably be harder to understand why it's failing than to narrow down which line of code is responsible. I don't understand the format of the stylecache - I would have guessed that it was just an array of styles, but looking at this code, that doesn't make sense.