2012-05-01, 09:16 PM
Hi,
below you can see some lines of the activate-function of one of my plugins. Everything is working well but not the caching of the new stylesheet. I would be glad if anyone can show me the way how the stylesheet can or will be cached.
Thank you in advance.
below you can see some lines of the activate-function of one of my plugins. Everything is working well but not the caching of the new stylesheet. I would be glad if anyone can show me the way how the stylesheet can or will be cached.
$css = array(
"name" => "mynewstylesheet.css",
"tid" => 1,
"attachedto" => "usercp.php|mypluginname.php",
"stylesheet" => "blablabla",
"cachefile" => $db->escape_string(str_replace('/', '', mynewstylesheet.css)),
"lastmodified" => TIME_NOW
);
require_once MYBB_ADMIN_DIR."inc/functions_themes.php";
$sid = $db->insert_query("themestylesheets", $css);
$db->update_query("themestylesheets", array("cachefile" => "css.php?stylesheet=".$sid), "sid = '".$sid."'", 1);
$tids = $db->simple_select("themes", "tid");
while($theme = $db->fetch_array($tids))
{
update_theme_stylesheet_list($theme['tid']);
}
Thank you in advance.