-
Tagging @Nao
@@ -430,7 +430,7 @@
<link rel="stylesheet" href="' . $final_script . '">';
}
-function add_plugin_css_file($plugin_name, $original_files = array(), $add_link = false)
+function add_plugin_css_file($plugin_name, $original_files = array(), $add_link = false, $ignore_files = array())
{
global $context, $settings, $theme, $boardurl, $pluginsdir, $board_info;
@@ -483,8 +483,11 @@
$can_gzip = !empty($settings['enableCompressedData']) && function_exists('gzencode') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
$ext = $can_gzip ? (we::is('safari') ? '.cgz' : '.css.gz') : '.css';
+ // Build the target folder from our skin's folder names and main file name. We don't need to show 'common-index-sections-extra-custom' in the main filename, though!
+ $target_folder = trim(implode('-', array_filter(array_diff($original_files, (array) 'common', $ignore_files))), '-');
+
// Cache final file and retrieve its name.
- $final_script = $boardurl . '/css/' . wedge_cache_css_files('', $id, $latest_date, $files, $can_gzip, $ext, array('$plugindir' => $context['plugins_url'][$plugin_name]));
+ $final_script = $boardurl . '/css/' . wedge_cache_css_files($target_folder . ($target_folder ? '/' : ''), $id, $latest_date, $files, $can_gzip, $ext, array('$plugindir' => $context['plugins_url'][$plugin_name]));
if ($final_script == $boardurl . '/css/')
return false;
-
Bug fix or new feature..?
Also -- since my recent suffix rewrites, the plugin code is awfully in need of some love.
-
Bug fix.
Posted: June 13th, 2013, 10:28 PM
add_plugin_css_file('live627:awards', 'awards', true);
Before bug fix, file is
After
$cssdir/awards/firefox21-929971
-
Okay, it's on my local install, for now. ;)
I'm surprised the code isn't more broken actually, ah ah...
Maybe in the plugin JS equivalent, though....!
-
Most of the reason for that is that the plugin CSS and JS files never got kept in step with the various improvements to the mainline functions, but I never knew what was best for backporting to the plugins to be honest.
-
Plus, the JS version underwent a really HEAVY rewrite recently, and I deliberately left the plugin version out, because I didn't deem it to be as important, considering it's unlikely many people would use @if / suffixes in their CSS for now, eh. I like risky situations, I guess..?!