From 1fefa2a1486dcf23157dbb3ea154ccf082687f48 Mon Sep 17 00:00:00 2001 From: Random Penguin <25882519-randompenguin@users.noreply.gitlab.com> Date: Sun, 27 Apr 2025 16:40:53 -0500 Subject: [PATCH] Addressing Issues #1 and #2 --- postbox.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/postbox.php b/postbox.php index 0ff09ae..75f3ae3 100644 --- a/postbox.php +++ b/postbox.php @@ -2,7 +2,7 @@ /** * Name: Postbox * Description: Adds support for showing Postbox backgrounds but does NOT add an interface for making them (but users can still make them with BBcode) - * Version: 1.0 + * Version: 1.1 * Author: Random Penguin */ @@ -14,8 +14,17 @@ function postbox_install() Hook::register('head', __FILE__, 'postbox_head'); } function postbox_head(string &$b) -{ - // Add Postbox Styling to Header - $box_styles = __DIR__ . '/postbox.min.css'; - DI::page()->registerStylesheet($box_styles); +{ + /* Check if zen_postbox is active first, only do this if it is not */ + if (!function_exists('zen_postbox_install')){ + /* Add Postbox Styling to Header + DI::page()->registerStylesheet($path) might load before theme + so we will append to $b to make it load much much later + */ + $path = __DIR__ . '/view/postbox.min.css?v=' . DI::app()::VERSION; + if (mb_strpos($path, DI::basePath() . DIRECTORY_SEPARATOR) === 0) { + $path = mb_substr($path, mb_strlen(DI::basePath() . DIRECTORY_SEPARATOR)); + } + $b .= ''; + } } \ No newline at end of file