MyBB Community Forums

Full Version: css insert when plugin installing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

It is my first post here Smile

I have a question
I found this in the code plugin to mybb 1.6
$stylesheet = array(
 "sid" => NULL,
 "name"         => "overcss.css",
 "tid"         => "1",
 'attachedto'   => "",
 'stylesheet'   => $db->escape_string('/ * over css code here*/'),
 "cachefile"       => "",
 "lastmodified" => TIME_NOW,
 );

 $sid = $db->insert_query('themestylesheets', $stylesheet);
 $db->update_query('themestylesheets', array('cachefile' => "css.php?stylesheet={$sid}"), "sid='{$sid}'", 1);

 $query = $db->simple_select('themes', 'tid');
 while($theme = $db->fetch_array($query))
 {
 require_once MYBB_ADMIN_DIR.'inc/functions_themes.php';
 update_theme_stylesheet_list($theme['tid']);
 }
but it does not work in 1.8
what is wrong?
You need to update the call to update_theme_stylesheet_list like so:

 update_theme_stylesheet_list($theme['tid'], false, true);

As seen in PluginLibrary: https://github.com/frostschutz/MyBB-Plug...cfd1a63bf3