Quote:
Originally Posted by PinkMilk
Thanks but didn't work, I have the <link> format working great its just the deleting of the older stylesheet, guess I will have to just remember to clean that folder out from time to time.
|
Oh right - I got the pattern to match but forgot that it needs parens around the matched part to use in the unlink call. If you want to try again, you could try this:
PHP Code:
function delete_css_file($styleid, $csscontents)
{
if (preg_match('#<link rel="stylesheet" type="text/css" href="(style-\w{8}-0*' . $styleid . '\.css)" />#siU', $csscontents, $match))
{
// attempt to delete old css file
@unlink("./clientscript/vbulletin_css/{$match[1]}");
}
}