function upgrade17_updatecss() { global $db, $output, $orig_config, $mybb; if (file_exists(MYBB_ROOT . $mybb->config['admin_dir'] . "/inc/functions_themes.php")) { require_once MYBB_ROOT . $mybb->config['admin_dir'] . "/inc/functions_themes.php"; } else { if (file_exists(MYBB_ROOT . "admin/inc/functions_themes.php")) { require_once MYBB_ROOT . "admin/inc/functions_themes.php"; } else { $output->print_error("Please make sure your admin directory is uploaded correctly."); } } $output->print_header("Updating CSS"); $query = $db->simple_select("themestylesheets", "*", "name='global.css' OR name='usercp.css'"); while ($theme = $db->fetch_array($query)) { resync_stylesheet($theme); } $query = $db->simple_select("themestylesheets", "*", "name='global.css' OR name='usercp.css'"); while ($theme = $db->fetch_array($query)) { $theme['stylesheet'] = upgrade_css_140_to_160($theme['name'], $theme['stylesheet']); // Create stylesheets cache_stylesheet($theme['tid'], $theme['cachefile'], $theme['stylesheet']); $update_stylesheet = array("stylesheet" => $db->escape_string($theme['stylesheet']), "lastmodified" => TIME_NOW); $db->update_query("themestylesheets", $update_stylesheet, "sid='{$theme['sid']}'"); } echo "<p>The CSS has been successfully updated.</p>"; echo "<p>Click next to continue with the upgrade process.</p>"; global $footer_extra; //$footer_extra = "<script type=\"text/javascript\">$(document).ready(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>"; $output->print_footer("17_done"); }
function upgrade17_updatecss() { global $db, $output, $orig_config, $mybb; if (file_exists(MYBB_ROOT . $mybb->config['admin_dir'] . "/inc/functions_themes.php")) { require_once MYBB_ROOT . $mybb->config['admin_dir'] . "/inc/functions_themes.php"; } else { if (file_exists(MYBB_ROOT . "admin/inc/functions_themes.php")) { require_once MYBB_ROOT . "admin/inc/functions_themes.php"; } else { $output->print_error("Upewnij się, że katalog /admin został poprawnie załadowany na serwer."); } } $output->print_header("Aktualizowanie arkuszy stylów CSS"); $query = $db->simple_select("themestylesheets", "*", "name='global.css' OR name='usercp.css'"); while ($theme = $db->fetch_array($query)) { resync_stylesheet($theme); } $query = $db->simple_select("themestylesheets", "*", "name='global.css' OR name='usercp.css'"); while ($theme = $db->fetch_array($query)) { $theme['stylesheet'] = upgrade_css_140_to_160($theme['name'], $theme['stylesheet']); // Create stylesheets cache_stylesheet($theme['tid'], $theme['cachefile'], $theme['stylesheet']); $update_stylesheet = array("stylesheet" => $db->escape_string($theme['stylesheet']), "lastmodified" => TIME_NOW); $db->update_query("themestylesheets", $update_stylesheet, "sid='{$theme['sid']}'"); } echo "<p>Arkusze stylów CSS zostały zaktualizowane.</p>"; echo "<p>Naciśnij przycisk Dalej, aby kontynuować proces aktualizacji.</p>"; global $footer_extra; //$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatyczne przekierowanie...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>"; $output->print_footer("17_done"); }