diff --git a/_prepend.php b/_prepend.php index 5161d91..9389dae 100644 --- a/_prepend.php +++ b/_prepend.php @@ -19,4 +19,11 @@ $d = dirname(__FILE__) . '/inc/'; $__autoload['libEPC'] = $d . 'lib.epc.php'; $__autoload['epcRecords'] = $d . 'lib.epc.records.php'; -$__autoload['adminEpcList'] = $d . 'lib.epc.pager.php'; \ No newline at end of file +$__autoload['adminEpcList'] = $d . 'lib.epc.pager.php'; + +$core->url->register( + 'epccss', + 'epc.css', + '^epc\.css', + ['publicEnhancePostContent', 'css'] +); \ No newline at end of file diff --git a/_public.php b/_public.php index 59c23e2..3a1c841 100644 --- a/_public.php +++ b/_public.php @@ -45,12 +45,16 @@ class publicEnhancePostContent */ public static function publicHeadContent(dcCore $core) { + echo dcUtils::cssLoad($core->blog->url . $core->url->getURLFor('epccss')); + } + + public static function css($args) + { + $css = []; $filters = libEPC::blogFilters(); foreach($filters as $name => $filter) { - - if (empty($filter['class']) - || empty($filter['style'])) { + if (empty($filter['class']) || empty($filter['style'])) { continue; } @@ -63,11 +67,16 @@ class publicEnhancePostContent } if (!empty($res)) { - echo - "\n \n" . - " \n"; + $css[] = + "/* CSS for enhancePostContent " . $name . " */ \n" . $res . "\n"; } } + + header('Content-Type: text/css; charset=UTF-8'); + + echo implode("\n", $css); + + exit; } /**